composable_agents 3.4.1 → 3.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8148fa849ff96e11a995eb6a0ad99f0b13d2628559b2beb45c2500e125c0318
4
- data.tar.gz: fc1de0025450682dfbfe3088a75039af4497bb2575a0eda0dd31eca12d09582f
3
+ metadata.gz: 61425b41148921b109e692bb5041b8fab82e7c9634b5c28eaa19060ab493de0e
4
+ data.tar.gz: 12193ed0af4694ac9eefa92a6344e3f5dc5bb03e439627e404f045488f261544
5
5
  SHA512:
6
- metadata.gz: c393a9e128304acda10e20d6e644515858c78ae643239e7bb4b40a96fc57a6758d186aab5701625bad811fec747d99b528341172da0d9a73c4a1ea9e3773cfb1
7
- data.tar.gz: 0c31274bc54daa0023577f73c784533403e20bcfe8babc197beeb7a1b43a61455bb3b7c0cb456821e41472457dab99d0cabc17a41de214a1d2f9d22897c77b1b
6
+ metadata.gz: 50a08e9ed84f873f7ea53aff8ee173aa4489b316432607bdd3d85e5a335f64eb210f04638b883e81af5a8af31b48e10e54b29cb5300f634ac7188b644804a421
7
+ data.tar.gz: 0a3022f2ce296337e0b9837115c2d92700f2c3db4aca81a8adb713bf6ee291ab02d213da85a4b2351bbce019f27f455c935a258ff25a63adaf2e0f1d77b0f9d0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # [v3.4.3](https://github.com/Muriel-Salvan/composable_agents/compare/v3.4.2...v3.4.3) (2026-11-05 09:18:36)
2
+
3
+ ### Patches
4
+
5
+ * [fix: normalize Cline session context with recursive JSON-safe conversion](https://github.com/Muriel-Salvan/composable_agents/commit/179334f05dbb758161c11c1d9b8d016c24d46909)
6
+
7
+ # [v3.4.2](https://github.com/Muriel-Salvan/composable_agents/compare/v3.4.1...v3.4.2) (2026-11-04 16:45:13)
8
+
9
+ ## Global changes
10
+ ### Patches
11
+
12
+ * [fix(retriable): include exception backtrace in retry debug log](https://github.com/Muriel-Salvan/composable_agents/commit/5230a9ddf73f90335021581592e01342ca0d9768)
13
+
14
+ ## Changes for retriable
15
+ ### Patches
16
+
17
+ * [fix(retriable): include exception backtrace in retry debug log](https://github.com/Muriel-Salvan/composable_agents/commit/5230a9ddf73f90335021581592e01342ca0d9768)
18
+
1
19
  # [v3.4.1](https://github.com/Muriel-Salvan/composable_agents/compare/v3.4.0...v3.4.1) (2026-11-03 17:18:14)
2
20
 
3
21
  ### Patches
@@ -169,32 +169,33 @@ module ComposableAgents
169
169
  # Keep the context in case we need to resume it
170
170
  if cline_cli.session&.messages
171
171
  @context.concat(
172
- cline_cli.session.messages.map.with_index do |message, idx_message|
173
- curated_content = message.content.map.with_index do |content, idx_content|
174
- curated_message = {
175
- type: content.type,
176
- text: (
177
- if idx_message.zero? && idx_content.zero?
178
- # First message is the user prompt, but we don't want to include the context from it
179
- user_prompt
180
- else
181
- content.thinking || content.text
182
- end
183
- ),
184
- input:
185
- if content.input&.question
186
- {
187
- question: content.input.question,
188
- # The options are a Shale collection that JSON can't serialize: keep them as a plain Array
189
- options: content.input.options&.to_a
190
- }.compact
191
- end,
192
- content: content.content
193
- }.compact
194
- curated_message.keys == [:type] ? nil : curated_message
172
+ deep_json_safe(
173
+ cline_cli.session.messages.map.with_index do |message, idx_message|
174
+ curated_content = message.content.map.with_index do |content, idx_content|
175
+ curated_message = {
176
+ type: content.type,
177
+ text: (
178
+ if idx_message.zero? && idx_content.zero?
179
+ # First message is the user prompt, but we don't want to include the context from it
180
+ user_prompt
181
+ else
182
+ content.thinking || content.text
183
+ end
184
+ ),
185
+ input:
186
+ if content.input&.question
187
+ {
188
+ question: content.input.question,
189
+ options: content.input.options
190
+ }.compact
191
+ end,
192
+ content: content.content
193
+ }.compact
194
+ curated_message.keys == [:type] ? nil : curated_message
195
+ end.compact
196
+ curated_content.empty? ? nil : { role: message.role, content: curated_content }
195
197
  end.compact
196
- curated_content.empty? ? nil : { role: message.role, content: curated_content }
197
- end.compact
198
+ )
198
199
  )
199
200
  end
200
201
 
@@ -96,7 +96,7 @@ module ComposableAgents
96
96
  if policy
97
97
  retry_index += 1
98
98
  wait_secs = policy[:wait_secs] || 0
99
- logger.debug "Retry ##{retry_index}: re-running in #{wait_secs}s#{" (exception #{exception})" if exception}"
99
+ logger.debug "Retry ##{retry_index}: re-running in #{wait_secs}s#{" (exception #{exception})\n#{exception.backtrace.join("\n")}" if exception}"
100
100
  sleep(wait_secs) if wait_secs.positive?
101
101
  policy[:modifier]&.call(self)
102
102
  retry_input_artifacts.merge!(policy[:new_input_artifacts] || {})
@@ -241,5 +241,24 @@ module ComposableAgents
241
241
  obj
242
242
  end
243
243
  end
244
+
245
+ # Recursively convert any value into a plain, JSON-serializable Ruby object.
246
+ # Some agent states contain Shale objects (e.g. Cline session messages from the cline-rb Rubygem).
247
+ # Shale's to_json accepts no positional argument, while the JSON gem calls to_json with the generator state,
248
+ # so JSON.dump raises ArgumentError on them. Their to_hash (and the to_hash of their collections and maps)
249
+ # returns the equivalent plain structure, so we recurse into it to normalize nested schemas, collections and maps.
250
+ #
251
+ # @param value [Object] Value to normalize
252
+ # @return [Object] Equivalent JSON-serializable value
253
+ def deep_json_safe(value)
254
+ case value
255
+ when Array
256
+ value.map { |element| deep_json_safe(element) }
257
+ when Hash
258
+ value.to_h { |key, element| [key, deep_json_safe(element)] }
259
+ else
260
+ value.respond_to?(:to_hash) ? deep_json_safe(value.to_hash) : value
261
+ end
262
+ end
244
263
  end
245
264
  end
@@ -2,5 +2,5 @@ module ComposableAgents
2
2
  # @!group Public API
3
3
 
4
4
  # Gem version
5
- VERSION = '3.4.1'
5
+ VERSION = '3.4.3'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composable_agents
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.1
4
+ version: 3.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muriel Salvan