agent-harness 0.44.38 → 0.44.39
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/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +7 -0
- data/lib/agent_harness/api/ruby_llm_chat_adapter.rb +4 -4
- data/lib/agent_harness/embeddings.rb +23 -3
- data/lib/agent_harness/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0d5db38b075a78e256a47fe690f5f93edc4010e958351e911ab39a8f464287fd
|
|
4
|
+
data.tar.gz: cc6caf680d0a3bac7fc8cbf4e7f8197924ca6fdb9c214d274ac63962901602f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7afcd9e9fe548e8c633169ea93468498b23832cb5996f8df95f8696e24177d583615c27bb7238d4bd78e149f0239f1e8de22d7f0ec916b30e2844681d79d4e07
|
|
7
|
+
data.tar.gz: 2225c383d3e4cbb432ac304bec417384c5390091ef3b793f159a0ddcec5468134cbe6949bbdc6a0945e4d995d9867f4718639d6385e1acf4ea79e0d97d693e4b
|
data/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
* close the RDR-072 upstream epic from #437's retained-scope evidence while keeping unpublished capabilities and downstream adoption behind their explicit release and integration gates ([#430](https://github.com/viamin/agent-harness/issues/430)).
|
|
14
14
|
|
|
15
|
+
## [0.44.39](https://github.com/viamin/agent-harness/compare/agent-harness/v0.44.38...agent-harness/v0.44.39) (2026-11-15)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Dependencies
|
|
19
|
+
|
|
20
|
+
* **deps:** bump ruby_llm from 2.1.1 to 2.2.0 in the minor-updates group across 1 directory ([#541](https://github.com/viamin/agent-harness/issues/541)) ([9cf2118](https://github.com/viamin/agent-harness/commit/9cf21182c9a6f74de2000f9e9db1ca8ff11b4e9d))
|
|
21
|
+
|
|
15
22
|
## [0.44.38](https://github.com/viamin/agent-harness/compare/agent-harness/v0.44.37...agent-harness/v0.44.38) (2026-11-15)
|
|
16
23
|
|
|
17
24
|
|
|
@@ -128,7 +128,7 @@ module AgentHarness
|
|
|
128
128
|
|
|
129
129
|
def function_call_items
|
|
130
130
|
Array(@message.tool_calls&.values).map do |call|
|
|
131
|
-
{"type" => "function_call", "call_id" => call.
|
|
131
|
+
{"type" => "function_call", "call_id" => call.provider_call_id, "name" => call.name,
|
|
132
132
|
"arguments" => JSON.generate(call.arguments || {})}
|
|
133
133
|
end
|
|
134
134
|
end
|
|
@@ -332,13 +332,13 @@ module AgentHarness
|
|
|
332
332
|
def tool_call_events(chunk, state)
|
|
333
333
|
return [] unless chunk.tool_calls
|
|
334
334
|
|
|
335
|
-
chunk.tool_calls.flat_map { |stream_key, call| call_events(stream_key, call, state) }
|
|
335
|
+
chunk.tool_calls.to_h.flat_map { |stream_key, call| call_events(stream_key, call, state) }
|
|
336
336
|
end
|
|
337
337
|
|
|
338
338
|
# Continuation chunks have a nil id and carry the provider's raw JSON
|
|
339
339
|
# fragment as arguments; they join the call that started their key.
|
|
340
340
|
def call_events(stream_key, call, state)
|
|
341
|
-
provider_id = call.
|
|
341
|
+
provider_id = call.provider_call_id || state.provider_id(stream_key)
|
|
342
342
|
return [] unless provider_id
|
|
343
343
|
|
|
344
344
|
events = []
|
|
@@ -438,7 +438,7 @@ module AgentHarness
|
|
|
438
438
|
end
|
|
439
439
|
|
|
440
440
|
def normalize_tool_call(call)
|
|
441
|
-
{provider_id: call.
|
|
441
|
+
{provider_id: call.provider_call_id, name: call.name, arguments_json: JSON.generate(call.arguments || {})}
|
|
442
442
|
end
|
|
443
443
|
|
|
444
444
|
def normalize_usage(tokens)
|
|
@@ -93,11 +93,30 @@ module AgentHarness
|
|
|
93
93
|
rescue Faraday::ConnectionFailed => e
|
|
94
94
|
raise connection_error(e)
|
|
95
95
|
rescue RubyLLM::ServerError, RubyLLM::ServiceUnavailableError, RubyLLM::OverloadedError => e
|
|
96
|
+
raise ProviderError.new(e.message, original_error: e)
|
|
97
|
+
rescue RubyLLM::ConnectionError => e
|
|
98
|
+
raise TimeoutError.new(e.message, original_error: e) if e.timeout?
|
|
99
|
+
|
|
96
100
|
raise ProviderError.new(e.message, original_error: e)
|
|
97
101
|
rescue Faraday::ParsingError, NoMethodError, TypeError => e
|
|
98
102
|
raise MalformedEmbeddingError.new("Malformed embedding response", original_error: e)
|
|
99
103
|
rescue RubyLLM::Error => e
|
|
100
|
-
raise
|
|
104
|
+
raise wrapped_ruby_llm_error(e, inputs.length)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def wrapped_ruby_llm_error(error, expected_count)
|
|
108
|
+
return MalformedEmbeddingError.new("Malformed embedding response", original_error: error) if malformed_batch?(error, expected_count)
|
|
109
|
+
|
|
110
|
+
ProviderError.new(error.message, original_error: error)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def malformed_batch?(error, expected_count)
|
|
114
|
+
body = error.response&.body
|
|
115
|
+
body = JSON.parse(body) if body.is_a?(String)
|
|
116
|
+
rows = body["data"] || body[:data] if body.is_a?(Hash)
|
|
117
|
+
rows.is_a?(Array) && rows.length != expected_count
|
|
118
|
+
rescue JSON::ParserError
|
|
119
|
+
false
|
|
101
120
|
end
|
|
102
121
|
|
|
103
122
|
def context
|
|
@@ -162,7 +181,7 @@ module AgentHarness
|
|
|
162
181
|
|
|
163
182
|
def transient_provider_classification(error)
|
|
164
183
|
original = error.original_error
|
|
165
|
-
return [:transient, :connection_failed] if original.is_a?(Faraday::ConnectionFailed)
|
|
184
|
+
return [:transient, :connection_failed] if original.is_a?(Faraday::ConnectionFailed) || original.is_a?(RubyLLM::ConnectionError)
|
|
166
185
|
return [:transient, :service_unavailable] if original.is_a?(RubyLLM::ServiceUnavailableError)
|
|
167
186
|
return [:transient, :overloaded] if original.is_a?(RubyLLM::OverloadedError)
|
|
168
187
|
|
|
@@ -175,7 +194,8 @@ module AgentHarness
|
|
|
175
194
|
|
|
176
195
|
def transient_provider_error?(error)
|
|
177
196
|
original = error.original_error
|
|
178
|
-
original.is_a?(Faraday::ConnectionFailed) || original.is_a?(RubyLLM::
|
|
197
|
+
original.is_a?(Faraday::ConnectionFailed) || original.is_a?(RubyLLM::ConnectionError) ||
|
|
198
|
+
original.is_a?(RubyLLM::ServerError) ||
|
|
179
199
|
original.is_a?(RubyLLM::ServiceUnavailableError) || original.is_a?(RubyLLM::OverloadedError)
|
|
180
200
|
end
|
|
181
201
|
|