Commit Graph
1 Commits
Author SHA1 Message Date
bschoepke-openai d51e9c935f Preserve per-execution trace context in code-mode stdio callbacks (#55993)
## Why

Callbacks from the shared stdio host need to retain each execution's trace context after it yields, without keeping the execution span open until its background cell closes.

## What changed

Capture a W3C trace-context snapshot for each execution and restore it as the parent of tool callback and notification spans. Instrument delegate invocation and its returned future so the context is available on entry and across awaits.

## Testing

Add an integration test with overlapping yielded cells completed in reverse order. Cover sampled, unsampled, and untraced callers, trace isolation, callback and notification parentage, and execution spans finishing while callbacks remain blocked.

GitOrigin-RevId: 57924123d2c2f31bcfaf725688d8bba775235fa0
2026-10-21 21:46:56 +00:00