Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

fix(bedrock): handle 'citation' delta key from Converse API#911

Open
rahulrsingh09 wants to merge 1 commit into
strands-agents:mainfrom
rahulrsingh09:fix/bedrock-citation-delta-key
Open

fix(bedrock): handle 'citation' delta key from Converse API#911
rahulrsingh09 wants to merge 1 commit into
strands-agents:mainfrom
rahulrsingh09:fix/bedrock-citation-delta-key

Conversation

@rahulrsingh09

Copy link
Copy Markdown

Problem

Bedrock's Converse API sends citation data using the key citation in both stream deltas (contentBlockDelta) and content blocks, but the SDK only has a handler for citationsContent. This causes citations to be silently dropped with:

delta_key=<citation> | skipping unsupported delta key

Solution

Add citation as a handler in both:

  1. Streaming path (deltaHandlers in contentBlockDelta case)
  2. Non-streaming path (blockHandlers in _mapStreamedBedrockEventToSDKEvent)

Both handlers delegate to the same _mapBedrockCitationsData logic and emit citationsDelta events.

Testing

  • Added test case handles citation delta key as alias for citationsContent covering both streaming and non-streaming paths
  • All 272 existing tests pass
  • Verified end-to-end with Bedrock Knowledge Base retrieval (citations now render correctly)

Fixes #910

Bedrock's Converse API sends citation data using the key 'citation' in both
stream deltas and content blocks, but the SDK only had a handler for
'citationsContent'. This caused citations to be silently dropped with a
'skipping unsupported delta key' warning.

Add 'citation' as an alias handler in both the streaming deltaHandlers and
non-streaming blockHandlers to ensure citation events are properly mapped
to citationsDelta events.

Fixes strands-agents#910
@github-actions github-actions Bot added the strands-running <strands-managed> Whether or not an agent is currently running label Apr 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Assessment: Comment

The fix correctly addresses #910 by adding citation as a handler key alongside the existing citationsContent in both the streaming and non-streaming paths. The approach and test coverage are solid.

Review Details
  • Code Duplication: The citation handlers are exact copies of their citationsContent counterparts in both blockHandlers and deltaHandlers. These should reuse the handler by reference rather than duplicating the function bodies (see inline comment).

Good catch on the silent key mismatch — nice fix with end-to-end verification.

@github-actions github-actions Bot removed the strands-running <strands-managed> Whether or not an agent is currently running label Apr 28, 2026
@strands-agent

Copy link
Copy Markdown
Collaborator

This repository has been merged into the strands-agents/harness-sdk monorepo and will be archived shortly. All new development happens there.

If this PR is still relevant, please recreate it against the monorepo. The code now lives under strands-ts/. Full commit history was preserved, so your base should be findable.

Apologies for the disruption, and thank you for contributing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Streaming citations silently dropped - missing 'citation' delta handler in bedrock.ts

3 participants