Native Responses schema for code_execution_tool admits calls without code — schema guard missing (follow-up to #69/#68) #194
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/a0-symbolics#194
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The KeyError crash itself is tracked in #69 / #68, but live debugging of the deployed image (commit
ffa5845b, which added a strict native schema forcode_execution_tool) shows the schema guard is incomplete: the advertised schema only requiresruntime, so provider-native tool calls that omitcodepass validation and still crash the tool.Evidence (all from 2026-09-04, container UTC times)
Ct12wUKJ("SSH key setup"), entries 77-79 and 89-91: model emits{"runtime":"terminal","session":0,"reset":false,"allow_running":false}— nocode— schema accepts it,code_execution_tool.pyraisesKeyError: 'code'atself.args["code"], the framework logs "Critical error occurred, retrying...", and with_error_retryconfigured atretries: 10the identical failing turn is re-requested.Fy2aJr64("Git origin update"): the sameKeyError: 'code'critical-retry cycle appears at entries 5, 15, 18, 26, 32.15:15:11Zon the already-patched image (console log:Runtime: terminal / Session: 0 / Reset: False / Allow running: Falsewith noCode:line) → same crash. User-visible symptom is the "model keeps sending the same output" loop.Root cause
plugins/_code_execution/prompts/agent.system.tool.code_exe.mddeclaresInput schema for tool_args: {"type":"object","required":["runtime"],...}.helpers/responses_tools._schema_from_prompt()uses that declaration verbatim as the native Responses function-toolparameters, so the provider-side JSON schema permits omittingcodefor every runtime.self.args["code"](plugins/_code_execution/tools/code_execution_tool.py:68-76).Suggested fix
codeconditionally required forruntimein {terminal,python,nodejs} (e.g.allOf/if-thenon the runtime enum), keepingoutput/resetcode-free.CodeExecution.execute: readcode = self.args.get("code", "")and return a repairable tool response ("codeargument is required for runtime X") instead of raising, so the model gets one corrective tool result instead of a critical-error retry loop.Both layers are needed: the schema prevents the bad call, the tool guard turns an inevitable residual into a cheap repairable error instead of an expensive retry loop.
Cross-ref: lost-rob0t/a0-symbolics#73
Mirrored from
lost-rob0t/a0-symbolics#83via tracker sync.