Skip to content

Improve tracing for nested tool calls and exec processes - #41950

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/a6059e34d895416f5517e51dad6ca0078355adca
Sep 1, 2026
Merged

Improve tracing for nested tool calls and exec processes#41950
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/a6059e34d895416f5517e51dad6ca0078355adca

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 1, 2026

Copy link
Copy Markdown

Improve tracing for nested tool calls and exec processes

Why

Code-mode callbacks can outlive their initial request and run in separate tasks,
so their trace context must be preserved explicitly.

What changed

  • Preserve the execution context for code-mode callbacks and add spans for
    nested tool invocations in the runtime and dispatch broker.
  • Propagate each tool invocation span as the parent of its streamed gRPC
    callback, falling back to the outer execution context when needed.
  • Add a codex.exec_server.process span for each process lifetime, including
    its process ID and completion result, without retaining the request span.

## Why

Code-mode callbacks can outlive their initial request and run in separate tasks,
so their trace context must be preserved explicitly.

## What changed

- Preserve the execution context for code-mode callbacks and add spans for
  nested tool invocations in the runtime and dispatch broker.
- Propagate each tool invocation span as the parent of its streamed gRPC
  callback, falling back to the outer execution context when needed.
- Add a `codex.exec_server.process` span for each process lifetime, including
  its process ID and completion result, without retaining the request span.

GitOrigin-RevId: a6059e34d895416f5517e51dad6ca0078355adca
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/a6059e34d895416f5517e51dad6ca0078355adca branch from 4136cbc to 55e5158 Compare September 1, 2026 01:01
@copyberry
copyberry Bot merged commit 55e5158 into main Sep 1, 2026
26 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/a6059e34d895416f5517e51dad6ca0078355adca branch September 1, 2026 01:02
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants