Skip to content

fix: #2540 reattach resumed traces without duplicate trace starts#2547

Merged
seratch merged 3 commits intomainfrom
fix/hitl-trace-reattach
Feb 26, 2026
Merged

fix: #2540 reattach resumed traces without duplicate trace starts#2547
seratch merged 3 commits intomainfrom
fix/hitl-trace-reattach

Conversation

@seratch
Copy link
Member

@seratch seratch commented Feb 26, 2026

This pull request resolves #2540 by reattaching resumed RunState traces instead of emitting a second top-level trace start when the same trace_id has already been started in the current process.

The change adds a resumed-trace path in the tracing runtime so interrupted HITL runs continue under the original trace context for both Runner.run() and Runner.run_streamed(), while preserving the existing behavior for fresh runs, explicit outer with trace() scopes, and resumes whose trace ID has not been seen in the current process.

It also adds regression coverage for interrupted non-streaming runs, interrupted streaming runs, and the low-level reattachment lifecycle to ensure resumed spans keep the original trace_id without duplicating on_trace_start / on_trace_end.

@seratch seratch added this to the 0.10.x milestone Feb 26, 2026
@seratch
Copy link
Member Author

seratch commented Feb 26, 2026

@codex review again

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.

Reviewed commit: e351d9a65e

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

@seratch seratch merged commit 6814a54 into main Feb 26, 2026
9 checks passed
@seratch seratch deleted the fix/hitl-trace-reattach branch February 26, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting two traces with Human-in-the-loop

1 participant