Skip to content

Keep the agent-sdk backend to the call's tools and report an SDK error as the cause - #25

Merged
peterbjohnson merged 6 commits into
mainfrom
wb/t29
Sep 21, 2026
Merged

peterbjohnson merged 6 commits into
mainfrom
wb/t29

Conversation

@peterbjohnson

Copy link
Copy Markdown
Member

On the relocked t26 branch, corpus ExampleContents UCL_MechEng --suffix pdf recorded Worksheet_1.pdf (paired with Worksheet_1_solutions.pdf, two sources, 50-odd blocks) as error: ResultError — Claude Code returned an error result: Reached maximum number of turns (8). The spec call has no tools, so eight turns means the agent-sdk backend let Claude Code use its own tools (Read, Bash, and the rest) on a prompt that mentions file paths, and it wandered until max_turns stopped it. Two fixes in in2lambda_agent/model.py's AgentSDKBackend: pass allowed_tools as exactly the call's tools (none for the spec call) and disallowed_tools for every built-in, and set permission_mode so nothing prompts; and when the SDK returns an error result, raise ModelUnavailable-style ModelError with the SDK's message so the corpus row reads spec failed: <message> and not error: ResultError. A test with a fake SDK client asserts the options passed. Done when Worksheet_1.pdf's spec call completes in one turn on the agent-sdk backend (I run it) and the row for an SDK error names the cause.


Workbench ticket t29.

@peterbjohnson
peterbjohnson merged commit a666d79 into main Sep 21, 2026
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.

1 participant