Skip to content

feat(bedrock): Set gen_ai.output.messages for non-streaming responses - #8249

Merged
alexander-alderman-webb merged 2 commits into
masterfrom
webb/bedrock/nonstreaming-output-messages
Nov 12, 2026
Merged

alexander-alderman-webb merged 2 commits into
masterfrom
webb/bedrock/nonstreaming-output-messages

Conversation

@alexander-alderman-webb

Copy link
Copy Markdown
Collaborator

Re-use _transform_messages from the input transformation saga.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 139166 passed | ⏭️ 7813 skipped | Total: 146979 | Pass Rate: 94.68% | Execution Time: 450m 26s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +104
Passed Tests 📈 +56
Failed Tests —
Skipped Tests 📈 +48

All tests are passing successfully.

✅ Patch coverage is 100.00% (5 of 5 changed executable lines covered; target 80%).
Project statement coverage is 90.25% (up 0.01 percentage points from base (939bcf0) to head (fc6b034)).

Changed files with executable lines (1)
File Patch coverage Changed executable lines
sentry_sdk/integrations/boto3/_services/bedrock.py 100.00% 5/5 covered
Coverage diff
@@            Coverage Diff             @@
##        master     #8249       +/-##
==========================================
+ Coverage    90.24%    90.25%    +0.01%
==========================================
  Files          203       203         —
  Tracked lines     27125     27233      +108
  Branches     10142     10200       +58
==========================================
+ Hits         24478     24579      +101
- Misses        2647      2654        +7
- Partials      1541      1551       +10

Generated by Coverage Action

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/bedrock/nonstreaming-output-messages branch from f4e2019 to fc6b034 Compare November 11, 2026 16:38
@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review November 12, 2026 08:10
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner November 12, 2026 08:10

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fc6b034. Configure here.

set_on_span(
SPANDATA.GEN_AI_OUTPUT_MESSAGES,
json.dumps(_transform_messages([response["output"]["message"]])),
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Output messages use legacy PII gate

Medium Severity

The new gen_ai.output.messages recording still gates on has_data_collection_enabled and should_send_default_pii instead of reading data_collection["gen_ai"]["outputs"] directly. data_collection is already fully resolved at init, including the send_default_pii mapping, so those helpers are not needed. The new test also parametrizes a send_default_pii=True path and never covers mixed inputs/outputs (especially outputs: False).

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by learned rule: Read data_collection directly; no send_default_pii

Reviewed by Cursor Bugbot for commit fc6b034. Configure here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think it's better to be explicit to be honest 🤷

@alexander-alderman-webb
alexander-alderman-webb merged commit e816e56 into master Nov 12, 2026
176 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/bedrock/nonstreaming-output-messages branch November 12, 2026 09:14
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