Repository navigation
feat(py/google-genai): wire Antigravity tools, multi-turn continuation, and 09-2026 - #7004
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for built-in tools (google_search, url_context, and code_execution) for the Antigravity model in the Genkit Google Genai package. It updates the AntigravityConfig to include these tools as flat configuration fields, refactors the tool building logic to use a shared utility, and updates the corresponding documentation and tests to reflect these changes. As there were no review comments provided, I have no feedback to offer.
huangjeff5
force-pushed
the
feat/py-antigravity-builtin-tools
branch
from
November 2, 2026 22:06
3519c3c to
99b73af
Compare
cabljac
reviewed
Nov 3, 2026
cabljac
left a comment
Contributor
There was a problem hiding this comment.
A few comments/questions
hilariie
approved these changes
Nov 4, 2026
huangjeff5
force-pushed
the
feat/py-antigravity-builtin-tools
branch
from
November 4, 2026 19:23
d973c37 to
86b17e4
Compare
huangjeff5
force-pushed
the
feat/py-antigravity-builtin-tools
branch
from
November 4, 2026 19:43
86b17e4 to
d64cc2c
Compare
huangjeff5
force-pushed
the
feat/py-antigravity-builtin-tools
branch
from
November 4, 2026 20:53
d64cc2c to
0940322
Compare
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires Antigravity tool support and multi-turn continuation in Python (
genkit-google-genai) to match JS:ai.generate(tools=...)): Forwards Genkit tools as{type: 'function', ...}, handlesrequires_actionpauses infrom_interaction_sync, and keeps already-resolved sandbox file calls (write_to_file, etc.) out ofToolRequestparts.previous_interaction_id+environment_id): Resumes from the lastmodelturn'sinteractionIdandenvironmentIdmetadata, slicinginputto only newer messages so tool calls/results aren't replayed intoinput.extra={'tools': [...]}): Unblocksextra['tools']onAntigravityConfig(sent ahead ofrequest.tools) and rejectsextra={'tools': []}before any HTTP call.Closes #6711
Closes #7043
Main Changes
ANTIGRAVITY_INFO.supports.toolsis nowTrue.from_interaction_synctreatsstatus='requires_action'as a deliberate pause rather than an error, converting unmatchedfunction_callsteps intoToolRequestparts while stashing paired sandbox calls (write_to_file+function_result) incustom['serverFunctionCall']so Genkit's tool loop does not try to run server-side sandbox tools locally.previous_interaction_id+environment_idcontinuation ([py/google-genai] Continue Antigravity multi-turn conversations via previous_interaction_id and environment_id #7043): Whenconfig.previous_interaction_idis unset,select_antigravity_continuationwalksrequest.messagesbackward to the lastmodelturn withmetadata['interactionId'], sends only messages after that turn, and reusesmetadata['environmentId']unless the caller pinned a customenvironment. Explicitprevious_interaction_idalso slices history after the lastmodelturn.extra['tools']escape hatch (no top-level tool fields onAntigravityConfig): Removing'tools'fromANTIGRAVITY_MANAGED_EXTRAgives callers direct control over wire server tools viaAntigravityConfig(extra={'tools': [...]})while keepingtools=strictly atai.generate(tools=...). Anyextra['tools']entries precederequest.toolson the wire.extra={'tools': []}and non-listextra['tools']fail closed withINVALID_ARGUMENTbecause the API readstools: []as unset (proto3 repeated field) and turns all three built-in tools back on.antigravity-preview-05-2026forantigravity-preview-09-2026inKNOWN_ANTIGRAVITY_MODELS:05-2026was shut down upstream;09-2026replaces it in Dev UI action listings and test fixtures.Why not
disable_*booleans?We initially prototyped opt-out flags (
disable_google_search,disable_url_context,disable_code_execution). On the surface that looks ergonomic for "keep defaults except bash" (AntigravityConfig(disable_code_execution=True)), because Antigravity enables all three whentoolsis omitted.In practice,
disable_*forces Genkit to hardcode the server's default tool catalog (('google_search', 'url_context', 'code_execution')) and synthesize the complement list client-side. That creates high ongoing maintenance burden and puts Genkit maintainers in the middle as a blocking dependency before future upstream features work:disable_*(withextra['tools']blocked), callers cannot attach anmcp_server, passsearch_typestogoogle_search, or use a newly launched Interactions server tool until we add dedicated config fields, wire bespoke merge rules, and cut a release:disable_code_execution=Truestill sendstools: [{'type': 'google_search'}, {'type': 'url_context'}]and silently turns off that fourth tool even though the caller never asked to disable it. Withextra={'tools': [...]}, the wire contract is transparent: omittoolsfor server defaults, or pass the exact list of tools the agent may run.mcp_serverandai.generate(tools=...)function tools enter the picture, mixingdisable_*flags with additive tool lists forces non-obvious implicit rules ("does adding an MCP server or function tool keep all three built-ins unlessdisable_*is also set?"). Explicit passthrough + concatenation ([*extra_tools, *function_tools]) avoids hidden synthesis rules.Verified live
Ran each case against
antigravity-preview-09-2026with the agent listing its available tools:tools->execute_bash,google:search,google:browse, plus sandbox file toolstools: [{'type': 'google_search'}, {'type': 'url_context'}]->execute_bashgone; search, browse, file tools staytools: [{'type': 'code_execution'}]-> search and browse gonetools: []/tools: null-> same as notools(all three on)Breaking changes
None for tools:
ai.generate(tools=...)andextra['tools']both previously raisedINVALID_ARGUMENTon Antigravity. InKNOWN_ANTIGRAVITY_MODELS,antigravity-preview-05-2026(shipped in v0.12.0) is replaced byantigravity-preview-09-2026because05-2026is shut down upstream.Cross-SDK
Matches JS (
js/plugins/google-genai/src/googleai/antigravity.tsandjs/plugins/google-genai/src/common/interaction-converters.ts, #6807):AntigravityConfigSchemapasses server tools via.passthrough()(extra={'tools': [...]}in Python), appendsrequest.toolsafterconfig.tools, filters resolved sandboxfunction_callsteps viaserverFunctionCall, and continues stored multi-turn interactions viaprevious_interaction_idandenvironment_id.