Skip to content

Conversation

@adityamehra
Copy link
Collaborator

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

91pavan and others added 11 commits October 24, 2025 07:14
Signed-off-by: Pavan Sudheendra <[email protected]>
Signed-off-by: Pavan Sudheendra <[email protected]>
Signed-off-by: Pavan Sudheendra <[email protected]>
Signed-off-by: Pavan Sudheendra <[email protected]>
Signed-off-by: Pavan Sudheendra <[email protected]>
Signed-off-by: Pavan Sudheendra <[email protected]>
Signed-off-by: Pavan Sudheendra <[email protected]>
Signed-off-by: Pavan Sudheendra <[email protected]>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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".

Comment on lines +375 to +382
# Set the sentinel attribute immediately on the new span to prevent recursion
if invocation.span and invocation.span.is_recording():
invocation.span.set_attribute("_traceloop_translated", True)
# Store the mapping from original span_id to translated INVOCATION (we'll close it later)
if original_span_id:
self._original_to_translated_invocation[
original_span_id
] = invocation

Choose a reason for hiding this comment

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

P1 Badge LLM child spans lose parent links when translated

The span processor relies on _original_to_translated_invocation to locate a translated parent before calling start_llm, but entries are added to this map only after the synthetic span has already been started (lines shown). Because on_end processes LLM-like spans immediately while the real parent is still open, a child LLM span finishes before its parent span has been translated and inserted into the map. The lookup performed earlier in _process_span_translation therefore returns None, so the synthetic span is started as a root and the hierarchy between agent/task and child LLM spans is lost. This breaks parent–child relationships for most nested LLM invocations. Consider deferring translation until parents are processed or caching children until the parent mapping is available.

Useful? React with 👍 / 👎.

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