Repository navigation
fix(google): preserve canonical replay and provider error ownership - #117193
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 1:15 AM ET / 05:15 UTC. ClawSweeper reviewWhat this changesThe PR preserves Google and Vertex signed response parts during stream-to-replay conversion, normalizes tool-call arguments, limits Gemini 3 fallback signatures, and retains provider failure status details. Merge readinessThis PR remains necessary: current Priority: P2 Review scores
Verification
How this fits togetherThe shared Google provider converts OpenClaw conversation history into Gemini/Vertex request parts and converts streamed Google responses back into assistant content. That saved assistant content is replayed on the next provider request, so part identity and provider error metadata affect subsequent tool use and failover behavior. flowchart LR
A[Conversation history] --> B[Google shared converter]
B --> C[Gemini or Vertex request parts]
D[Google streamed response] --> E[Stream response converter]
E --> F[Saved assistant content]
F --> B
E --> G[Provider error outcome]
G --> H[Caller failover and diagnostics]
Decision needed
Why: The patch changes opaque provider replay semantics and error classification, and the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +64, Tests +520. Total +584 across 3 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep exact signed Google Parts on their originating replay blocks, retain the shared transport coercion/error-detail boundary, and land only after a provider owner confirms the supplied real-runtime evidence covers the intended Google SDK contract. Do we have a high-confidence way to reproduce the issue? Yes—current main has a source-deterministic path that skips signed empty assistant text/thinking blocks before replay; the PR adds regression coverage for that path. I did not execute the failing baseline locally because this read-only checkout has no installed dependency tree. Is this the best way to solve the issue? Yes—the patch repairs the provider-owned replay conversion and delegates generic coercion/error metadata to existing shared transport helpers, avoiding signature caches or parallel Google-specific fallback paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4fb19fb8c586. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
1ce978b to
bb5fe27
Compare
|
Merged via squash.
|
…penclaw#117193) * fix(google): preserve provider signatures and failure outcomes * fix(google): satisfy SDK stream event and optional text types * fix(google): preserve signed empty SDK response parts --------- Co-authored-by: Peter Steinberger <[email protected]>
fix(google): preserve Gemini signatures and actionable SDK failures
Root causes repaired
text: ""discriminator on signed empty Parts.Dependency and safety evidence
@google/genai2.13.0Partrequires exactly one content discriminator; its actual serializer retainstext: ""but does not invent it when missing. Both signed-empty text and signed-empty thinking regressions fail on the original branch and now pass.Actual authenticated provider proof (no mocked fetch)
Executed the exact corrected OpenClaw
streamGoogleowner and installed official@google/[email protected]against a real authenticated localhost HTTP/SSE Gemini server using native, unmodified Node fetch. Four actualPOST /v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sserequests carried a realx-goog-api-keyheader (redacted); no fetch, SSRF guard, or provider was mocked.{ "baseline": { "head": "b521ce626bfb479ba39e7919445c76e40d1d21aa", "nextRequestModelTurn": null, "dropsBothSignedEmptyParts": true }, "corrected": { "head": "bb5fe2796e6da6571ba475c77e071de13a82dfd0", "nextRequestModelTurn": { "role": "model", "parts": [ { "text": "", "thoughtSignature": "c2lnbmVkLWVtcHR5LXRleHQ=" }, { "text": "", "thought": true, "thoughtSignature": "c2lnbmVkLWVtcHR5LXRoaW5raW5n" } ] } }, "actualHttp429": { "stopReason": "error", "errorCode": "429", "message": "Proof-only quota exhausted" }, "authenticatedHttpRequests": 4, "mockedFetch": false, "mockedGuard": false, "assertions": "ALL PASS" }Raw redacted transcript:
/private/tmp/openclaw-qa400-google-package-live-proof.txt; reproducible driver:/private/tmp/openclaw-qa400-google-package-live-proof.mjs. Current official Google thought-signature contract documents signatures on empty streamed text Parts and exact Part replay.Full verification
pnpm tsgo:core,pnpm tsgo:core:test,pnpm tsgo:test:packages, and fullpnpm lint:core.node scripts/run-vitest.mjs packages/ai/src/providers/google-shared.convert.test.ts packages/ai/src/providers/google-shared.test.ts: 83 passed.b521ce626bfb479ba39e7919445c76e40d1d21aa; current main618f3298c7dc00a41549e4dec41d8412f651624b; exact clean synthetic merge0028d8caa8b9f5150eee73176de1422c3ca9f923.codex/qa400-google-canonical-owner; corrected immutable commitbb5fe2796e6da6571ba475c77e071de13a82dfd0.check:changedalso exposes an unrelated existing main budget ratchet (OPENCLAW_* count 515 below budget 517); the complete affected production/test type and lint lanes above were therefore verified directly on Testbox.