KeyError: 'code' in code_execution_tool when 'code' arg missing #69
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#69
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
code_execution_tool.execute()raisesKeyError: 'code'when the LLM emits a tool call without acodeargument (e.g. a bareruntimecall such as an accidental emptywait/probe call). The traceback:Analysis
self.args["code"]access for python/nodejs/terminal runtimes instead ofself.args.get("code", "").runtime,session,reset,allow_running) already use.get()with defaults, so this is the one inconsistent path.Suggested fix
Replace the three direct accesses with
self.args.get("code", "")and, ifcodeis empty for runtimes that require it, return the existingfw.code.runtime_wrong.md-style error prompt (or a dedicated "missing code argument" prompt) instead of raising.Observed environment
_execute_tool_request→tool.execute(**tool_args)python,terminal,nodejs(same pattern at lines 68/72/76).code— schema guard missing (follow-up to #69/#68) #70code— schema guard missing (follow-up to #69/#68) #194