miniswen 0.1.0 → 0.1.1
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/lib/miniswen/agent.rb +11 -2
- data/lib/miniswen/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: bb5fbfedca4b31172aef07b9e91d33d61e7e8ca474cd9be98d16a31a5efba2e4
|
|
4
|
+
data.tar.gz: '0613596bc140445d84d4ceea5a64ed68cfbcbf9d7fffd8bcdbe762f9dddf4c71'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2c9e9653f84eeaad53ff560b4396511be725126933370f440c10df2bad4c628c4a246e5d1ad8155dad6aa0ee8004a45b0ca2cadfa13d89555ca872da4a5dfb8
|
|
7
|
+
data.tar.gz: 3712d6ba7f8b4db262d31b9a19c12ee650dab10494dc72a13bc282d008eb47757482bab2bc8a95ab1be46f14055ce1599ec5b6967c9795a17eabd4284f38685e
|
data/lib/miniswen/agent.rb
CHANGED
|
@@ -400,7 +400,14 @@ module Miniswen
|
|
|
400
400
|
error = +""
|
|
401
401
|
error << "Unknown tool '#{call[:name]}'." if call[:name] != "bash"
|
|
402
402
|
arguments = call[:arguments]
|
|
403
|
-
|
|
403
|
+
if !arguments.is_a?(Hash) || !arguments["command"]
|
|
404
|
+
error << "Missing 'command' argument in bash tool call."
|
|
405
|
+
elsif arguments["command"].to_s.include?("\0")
|
|
406
|
+
# Process.spawn rejects strings with NUL bytes, so the command could
|
|
407
|
+
# never reach a shell.
|
|
408
|
+
error << "The 'command' argument contains a null byte (\\x00) and cannot be executed. " \
|
|
409
|
+
"Resend the command without null bytes."
|
|
410
|
+
end
|
|
404
411
|
return error unless error.empty?
|
|
405
412
|
end
|
|
406
413
|
nil
|
|
@@ -497,7 +504,9 @@ module Miniswen
|
|
|
497
504
|
)
|
|
498
505
|
payload(response)
|
|
499
506
|
rescue RubyLLM::Error => e
|
|
500
|
-
|
|
507
|
+
body = e.response&.body.to_s
|
|
508
|
+
detail = body.empty? ? e.message : "#{e.message}: #{body[0, 1000]}"
|
|
509
|
+
raise InfrastructureError, "miniswen: the model call failed: #{detail}"
|
|
501
510
|
rescue Faraday::SSLError, Faraday::ConnectionFailed, Faraday::TimeoutError => e
|
|
502
511
|
raise InfrastructureError, "miniswen: the model call failed: #{e.class}: #{e.message}"
|
|
503
512
|
end
|
data/lib/miniswen/version.rb
CHANGED