Skip to content

Conversation

shellmayr
Copy link
Member

@shellmayr shellmayr commented Oct 21, 2025

Contributes to TET-1208

@linear
Copy link

linear bot commented Oct 21, 2025

@shellmayr shellmayr marked this pull request as ready for review October 23, 2025 09:28
@shellmayr shellmayr requested a review from a team as a code owner October 23, 2025 09:28
@cursor
Copy link

cursor bot commented Oct 23, 2025

Bug: Chat Span Index Assumption Error

The test assumes the chat span is at index "0" in the metadata path tx["_meta"]["spans"]["0"]["data"], but the chat span is retrieved by filtering the spans list with chat_spans = [span for span in tx.get("spans", []) if span.get("op") == OP.GEN_AI_CHAT]. There's no guarantee the filtered chat span is at index 0 in the original spans array. The test should either use the actual index of the chat span in the original spans list, or the transaction should be set up to ensure only one span exists.

Fix in Cursor Fix in Web

@cursor
Copy link

cursor bot commented Oct 23, 2025

Bug: Incorrect Empty String Key in Metadata Path

The metadata path contains an incorrect empty string key. The assertion tx["_meta"]["spans"]["0"]["data"]["gen_ai.request.messages"][""]["len"] accesses an intermediate empty string key [""] between the field name and the "len" metadata. The correct path should be tx["_meta"]["spans"]["0"]["data"]["gen_ai.request.messages"]["len"] without the empty string key.

Fix in Cursor Fix in Web

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.97%. Comparing base (3d026cd) to head (dd4f521).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/litellm.py 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4973   +/-   ##
=======================================
  Coverage   83.97%   83.97%           
=======================================
  Files         165      165           
  Lines       17082    17085    +3     
  Branches     3000     3001    +1     
=======================================
+ Hits        14344    14347    +3     
  Misses       1839     1839           
  Partials      899      899           
Files with missing lines Coverage Δ
sentry_sdk/integrations/litellm.py 77.47% <80.00%> (-0.31%) ⬇️

... and 1 file with indirect coverage changes

@shellmayr shellmayr merged commit e9738f6 into master Oct 23, 2025
123 of 124 checks passed
@shellmayr shellmayr deleted the shellmayr/chore/litellm-message-truncation branch October 23, 2025 11:28
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