Skip to content

fix(vertex): preserve tool continuations across system updates #43478

Closed

Description

@major

Summary

Vertex tool continuations fail when a chronological system update is admitted after a local tool result and before the next model call.
Gemini 3.7 Flash rejects the merged function-response turn with HTTP 400, while Claude Opus 4.8 on Vertex returns HTTP 404 for a terminal native system turn.

Environment

  • opencode version: 0.0.0-dev-17667
  • OS: Linux 7.1.8-200.fc44.x86_64
  • Terminal: TERM=alacritty, COLORTERM=truecolor
  • Shell: /bin/zsh
  • Install/channel: dev
  • Active plugins: opencode-chatgpt-websearch

Reproduction

  1. Configure a local tool such as websearch or webfetch.
  2. Start a tool-using prompt with google-vertex/gemini-3.7-flash#medium or google-vertex/claude-opus-4-8@default.
  3. Admit a chronological system update while the tool is running, before the continuation request is assembled.
  4. Allow the local tool to complete.

Expected Behavior

The tool result and chronological update should be lowered into a provider-valid continuation request and the model should complete normally.

Actual Behavior

Gemini 3.7 Flash returns HTTP 400: Requests ending with a model turn are not supported.
Claude Opus 4.8 on Vertex returns HTTP 404 after a successful local tool call.

Additional Context

Gemini previously merged the system update into the Gemini function-response turn.
Anthropic Messages previously emitted a terminal native system message after the local tool_result turn.
Both failures reproduced with standalone source-build sessions and are covered by provider-lowering regression tests.

Activity

  1. github-actions commented on Aug 19, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • core: Vertex Gemini rejects system updates after conversation starts #43431: Same author, same environment, and very similar root cause — Vertex Gemini rejecting system updates after conversation history starts. That issue covers the general case; this one focuses specifically on the tool-continuation path (system update admitted after a local tool result and before the continuation request). If these share the same underlying fix, consider consolidating or cross-referencing them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions