composable_agents 2.1.0 → 2.1.2
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 +4 -4
- data/CHANGELOG.md +29 -0
- data/lib/composable_agents/ai_agents/agent.rb +6 -6
- data/lib/composable_agents/cline/agent.rb +13 -1
- data/lib/composable_agents/version.rb +1 -1
- data/lib/composable_agents.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0b8e2a1a998985310290f7ec3e98724eb143fa63d71af4766a2be88fdac96f69
|
|
4
|
+
data.tar.gz: 666c08385918a7838701c7f491641764018c0a9720b457af5390ad0e55090f1e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63c24ac135fb84417b82a187d0dc8a9448ca4572ade18fd865b85cb6c7cffaf15a8394c2da147a1e4059048f25ef71441bd586b6d02b2f714951ff10dd382e48
|
|
7
|
+
data.tar.gz: 46b35669f1bcced6b415737a99d892afda89da26c53b8115f3b2e6a48e9bf83ae79db3a8ea67a206a20de940258262d019eea298cc618fd598ed3af5252af9dd
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
# [v2.1.2](https://github.com/Muriel-Salvan/composable_agents/compare/v2.1.1...v2.1.2) (2026-10-27 13:29:45)
|
|
2
|
+
|
|
3
|
+
## Global changes
|
|
4
|
+
### Patches
|
|
5
|
+
|
|
6
|
+
* [fix(composable_agents): extract error message from Cline logs and update cline-rb dependency to 2.1](https://github.com/Muriel-Salvan/composable_agents/commit/5e1ef24265772a1580c75f9889442b576c665edd)
|
|
7
|
+
|
|
8
|
+
## Changes for composable_agents
|
|
9
|
+
### Patches
|
|
10
|
+
|
|
11
|
+
* [fix(composable_agents): extract error message from Cline logs and update cline-rb dependency to 2.1](https://github.com/Muriel-Salvan/composable_agents/commit/5e1ef24265772a1580c75f9889442b576c665edd)
|
|
12
|
+
|
|
13
|
+
# [v2.1.1](https://github.com/Muriel-Salvan/composable_agents/compare/v2.1.0...v2.1.1) (2026-10-22 15:07:09)
|
|
14
|
+
|
|
15
|
+
## Global changes
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
* [chore(deps): update Ruby dependencies and fix comment typo](https://github.com/Muriel-Salvan/composable_agents/commit/908b6a045d0e730f09f83482fcfa4249a12f5cb7)
|
|
19
|
+
|
|
20
|
+
## Changes for deps
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
* [chore(deps): update Ruby dependencies and fix comment typo](https://github.com/Muriel-Salvan/composable_agents/commit/908b6a045d0e730f09f83482fcfa4249a12f5cb7)
|
|
24
|
+
|
|
25
|
+
## Changes for tests
|
|
26
|
+
### Patches
|
|
27
|
+
|
|
28
|
+
* [chore(deps): update Ruby dependencies and fix comment typo](https://github.com/Muriel-Salvan/composable_agents/commit/908b6a045d0e730f09f83482fcfa4249a12f5cb7)
|
|
29
|
+
|
|
1
30
|
# [v2.1.0](https://github.com/Muriel-Salvan/composable_agents/compare/v2.0.0...v2.1.0) (2026-09-06 16:41:14)
|
|
2
31
|
|
|
3
32
|
## Global changes
|
|
@@ -108,7 +108,7 @@ module ComposableAgents
|
|
|
108
108
|
# @param response [RubyLLM::Message] The response of the LLM call
|
|
109
109
|
def track_llm_usage(response)
|
|
110
110
|
# Some responses have no usage metrics (eg. RubyLLM::Tool::Halt responses, or responses without token data)
|
|
111
|
-
return unless response.
|
|
111
|
+
return unless response.tokens
|
|
112
112
|
|
|
113
113
|
@llm_call_responses << response
|
|
114
114
|
usages = @llm_call_responses
|
|
@@ -116,10 +116,10 @@ module ComposableAgents
|
|
|
116
116
|
publish_run_info(
|
|
117
117
|
usage: {
|
|
118
118
|
cost: usages.sum { |run_usage| llm_call_cost(run_usage) },
|
|
119
|
-
input_tokens: usages.sum { |run_usage| run_usage.
|
|
120
|
-
output_tokens: usages.sum { |run_usage| run_usage.
|
|
121
|
-
cache_read_tokens: usages.sum { |run_usage| run_usage.
|
|
122
|
-
cache_write_tokens: usages.sum { |run_usage| run_usage.
|
|
119
|
+
input_tokens: usages.sum { |run_usage| run_usage.tokens&.input || 0 },
|
|
120
|
+
output_tokens: usages.sum { |run_usage| run_usage.tokens&.output || 0 },
|
|
121
|
+
cache_read_tokens: usages.sum { |run_usage| run_usage.tokens&.cache_read || 0 },
|
|
122
|
+
cache_write_tokens: usages.sum { |run_usage| run_usage.tokens&.cache_write || 0 },
|
|
123
123
|
# Context tokens are not summed, as each LLM call contains the full context: keep the last call's value.
|
|
124
124
|
context_tokens: llm_call_context_tokens(last_response),
|
|
125
125
|
context_tokens_limit: llm_call_context_tokens_limit(last_response)
|
|
@@ -147,7 +147,7 @@ module ComposableAgents
|
|
|
147
147
|
# @return [Integer] Number of context tokens consumed by the LLM call
|
|
148
148
|
def llm_call_context_tokens(response)
|
|
149
149
|
tokens = response.tokens
|
|
150
|
-
%i[input output
|
|
150
|
+
%i[input output cache_read cache_write thinking].sum { |component| tokens.public_send(component) || 0 }
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
# Get the context window limit of the model used by a single LLM call.
|
|
@@ -100,6 +100,18 @@ module ComposableAgents
|
|
|
100
100
|
|
|
101
101
|
private
|
|
102
102
|
|
|
103
|
+
# Extract the error message from a Cline log.
|
|
104
|
+
#
|
|
105
|
+
# @param error_log [Cline::Log] The error log object
|
|
106
|
+
# @return [String] The error message
|
|
107
|
+
def extract_error_message(error_log)
|
|
108
|
+
error_log.err&.message ||
|
|
109
|
+
error_log.error_message ||
|
|
110
|
+
error_log.error_name ||
|
|
111
|
+
error_log.msg ||
|
|
112
|
+
error_log.to_s.strip
|
|
113
|
+
end
|
|
114
|
+
|
|
103
115
|
# Process a user prompt.
|
|
104
116
|
#
|
|
105
117
|
# @param user_prompt [String] The rendered user prompt
|
|
@@ -158,7 +170,7 @@ module ComposableAgents
|
|
|
158
170
|
end,
|
|
159
171
|
**@cli_options
|
|
160
172
|
)
|
|
161
|
-
raise "Error: #{result[:error]
|
|
173
|
+
raise "Error: #{extract_error_message(result[:error])}".strip if result[:error]
|
|
162
174
|
|
|
163
175
|
# Keep the context in case we need to resume it
|
|
164
176
|
if cline_cli.session&.messages
|
data/lib/composable_agents.rb
CHANGED
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: 2.1.
|
|
4
|
+
version: 2.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Muriel Salvan
|
|
@@ -15,28 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '0.
|
|
18
|
+
version: '0.13'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '0.
|
|
25
|
+
version: '0.13'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: cline-rb
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '2.1'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
39
|
+
version: '2.1'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: commonmarker
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|