Repository navigation
fix(venice): tool calls continue after Gemini responses - #119593
wenyonglim wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 138d146f19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const fromToolCall = tc.thought_signature; | ||
| return typeof fromToolCall === "string" && fromToolCall.length > 0 ? fromToolCall : undefined; |
There was a problem hiding this comment.
Preserve Venice signatures through storage
Capturing tc.thought_signature makes Venice/Gemini signatures part of the transcript, but transcript storage only preserves arbitrary thoughtSignature bytes for Google-compatible OpenAI-completions routes; a Venice assistant message is still api: openai-completions, provider: venice, so redactTranscriptMessageForStorage falls through to normal secret-pattern redaction. When the opaque signature contains token-shaped bytes and the session is persisted/reloaded, extensions/venice/stream.ts replays the masked value as tool_calls[].thought_signature, which violates this exact-signature replay path and can make the next Venice tool continuation fail again. Please add Venice/Gemini to the preservation route before storing these top-level signatures.
AGENTS.md reference: AGENTS.md:L62-L62
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 86c3f20. Venice Gemini OpenAI-completions routes now preserve structurally valid opaque tool-call signatures through transcript redaction, with a credential-shaped regression case proving the exact bytes survive storage sanitization.
|
Codex review: needs changes before merge. Reviewed August 5, 2026, 9:19 AM ET / 13:19 UTC. ClawSweeper reviewWhat this changesThe branch captures Venice Gemini’s top-level tool-call signature, preserves it in transcripts, and replays or downgrades historical tool-call batches before Venice Gemini continuations. Merge readinessKeep open. The PR has convincing exact-head live proof for the original Venice continuation failure, but the prior P1 remains: its replay and downgrade maps treat Priority: P1 Review scores
Verification
How this fits togetherThe OpenAI-compatible transport turns model output into agent transcript messages, and the Venice provider plugin patches outgoing requests. Persisted transcript history must retain provider-owned signature metadata while keeping each assistant tool-call batch paired with only its own tool results. flowchart LR
A[Provider stream response] --> B[OpenAI-compatible transport]
B --> C[Persisted agent transcript]
C --> D[Venice provider wrapper]
D --> E{Assistant batch has Venice signature}
E -->|Yes| F[Replay matching tool call]
E -->|No or foreign| G[Downgrade that batch to text]
F --> H[Venice continuation]
G --> H
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +161, Tests +307. Total +468 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use an occurrence-aware, ordered transform that binds signatures to one assistant tool-call batch and rewrites only that batch’s contiguous tool-result run, with repeated-ID regressions for both stale-signature and stale-result cases. Do we have a high-confidence way to reproduce the issue? Yes for the reported bug: the supplied direct Venice probe and installed-release run establish the original failure, while current source shows why top-level signatures are not captured. The remaining repeated-ID defect is high-confidence source-reproducible and needs a regression test. Is this the best way to solve the issue? No. The provider-local wrapper is the correct ownership boundary, but its transcript-global ID maps violate turn-scoped tool-call/result ownership; an occurrence-aware repair is the safer solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d85920c03e25. LabelsLabel justifications:
EvidenceAcceptance criteria:
What 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
History |
Exact-head live runtime proofTested commit Scenario:
Redacted terminal evidence: Local verification at the same head: This specifically exercises the reviewer-identified mixed-provider persisted-history edge case. Exact same-route Venice signatures still win; only unsigned/foreign Gemini 3 history receives Google's documented validator-skip marker, and Gemini 2.5 is left unchanged. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Updated exact-head proof for the persisted-history edge caseCommit While reproducing the real Signal failure, I found that Venice's Gemini 3.6 OpenAI bridge does not successfully accept Google's documented dummy thought-signature values for old unsigned calls. The complete request ends with a non-empty user turn, but Venice returns: The minimized trigger is one legacy unsigned function-call/result pair followed by a new user turn. Removing the signature entirely instead returns the expected missing-
Redacted live proof at the new head: Local verification: Secrets, message bodies, and raw signatures were omitted from this evidence. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Repeated-ID repair at exact head
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Follow-up on exact head 7e1699c:\n\n- The third live Signal failure exposed reused provider-local tool call IDs (call_0 on separate assistant turns). The previous transcript-global lookup could pair a later signature with an earlier call.\n- Replay is now scoped chronologically to each assistant tool-call batch and matched by occurrence, ordinal, ID, and tool name. Associated tool-result rewriting is likewise limited to the immediately contiguous batch.\n- Regression coverage includes two separate signed call_0 occurrences with distinct signatures, plus an unsigned-then-signed call_0 sequence.\n- Local verification: Venice tests 7/7 passed; extension typecheck passed; oxlint passed; diff check passed; autoreview found no P0/P1 findings (0.98 confidence).\n\nThe compatible 2026.7.1 plugin is installed locally but not activated; the managed Gateway has deliberately not been restarted during the live conversation.\n\n@clawsweeper re-review |
|
Closing at the author's request after a third failure in the real Signal thread. The latest failure showed provider-local tool-call IDs being reused across assistant turns; despite passing isolated and exact-copy tests, the proposed compatibility layer was not proven reliable in the user's actual workflow. Withdrawing the PR rather than presenting it as solved. The underlying issue remains open for a cleaner future approach. |
Closes #119591
What Problem This Solves
Fixes an issue where users selecting a Gemini model through Venice could chat normally, but the agent turn failed with HTTP 400 immediately after any OpenClaw tool completed.
Why This Change Was Made
Venice currently emits Gemini tool-call
thought_signaturevalues as a top-level field on each OpenAI-compatible tool call and requires the exact opaque value on the continuation request. The generic completions transport now retains that returned shape, while the Venice provider wrapper replays it only for same-route Gemini turns; existing Google nested-signature and cross-route behavior is unchanged.User Impact
Venice Gemini users can complete browsing and other tool-using turns instead of receiving a generic processing error after the tool runs. Other Venice models and other OpenAI-compatible providers are unaffected.
Evidence
venice/gemini-3-6-flashtool turn completed the tool and the continuation failed with HTTP 400 for missingthought_signature.thinking=highcalled thereadtool and completed successfully: both Venice requests returned HTTP 200,toolSummary.calls=1,failures=0, and the final answer wasopenclaw.node scripts/run-vitest.mjs src/agents/openai-transport-stream.usage-and-calls.test.ts(45 passed)pnpm exec vitest run --config test/vitest/vitest.full-extensions.config.ts extensions/venice/index.test.ts(4 passed)pnpm checkpnpm buildgit diff --checkAI assistance: Codex was used to trace the transport path, implement the focused change, and draft tests/PR text. The behavior and API contract were independently verified with the live Venice endpoint; all changed code was reviewed and the commands above were run locally.