Skip to content

fix(tracing): recognize nested Codex subagent parent identities - #83

Open
joserprieto wants to merge 2 commits into
langfuse:mainfrom
joserprieto:fix/nested-subagent-identity
Open

joserprieto wants to merge 2 commits into
langfuse:mainfrom
joserprieto:fix/nested-subagent-identity

Conversation

@joserprieto

Copy link
Copy Markdown

Codex 0.154.0 can record a child thread’s parent only in session_meta.source.subagent.thread_spawn.parent_thread_id. The index currently reads only the top-level field, so a child with no UUID-bearing spawn event is omitted from its parent trace. The parser also misclassifies this metadata layout.

Resolve both metadata layouts through a shared helper. Retain legacy subagent classification and reject conflicting parent identities from the index. Existing parent/time attribution then recovers the child without changing transport or delivery behavior.

Regression coverage uses synthetic metadata and existing synthetic rollout fixtures: nested-only identity, matching legacy identity, conflicting identities, legacy/root classification, and the recovered child’s parent/model.

A separate test-only commit acknowledges exported turn IDs before the existing repeat-export assertion; that assertion already failed on the base revision because convertRollout no longer persists delivery receipts itself.

Validation: new regressions observed failing before the fix; focused tests pass; pnpm run lint passes. Validated locally on macOS with Node 22.22.0 and 24.14.1; Ubuntu CI remains to run. Full suite: 64 tests pass across 7 files (production tracing credentials removed from the test environment).

Related: #81 addresses inherited ancestor turns, a separate issue. This change does not introduce the local compatibility build’s delivery ledger, retry policy, custom exporter, launcher or installation configuration.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@CLAassistant

CLAassistant commented Sep 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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