GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(provider): drop Bedrock assistant messages left with only unsigned reasoning by nabilfreeman · Pull Request #45621 · anomalyco/opencode

Conversation

@nabilfreeman

@nabilfreeman nabilfreeman commented Aug 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #45620

Type of change

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

What does this PR do?

When a thinking stream dies mid-turn on Bedrock, the saved reasoning part has no signature (it arrives at the end of the block, so it never came). On replay the AI SDK drops unsigned reasoning, so the assistant message goes out with empty content — or as a lone cachePoint once applyCaching has stamped the last two messages. Bedrock rejects both with a non-retryable 400 ("There is nothing available to cache" / "content field is empty") and the session is wedged until the message drifts out of the cache window.

The fix drops those messages in ProviderTransform.message — scoped to @ai-sdk/amazon-bedrock, before applyCaching so cache points land on messages that survive. It works because the converter was discarding their content anyway... the model sees an identical request, just without the guaranteed 400. Same shape as the #14586 filters.

The root-cause fix is upstream (vercel/ai#19852), but that's on the @ai-sdk/amazon-bedrock 5.x line and opencode vendors 4.0.x, so this covers the gap. When the vendored package catches up this becomes harmless belt-and-braces.

How did you verify your code works?

Five new cases in transform.test.ts — the two drop behaviours fail without the fix; signed reasoning, mixed content, and other providers are untouched. 416/416 passing. Also ran dev from source against a real poisoned session (isolated XDG dirs): the exact 400 before the change, normal completion after, on global.anthropic.claude-fable-5.

Screenshots / recordings

Not a UI change.

Checklist

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nabilfreeman
fix(provider): drop Bedrock assistant messages left with only unsigne…
cafdadf
…d reasoning

When a thinking stream dies mid-turn on Bedrock, the persisted reasoning
part has no signature (it arrives at the end of the block). On replay the
@ai-sdk/amazon-bedrock converter drops unsigned reasoning, so the assistant
message reaches Bedrock with empty content — or, once applyCaching stamps
the last two messages, as a lone cachePoint block. Both are non-retryable
400s ('The content field in the Message object is empty' / 'There is
nothing available to cache') that repeat until the message leaves the
last-2 cache window, wedging the session.

Drop such messages in ProviderTransform.message, scoped to
@ai-sdk/amazon-bedrock, before applyCaching so cache points land on
messages that survive. The converter discards their content anyway, so the
model sees an identical request. Same shape as the empty-content filters
from anomalyco#14586.

The root-cause fix is upstream (vercel/ai#19852), but it lands on the
@ai-sdk/amazon-bedrock 5.x line while opencode vendors 4.0.x, so this
covers the gap.

Verified end-to-end against a real poisoned session on dev: the exact 400
without this change, normal completion with it. Unit tests cover the drop,
signed-reasoning and mixed-content keeps, cache point placement, and
other-provider scoping.
@github-actions github-actions Bot added contributor needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Aug 27, 2026
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nabilfreeman nabilfreeman mentioned this pull request Aug 27, 2026
Bedrock: aborted thinking turn bricks the session — "There is nothing available to cache" / "content field is empty" #45620
Closed
This was referenced Aug 27, 2026
fix(ai): safely replay unsigned Bedrock reasoning #45765
Merged
fix(provider): filter unreplayable Bedrock reasoning before caching #45769
Merged
@neriousy

neriousy commented Aug 27, 2026

Copy link
Copy Markdown
Member

Closed in favor of #45769

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@neriousy neriousy closed this Aug 27, 2026
@thinkryoda thinkryoda mentioned this pull request Sep 30, 2026
Bedrock: "Cache point cannot be inserted after reasoning block" — non-retryable 400, distinct from #45620 #52225
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Bedrock: aborted thinking turn bricks the session — "There is nothing available to cache" / "content field is empty"

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@nabilfreeman @neriousy
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.