Repository navigation
fix(google): restore tool calls with Python keyword parameters - #191561
Merged
Merged
Conversation
Project declared keyword parameters to unused wire aliases, restore arguments for execution, and re-encode signed history through the shared Google owner. Reuse the converter for explicit prompt caches and preserve canonical tool schemas for cached-response decoding. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: HighervGround <[email protected]>
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
roboclaw-bot
marked this pull request as ready for review
November 3, 2026 00:33
Keep the extension fixture local and assert the complete SDK tools request without narrowing its general ToolListUnion through a declaration-only helper. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: HighervGround <[email protected]>
Collaborator
Author
|
Merged via squash.
|
1 task done
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 3, 2026
…law#191561) Supersedes openclaw#143178, thanks @HighervGround. Related: openclaw#143176 ## What Problem This Solves Fixes Gemini tool calling when a declared parameter is a Python keyword such as `from`, `class`, or `lambda`. ## User Impact Google and Vertex tools retain their original parameter names at execution. Existing suffix names and nested user data remain intact. This replacement includes only the Google parameter repair. ## Why This Change Was Made A shared Google converter chooses unused underscore aliases for declared top-level keyword parameters, restores returned arguments, and reapplies the aliases during signed history replay. GenerateContent, Vertex, Interactions, and explicit prompt caches use the same mapping. Cached requests retain canonical schemas for decoding while omitting cached declarations from the outgoing request. The duplicate prompt-cache declaration builder is removed. Necessary production growth implements collision-safe schema-based mapping across the existing transports; there is no new cache, setting, persistence format, or dependency. ## Evidence - Current-main source check: `0aaff8f10c2ca6c998b75db5c1c820bf4a83971d` passes tool properties and returned arguments unchanged. The contributor's captured Vertex bisection reports `MALFORMED_FUNCTION_CALL` with `automations.in`, and a valid call after renaming that property. [Google's function-calling documentation](https://ai.google.dev/gemini-api/docs/function-calling) describes JSON Schema parameters but does not document a Python-keyword restriction. No live Gemini API calls were made. - Red before: on the unchanged main implementation, `packages/ai/src/providers/google-shared.test.ts` had exactly the two new failures (outgoing schema and inbound restoration), with 32 existing tests passing. [Crabbox run](https://github.com/openclaw/openclaw/actions/runs/41551852373). - Green after: 211 tests pass across the four changed behavioral suites (SDK/Interactions, prompt cache, managed Google/Vertex); the 14 prompt-prefix cases and the 28 message-conversion/lifecycle/request-config cases also pass. Touched-file type-aware lint (0 warnings/errors), format, and `git diff --check` pass. [Crabbox proof](https://github.com/openclaw/openclaw/actions/runs/41552191472). Final named-test invocation took 45.49 s plus setup; the managed transport file took 10.84 s wall time, with the cache suite dominated by existing compiled-worker setup. Exact-head [CI run 41555285820](https://github.com/openclaw/openclaw/actions/runs/41555285820) passed: 45 successful jobs, 28 skipped, 11 min 51 s wall time and 7,810 summed job-seconds. - CI repair proof: [the first CI run](https://github.com/openclaw/openclaw/actions/runs/41553763628) found an extension test importing a core helper and a declaration-only assertion helper accepting the SDK’s broader tool-list type. Both test-only defects are fixed; production code is unchanged. The boundary guard, managed Google/Vertex transport, and SDK regression file now pass all 167 cases in 57.71 s, with touched-file lint/format green. [Crabbox repair proof](https://github.com/openclaw/openclaw/actions/runs/41554614333). - Review: Local autoreview of the complete implementation diff against `0aaff8f10c2ca6c998b75db5c1c820bf4a83971d`, P0–P2, returned `scoped-clean`; no findings. A supplemental P0–P2 review of the CI fixture repairs against `6fe9bc666896375a6ae42fa5e2f925acbaae10f9` also returned `scoped-clean`. Simplification retained one schema/argument mapping owner and removed the duplicate cached declaration projection. - LOC: production +116/−19 (net +97), tests/support +342/−11 (net +331). The dedicated test-line allocation covers only these regressions: schema projection, execution, signed replay, managed/Vertex transport, Interactions argument deltas, and cached declarations. - The contributor branch was read through `gh` and was never checked out or run. Validation ran on our reimplementation in Blacksmith Testbox through Crabbox. Broad proof is PR CI. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: HighervGround <[email protected]>
tideclaw-bot
added a commit
that referenced
this pull request
Nov 5, 2026
Backport accepted fixes onto 2026.11.5-beta.2. Base: bc061f9 Canonical source tree before commit: e6c0c39 These are adapted/squashed backports; do not claim each is an exact Git cherry-pick. Source provenance (selected verified commits; other cohorts use their frozen patch/adoption manifests): runtime-B: b20a0cc fix(macos): connect with configured credentials despite stale app environment (#191468) c4c0942 fix(update): failed updates from 10.7–10.9 crash in automatic migration recovery (#189713) 6aae408 fix(update): preserve recovery errors and async triage callbacks (#191495) 8910654 fix(macos): prevent first-launch Gateway failures after upgrades (#191436) 00b2ff4 fix: parent sessions miss child approvals with a custom session store (#189827) c6142a8 fix: avoid copying managed plugin binaries during Gateway startup (#187865) e72b356 fix(anthropic): avoid token profile collisions (#187875) 807075d fix(anthropic): set API workspace at login (#186976) bafe92f fix(exec): preserve no-timeout results from macOS app nodes (#190729) 9b05a64 fix(imessage): use a PostgreSQL-safe recovery cursor key (#184919) 6ba197f fix: session search on PostgreSQL scans every transcript row instead of using the text index (#187909) 4f49aa5 fix(sessions): PostgreSQL session search scans every transcript row again after the 5th search on a connection (#188979) de3936c fix(macos): Mac tab shows a blank or stale page when a load fails (#185432) e977080 fix(macos): prevent duplicate voice sends and false sent feedback (#186271) provider-compaction: 1b43c2e fix(compaction): preserve active request provenance (#180214) 7b0cfe3 fix(google): restore tool calls with Python keyword parameters (#191561) 9039ceb fix(ci): keep compaction attribution helpers internal d6a1327 feat(google): use the Interactions API for Gemini Flash models (#189395) fe0f8d1 fix(google): Gemini models ignore configured topP (#190695) history: c51d733 fix(sessions): stop expanding archive reads from exhausting memory (#190690) 3c8bd4d fix(sessions): page oversized earlier history instead of failing at 8 MiB (#188450) b195f61 fix(sessions): page oversized transcript history in both directions (#188483) b65482e fix(gateway): preserve older history across hidden message gaps (#188557) 3d4fc94 fix(sessions): avoid oversized listing and imported-history reads (#189284) 33e7baf fix(sessions): bound active accounting without blocking writers (#190182) 682ade7 fix: preserve chat history continuation metadata (#188612) runtime-C: 7e005b0 fix(macos): keep secrets when a Gateway config save fails (#187734) 15cf738 fix(macos): keep Gateway auth when Tailscale exposure is turned off (#187664) b53a06b perf(update): read candidate state inventory without copying the shared database (#187921) 970fc4e fix: restore CLI message sends with agent tool policies (#188058) 73ad731 fix: stop model fallback when session capability metadata changes (#179312) 32305db fix: subagent turns fail after session metadata changes (#183501) d13bd0f fix(codex): include relay conversation instructions in trajectory (#189005) e375530 fix: replies after a plugin reload from Control UI go to the session's last external chat (#190982) 9346376 fix: reasoning-only retry is refused by Anthropic as reasoning_extraction (#184434) direct-auth-state: 1b15408 fix(models): keep the model list when one plugin-owned provider lacks a credential (#189014) 7d8dc60 fix: recover startup migration with retained worker index (#189023) capacity: 41772e3 fix(worktrees): settle completed disk debt on refused postchecks (#188727) command-once-189369: 8269137 fix(plugins): plugin commands that continue the agent run three times on native command turns (#189369) pg-board-189564: 7232a8d fix(boards): publish widgets with PostgreSQL storage (#189564) queued-edit-189869: 92b32ca fix: hold queued messages through inline edits (#189869) Preserve source attribution from original commits. For a genuinely exact individual pick only, use the conventional (cherry picked from commit <sha>) line. Full file-level provenance: coverage-manifest.json; reviewed patch hashes: artifact-registry.json. No held136/native82 content adopted by this work. No release or full-candidate qualification claim. Additional original-source identities (exact adapted hunk scope is in frozen artifacts): release-guides-185258: 39c37e6 docs(release): define ledger-first hotfix routing (#185258) UI-history: 10a6e4f fix(ui): scope provider-add discovery warning to its own provider (#188541), 3d7b4c4 fix(ui): never fail loading earlier chat history without a boundary (#188372) obsolete-cache-188203: 90d82c2 fix: preserve completed reasoning and refill chat snapshots (#188203) webhook-169778: b1f643f fix(startup): keep webhook decisions startup recorded for channels Doctor left pending (#169778) schema-lease-188391: ba6cfcd fix(state): keep lease renewal independent of parent admission (#188391) backfill-188976: c75a8a8 fix(gateway): stop session row backfill once the Gateway is closing (#188976) canonical-disable-188846: 88b56ee fix(config): auto-enable reads and writes mixed-case plugin policy under the canonical id (#188846) matrix-177272: 5a6d22c fix(matrix): stop seeding new thread sessions from the room transcript (#177272) provider-hook-189059: 0588f51 fix(models): isolate every per-provider catalog failure (#189059) unicode-189868: 87396e7 fix(oc-path): avoid reading and editing a different Unicode key (#189868) replay-cohort: 2031044 fix(sessions): acknowledge committed input retries without duplicate turns (#188527), 9114431 fix: resume configured fallback after interrupted attempts (#188672) Co-authored-by: RomneyDa <[email protected]>
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.
Supersedes #143178, thanks @HighervGround.
Related: #143176
What Problem This Solves
Fixes Gemini tool calling when a declared parameter is a Python keyword such as
from,class, orlambda.User Impact
Google and Vertex tools retain their original parameter names at execution. Existing suffix names and nested user data remain intact. This replacement includes only the Google parameter repair.
Why This Change Was Made
A shared Google converter chooses unused underscore aliases for declared top-level keyword parameters, restores returned arguments, and reapplies the aliases during signed history replay. GenerateContent, Vertex, Interactions, and explicit prompt caches use the same mapping. Cached requests retain canonical schemas for decoding while omitting cached declarations from the outgoing request.
The duplicate prompt-cache declaration builder is removed. Necessary production growth implements collision-safe schema-based mapping across the existing transports; there is no new cache, setting, persistence format, or dependency.
Evidence
65a125adc598deff3ded853f155acfa616d39c0cpasses tool properties and returned arguments unchanged. The contributor's captured Vertex bisection reportsMALFORMED_FUNCTION_CALLwithautomations.in, and a valid call after renaming that property. Google's function-calling documentation describes JSON Schema parameters but does not document a Python-keyword restriction. No live Gemini API calls were made.packages/ai/src/providers/google-shared.test.tshad exactly the two new failures (outgoing schema and inbound restoration), with 32 existing tests passing. Crabbox run.git diff --checkpass. Crabbox proof. Final named-test invocation took 45.49 s plus setup; the managed transport file took 10.84 s wall time, with the cache suite dominated by existing compiled-worker setup. Exact-head CI run 41555285820 passed: 45 successful jobs, 28 skipped, 11 min 51 s wall time and 7,810 summed job-seconds.65a125adc598deff3ded853f155acfa616d39c0c, P0–P2, returnedscoped-clean; no findings. A supplemental P0–P2 review of the CI fixture repairs against6fe9bc666896375a6ae42fa5e2f925acbaae10f9also returnedscoped-clean. Simplification retained one schema/argument mapping owner and removed the duplicate cached declaration projection.ghand was never checked out or run. Validation ran on our reimplementation in Blacksmith Testbox through Crabbox. Broad proof is PR CI.