Repository navigation
fix(py/plugins/google-genai): don't treat already-run Antigravity sandbox calls as tool requests - #6803
fix(py/plugins/google-genai): don't treat already-run Antigravity sandbox calls as tool requests#6803hkarmoush wants to merge 1 commit into
Conversation
…dbox calls as tool requests A function_call that already has a matching function_result ran inside the agent's sandbox, but it was surfaced as a ToolRequest, so the generate loop failed with 'Tool write_to_file not found'. Stash those calls as custom serverFunctionCall parts (replayed as function_call steps), and have from_interaction_sync return pending client calls on requires_action instead of raising.
There was a problem hiding this comment.
Code Review
This pull request introduces support for handling server-side function calls and pending client-side function calls when an interaction is in the requires_action state. It adds the SERVER_FUNCTION_CALL custom type to distinguish between tools executed on the server (which are stashed as custom parts) and pending tools that need to be executed by the client (which are returned as tool requests). Corresponding unit tests have been added and updated to verify these behaviors. There are no review comments, so I have no feedback to provide.
|
Closing since #7004 landed the same fix: already-run sandbox calls go to |
Part of #6711 (Python prerequisite).
from_function_call_stepturned everyfunction_callstep into aToolRequest. Antigravity's sandbox tools (write_to_fileetc.) come back asfunction_callsteps that already have afunction_result, so the generate loop tried to run them and failed withTool write_to_file not found. JS already avoids this.function_callwith a matchingfunction_resultis now stashed as a customserverFunctionCallpart and replayed as afunction_callstep, so its result keeps a partner.ToolRequest.from_interaction_syncreturns the pending client calls onrequires_actioninstead of raisingFAILED_PRECONDITION. With nothing pending (e.g. plan approval) it still raises.Behavior is unchanged while Antigravity stays
tools=False; this unblocks sending function tools from Python. Unit tests only, no request-side changes.