Repository navigation
Merge pr 186 - #189
Merged
Merged
Merge pr 186#189
Conversation
…objects
Small/open models on custom providers often wrap tool input in an
object ({'args': {...}}) or a list. _skill_tool handed the raw value
to substitute_arguments, which called prompt.replace("", args)
and crashed with 'TypeError: replace() argument 2 must be str, not
dict' — surfaced verbatim to the model, which retried the same call
and gave up on the skill (#182).
Add _normalize_args(): unwrap a single-string-value dict, join a list
of strings, and return a concrete correction for anything else so the
model gets an actionable error instead of a traceback.
#186 fixed the same crash as #182, which landed first in #188, so the conflict in skill/tools.py is resolved in favour of main: its _coerce_args also accepts null and numbers, and a non-string name no longer raises. Kept from #186: the error for an object that can't be coerced now lists the keys it received, and its four tests. Two of them are adjusted to main's behaviour: the fake sub-run yields a real TextChunk (the tool only returns TextChunk text since #184), and the non-string case uses a boolean because numbers are coerced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.