fix: include parent span IDs in daemon merge writes by max-braintrust · Pull Request #52 · braintrustdata/braintrust-coding-agent-plugins · GitHub
Skip to content

fix: include parent span IDs in daemon merge writes - #52

Open
max-braintrust wants to merge 1 commit into
mainfrom
fix/codex-parent-identity
Open

fix: include parent span IDs in daemon merge writes#52
max-braintrust wants to merge 1 commit into
mainfrom
fix/codex-parent-identity

Conversation

@max-braintrust

@max-braintrust max-braintrust commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Issue

Merge writes from the plugins did not include parent ids. This was a problem if no successful insert write proceeded the merge write for a particular span, because the span would be attached to the trace without a parent. Spans without parents automatically get is_root=true, so this can lead to a situation where a trace has multiple spans marked as the root.

Solution

Include the correct root_span_id and parent span IDs in every merge write, using the same deterministic hierarchy used by the corresponding insert. This allows a merge to preserve the span’s hierarchy even when the initial insert was not persisted, without requiring a sink-side identity cache.

Add regression coverage to verify that:

  • Every merge carries the same trace and parent identity as its insert.
  • Stateless updates for closed spans include their parent IDs.

@max-braintrust max-braintrust changed the title fix: daemon merge writes should include parent span ids fix: include parent span IDs in Codex daemon merge writes Sep 4, 2026
@max-braintrust
max-braintrust force-pushed the fix/codex-parent-identity branch from 12b9682 to a7d40f2 Compare September 4, 2026 23:46
@max-braintrust max-braintrust changed the title fix: include parent span IDs in Codex daemon merge writes fix: include parent span IDs in daemon merge writes Sep 4, 2026
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.

1 participant