Skip to content

fix(ai): enable thinking binding recovery on Bedrock - #51486

Closed
Aqua-123 wants to merge 1 commit into
anomalyco:devfrom
Aqua-123:bedrock-thinking
Closed

Aqua-123 wants to merge 1 commit into
anomalyco:devfrom
Aqua-123:bedrock-thinking

Conversation

@Aqua-123

@Aqua-123 Aqua-123 commented Sep 26, 2026 •

Copy link
Copy Markdown

Issue for this PR

Fixes #51481

#51481

Type of change

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

What does this PR do?

Bedrock Converse omits the thinking-binding recovery that Anthropic Messages already enables. Opus 5.5 then rejects saved conversations after a prefix change or a gap in thinking history.

Apply the same model gating and default drop_block policy to Bedrock, including its required beta. Merge the fields after body overrides and before SigV4 signing, preserving existing settings and opt-outs. This prevents the hard failure; it does not repair the history edits that invalidate thinking.

How did you verify your code works?

  • 126 focused tests pass, including nine new wire-level cases.
  • bun run check passes, including all 35 type-check tasks.
  • Live Bedrock Opus 5.5: generate signed thinking, change the system prompt, confirm explicit error rejects replay, then confirm the patched default succeeds.
  • The equivalent configuration recovered two failing sessions on installed 2.0.18 without modifying their transcripts.

Screenshots / recordings

Not applicable; no UI changes.

Checklist

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

Copilot AI lite review requested due to automatic review settings September 26, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Sep 26, 2026
@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:

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@Aqua-123

Copy link
Copy Markdown
Author

Updated the description to the required PR template. The issue is #51481, with Fixes #51481 under "Issue for this PR".

The remaining needs:issue warning appears to be a workflow false positive: this PR targets v2, while the default-branch pr-standards.yml checks only closingIssuesReferences. GitHub does not populate that connection from closing keywords for non-default-branch PRs. The v2 version of this workflow already includes a PR-body fallback for this case.

I tried addCloseIssueReferences, but GitHub denied it because my account lacks permission. Could a maintainer explicitly link #51481 or clear the false-positive needs:issue label?

@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:19
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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.

bedrock: Opus 5.5 thinking blocks rejected as 'bound to a different conversation' in subagent sessions

2 participants