Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codeowners resolved asResolved from the full PR diff against |
Circular import analysis
|
Dependency direction analysis
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🔗 Commit SHA: d2df4c3 | Docs | View more details | Give us feedback! |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64abb06f12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A version annotated on an agent after a child span started never reached spans started under that child, since each span copied its parent's cached version string. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2df4c35d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if parent_agent_version: | ||
| context._meta[PARENT_AGENT_VERSION] = parent_agent_version |
There was a problem hiding this comment.
Clear stale agent versions when snapshotting contexts
When work is already running from an asyncio/thread context containing an outer agent version, active.context retains PARENT_AGENT_VERSION in its trace-level _meta. If that work enters an unversioned nested agent and schedules another task or thread, _resolve_parent_agent(active) correctly returns no version for the nested agent, but this truthy-only assignment leaves the outer value in the copied metadata; the grandchild consequently emits the outer agent_version, violating the documented nested-agent boundary. Remove the key when the resolved version is absent, analogous to _stamp_agent_attribution clearing stale attribution.
Useful? React with 👍 / 👎.
💡 Codex Reviewdd-trace-py/ddtrace/llmobs/_llmobs.py Lines 2518 to 2519 in d2df4c3 When work is already running from an asyncio/thread context containing an outer agent version, ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Description
Reports the agent version as an
agent_versiontag on the agent span and every span it runs, matching dd-trace-js (DataDog/dd-trace-js#10536) and dd-trace-java (DataDog/dd-trace-java#12291). The agent panel attributes tokens and cost to a version through the agent's child spans.annotate()reaches spans started after the call.Testing
Unit tests for subtree propagation, sibling and nested agents, annotation timing,
annotation_context, asyncio tasks, thread pools, and no leakage into distributed headers. Flipped the existing tests that asserted the version stays off children.when clicking into the agent, we see tool usage being attributed to version, and I verified that the token sums included subtree llm sums (3.0.0 should have 25.9k and 4.0.0 should have 10.4k)
Risks
Descendant spans that previously had no
agent_versionnow carry one.Additional Notes
Assumes non-distributed, non-nested agents, as in the JS and Java PRs.
🤖 Generated with Claude Code