Skip to content

fix(bedrock): skip passing unsigned reasoning content#15181

Merged
gr2m merged 3 commits into
mainfrom
aayush/bedrock-signed-reasoning
May 11, 2026
Merged

fix(bedrock): skip passing unsigned reasoning content#15181
gr2m merged 3 commits into
mainfrom
aayush/bedrock-signed-reasoning

Conversation

@aayush-kapoor
Copy link
Copy Markdown
Collaborator

@aayush-kapoor aayush-kapoor commented May 11, 2026

Background

#14720

passing unsigned reasoning content parts back to bedrock would sometimes lead to the model's thinking/reasoning tags leak into the normal response text.

the core issue was AI SDK passing the unsigned reasoning content back and this was introduced in #13972. The previous code only replayed reasoning when reasoningMetadata != null, which effectively required a signature or redacted data

Summary

drop the reasoning content from being passed back to bedrock when it has no signature attached to it

Manual Verification

na

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

fixes #14720

Co-authored-by: Pasquale Carmine Carbone pcarbonenearform@ipdanalytics.com

@aayush-kapoor aayush-kapoor added the backport Admins only: add this label to a pull request in order to backport it to the prior version label May 11, 2026
@gr2m gr2m merged commit bcbaae6 into main May 11, 2026
21 checks passed
@gr2m gr2m deleted the aayush/bedrock-signed-reasoning branch May 11, 2026 22:41
github-actions Bot added a commit that referenced this pull request May 11, 2026
@github-actions github-actions Bot removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label May 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Backport to release-v6.0 created but has conflicts: #15182

aayush-kapoor added a commit that referenced this pull request May 11, 2026
This is an automated backport of #15181 to the release-v6.0 branch. FYI
@aayush-kapoor
This backport has conflicts that need to be resolved manually.

### `git cherry-pick` output

```
Auto-merging packages/amazon-bedrock/src/convert-to-bedrock-chat-messages.test.ts
CONFLICT (content): Merge conflict in packages/amazon-bedrock/src/convert-to-bedrock-chat-messages.test.ts
Auto-merging packages/amazon-bedrock/src/convert-to-bedrock-chat-messages.ts
CONFLICT (content): Merge conflict in packages/amazon-bedrock/src/convert-to-bedrock-chat-messages.ts
error: could not apply bcbaae6... fix(bedrock): skip passing unsigned reasoning content (#15181)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
```

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
@ai-sdk/amazon-bedrock 5.0.0-canary.58

@KiraPC
Copy link
Copy Markdown

KiraPC commented May 16, 2026

@aayush-kapoor Hey mate can you please use my email: pasqualecarmine.carbone@gmail.com

Thanks

@aayush-kapoor
Copy link
Copy Markdown
Collaborator Author

@KiraPC apologies that's the one i saw on github; noted for next time

@KiraPC
Copy link
Copy Markdown

KiraPC commented May 16, 2026

No problem at all. Maybe I used this in the commit, so it s my fault. Thanks!

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.

bug(amazon-bedrock): <reasoning> tags leaked into text response for OpenAI models on Bedrock during multi-turn tool use

3 participants