Skip to content

fix(ai): drop blank text from Bedrock error tool results - #463

Merged
shuv1337 merged 6 commits into
integration-v2from
cursor/bedrock-error-blank-24cd
Oct 29, 2026
Merged

shuv1337 merged 6 commits into
integration-v2from
cursor/bedrock-error-blank-24cd

Conversation

@shuv1337

@shuv1337 shuv1337 commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Issue for this PR

No tracked issue.

Type of change

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

What does this PR do?

This stacks on #462 (cursor/blank-tool-text-24cd). Do not merge it ahead of that pull request. The diff against integration-v2 includes #462 until that lands.

Bedrock's error tool-result path skips blank rich text. normalizeToolResult marks a substituted blank error with empty: true, and Bedrock drops that placeholder only when other blocks remain. A real error whose text is exactly (no tool output) is kept when media is present.

Claude and Nova reject image and document blocks inside an error tool result. For those models, error media is replaced with [image omitted], [document omitted], or [file omitted]. Other Bedrock models still lower the image and hoist it beside the result.

Head fc26199b23.

How did you verify your code works?

env -u RECORD CI=true bun test --timeout 30000 in packages/ai on this head: 1966 pass, 28 skip, 0 fail. The skips are recorded cases whose cassettes are not on disk. Recorded fixtures that have cassettes passed.

Visual

No UI change.

Screenshots / recordings

None.

Checklist

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

Blank tool text, error values, and content items now match an empty
string. Anthropic success tool results drop that text and keep non-blank
text unchanged.
PR 461 landed on the base while this branch was open. Keep that error-result
filter and the whitespace-only success path from this branch.

# Conflicts:
#	packages/ai/src/protocols/anthropic-messages.ts
@shuv1337
shuv1337 merged commit 4f42e2e into integration-v2 Oct 29, 2026
5 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