Skip to content

fix(ai): preserve Vertex Anthropic tool continuations - #43498

Open
major wants to merge 1 commit into
anomalyco:v2from
major:vertex-anthropic-fix
Open

fix(ai): preserve Vertex Anthropic tool continuations#43498
major wants to merge 1 commit into
anomalyco:v2from
major:vertex-anthropic-fix

Conversation

@major

@major major commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Refs #43478

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Vertex returns HTTP 404 when a Claude tool continuation ends with a native system message after the local tool result. For that specific Vertex placement, this folds the chronological update into the existing user tool-result turn. Direct Anthropic requests and ordinary terminal Vertex system updates remain native. This complements #43479, which fixes the Gemini continuation path.

How did you verify your code works?

  • bun test test/provider/anthropic-messages.test.ts from packages/ai (53 passed)
  • bun typecheck from packages/ai
  • bun run build from packages/ai
  • Full packages/ai test run: 517 passed, 28 skipped, and 7 unrelated existing OpenRouter/OpenAI failures

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

The search found PR #43479 which is related but distinct:

Related PR:

No duplicate PRs found for the Vertex Anthropic tool continuations fix. The related PR #43479 addresses a similar issue but for Gemini instead of Anthropic/Vertex, making them distinct fixes for different providers.

- fold terminal system updates into Vertex local tool-result turns

- preserve native system updates for direct Anthropic and ordinary Vertex requests

Refs anomalyco#43478

Signed-off-by: Major Hayden <major@mhtx.net>
@major

major commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Good method for testing:

opencode2 run --standalone --model 'google-vertex/claude-opus-4-8@default' --format json 'Use your available tools to fetch current NVDA daily closing-price data and calculate its 20-trading-day simple moving average. You must make at least one tool call before answering. Report the SMA, data source, and the latest included trading date.'

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant