Skip to content

[Fix] Gemini judge fails after tool calls - #3045

Open
roomote-roomote[bot] wants to merge 1 commit into
developfrom
fix/judge-openrouter-reasoning-2c1zg1m5315ad
Open

roomote-roomote[bot] wants to merge 1 commit into
developfrom
fix/judge-openrouter-reasoning-2c1zg1m5315ad

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

​Opened on behalf of @mrubens. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

What changed

  • Consolidate split OpenRouter reasoning details before OpenCode replays Gemini 3 assistant tool-call turns.
  • Preserve genuine opaque encrypted blocks and their tool-call IDs unchanged.
  • Add Google's documented validator-bypass sentinel only when an older or partial tool-call history has no encrypted reasoning block.
  • Cover preservation, deduplication, idempotent fallback injection, and provider/model scoping in the shared plugin used by both standard tasks and prompt-only subagent runtimes.

Why this change was made

Gemini judge subagents could fail after a tool call with HTTP 400 when OpenRouter could not find replayable reasoning details on the reconstructed assistant message. OpenCode stores provider metadata per part while the OpenRouter serializer reads the first reasoning-details array it encounters, so partial or split histories could omit the encrypted block required for continuation.

Impact

Judge and other Gemini 3 subagent tool loops can continue across persisted OpenRouter turns without exposing private reasoning or credentials. Existing signed metadata remains authoritative; the fallback is limited to otherwise unsigned OpenRouter Gemini 3 tool-call turns.

Focused tests, package type checks, lint, formatting, and the full pre-push lint/type/Knip gates passed. An isolated OpenCode 1.18.30 replay verified both opaque metadata preservation and unsigned-history fallback on openrouter/google/gemini-3.8-flash; this was a local mocked-provider verification, not a live OpenRouter request. The unrelated existing OpenCode plugin-seed test remains failing on develop and in isolated execution.

@roomote-community

roomote-community Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

No code issues found. See task

Reviewed 10d5803

@roomote-roomote
roomote-roomote Bot marked this pull request as ready for review September 21, 2026 12:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant