Skip to content

fix(bedrock): tolerate omitted reasoning blocks#182

Merged
raphael merged 3 commits into
goadesign:mainfrom
firstprinciples:fix/bedrock-omitted-thinking
Jul 20, 2026
Merged

fix(bedrock): tolerate omitted reasoning blocks#182
raphael merged 3 commits into
goadesign:mainfrom
firstprinciples:fix/bedrock-omitted-thinking

Conversation

@firstprinciples

@firstprinciples firstprinciples commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Accept Bedrock signature-only reasoning blocks produced by thinking.display: "omitted".
  • Preserve signed plaintext, signature-only, and redacted reasoning blocks unchanged for replay.
  • Reject plaintext reasoning that is missing its provider signature.
  • Add non-streaming regression coverage alongside the existing streaming coverage.

Rationale

Anthropic documents thinking.display: "omitted" as returning reasoning blocks with empty text and a signature; this is the default for newer Claude models. Bedrock Converse passes this through.

The adapter previously treated these valid signature-only blocks as malformed. Signature-only reasoning is a complete replay artifact: the signature carries the encrypted reasoning state and must be passed back unchanged for multi-turn continuity. Unsigned plaintext remains unreplayable and is rejected at the provider boundary.

Test plan

  • go test ./features/model/bedrock

…hinking

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	features/model/bedrock/stream.go
#	features/model/bedrock/stream_usage_test.go
@raphael

raphael commented Jul 20, 2026

Copy link
Copy Markdown
Member

Reviewed the final diff and provider contract. Signature-only reasoning is preserved for verbatim replay, while unsigned plaintext still fails at the Bedrock boundary. No blocking code findings.

Verified the PR head with:

  • go test ./features/model/bedrock

@raphael raphael left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Signature-only reasoning now matches the provider replay contract, unsigned plaintext remains rejected, and the Bedrock package tests pass.

@raphael
raphael enabled auto-merge (squash) July 20, 2026 20:23
@raphael
raphael merged commit f1f4734 into goadesign:main Jul 20, 2026
2 checks passed
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.

2 participants