ref: Rename _timestamp to _end_timestamp#6235
Conversation
Codecov Results 📊✅ 12 passed | Total: 12 | Pass Rate: 100% | Execution Time: 2.13s 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ❌ Patch coverage is 73.68%. Project has 14649 uncovered lines. Files with missing lines (3)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 33.18% 33.18% —%
==========================================
Files 190 190 —
Lines 21918 21924 +6
Branches 7374 7378 +4
==========================================
+ Hits 7272 7275 +3
- Misses 14646 14649 +3
- Partials 661 661 —Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ea2436c. Configure here.
| def timestamp(self) -> "Optional[datetime]": | ||
| return self._timestamp | ||
| def end_timestamp(self) -> "Optional[datetime]": | ||
| return self._end_timestamp |
There was a problem hiding this comment.
Renamed property breaks openai_agents integration at runtime
High Severity
The timestamp property on StreamedSpan was renamed to end_timestamp, but three call sites in the openai_agents integration still access span.timestamp on spans that can be StreamedSpan instances (when span streaming is enabled via get_start_span_function). This causes an AttributeError at runtime. The most critical site is in _run_single_turn (agent_run.py), where the AttributeError is not wrapped in capture_internal_exceptions(), so it replaces the original exception being handled.
Reviewed by Cursor Bugbot for commit ea2436c. Configure here.
There was a problem hiding this comment.
If this is true, how come our tests didn't catch this? 🙈
There was a problem hiding this comment.
Ah right, openai agents doesn't support span streaming yet, so that's ok.
The field capturing the end timestamp of a span used to be called `timestamp` in legacy mode (on the `Span` class), with `start_timestamp` as its counterpart. In span streaming, we originally followed the same convention on the new `StreamedSpan` class, but there's actually no reason to and it'd be better to use `end_timestamp` instead: - the field on the serialized span v2 is actually called `end_timestamp` - `end_timestamp` is a clearer name in general, and complements `start_timestamp` nicely


The field capturing the end timestamp of a span used to be called
timestampin legacy mode (on theSpanclass), withstart_timestampas its counterpart.In span streaming, we originally followed the same convention on the new
StreamedSpanclass, but there's actually no reason to and it'd be better to useend_timestampinstead:end_timestampend_timestampis a clearer name in general, and complementsstart_timestampnicely