Skip to content

Merge pr 186 - #189

Merged
chauncygu merged 2 commits into
mainfrom
merge-pr-186
Oct 12, 2026
Merged

chauncygu merged 2 commits into
mainfrom
merge-pr-186

Conversation

@chauncygu

Copy link
Copy Markdown
Contributor

No description provided.

linhongyu510 and others added 2 commits October 1, 2026 03:22
…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>
@chauncygu
chauncygu merged commit 043a270 into main Oct 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants