Skip to content

Conversation

shellmayr
Copy link
Member

Contributes to TET-1208

Copy link

linear bot commented Oct 16, 2025

Copy link

codecov bot commented Oct 16, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
22122 1 22121 1566
View the top 1 failed test(s) by shortest run time
::tests.integrations.openai.test_openai
Stack Traces | 0s run time
ImportError while importing test module '.../integrations/openai/test_openai.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.tox/py3.11-openai-base-v1.0.1/lib/python3.11.../site-packages/_pytest/python.py:498: in importtestmodule
    mod = import_path(
.tox/py3.11-openai-base-v1.0.1/lib/python3.11.../site-packages/_pytest/pathlib.py:587: in import_path
    importlib.import_module(module_name)
.../hostedtoolcache/Python/3.11.13.../x64/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
.tox/py3.11-openai-base-v1.0.1/lib/python3.11.../_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
.../integrations/openai/test_openai.py:15: in <module>
    from openai import AsyncOpenAI, Omit, OpenAI, AsyncStream, Stream, OpenAIError
E   ImportError: cannot import name 'Omit' from 'openai' (.../sentry-python/sentry-python/.tox/py3.11-openai-base-v1.0.1/lib/python3.11.../site-packages/openai/__init__.py)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@shellmayr shellmayr marked this pull request as ready for review October 16, 2025 09:14
@shellmayr shellmayr requested a review from a team as a code owner October 16, 2025 09:14
cursor[bot]

This comment was marked as outdated.

Comment on lines 611 to 612
spans = [] # type: List[Dict[str, Any]]
for span in spans:

Choose a reason for hiding this comment

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

Potential bug: The spans variable is initialized as an empty list, so the subsequent loop that should annotate spans with truncation information never runs.
  • Description: In the _prepare_event method, the spans variable is initialized as an empty list. The code then immediately attempts to iterate over this list. Because spans is always empty at this point, the loop body that is intended to annotate spans with AI message truncation information never executes. This causes the new message truncation annotation feature to fail silently, as the expected AnnotatedValue metadata will not be added to the event's spans.

  • Suggested fix: Initialize the spans variable by retrieving the spans from the event object. Change the line spans = [] to spans = event.get("spans", []) to ensure the annotation logic can execute on the event's spans.
    severity: 0.65, confidence: 0.99

Did we get this right? 👍 / 👎 to inform future reviews.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@shellmayr shellmayr merged commit 814cd5a into master Oct 16, 2025
112 checks passed
@shellmayr shellmayr deleted the shellmyayr/fix/ai-truncate-messages-open-ai branch October 16, 2025 13:26
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.

3 participants