Skip to content

[rollout_trace] Add debug trace reduction command#18880

Merged
cassirer-openai merged 3 commits intomainfrom
codex/rollout-trace-debug-reduction
Apr 24, 2026
Merged

[rollout_trace] Add debug trace reduction command#18880
cassirer-openai merged 3 commits intomainfrom
codex/rollout-trace-debug-reduction

Conversation

@cassirer-openai
Copy link
Copy Markdown
Contributor

@cassirer-openai cassirer-openai commented Apr 21, 2026

Summary

Adds the debug CLI entry point for reducing recorded rollout traces. This gives developers a direct way to inspect whether the emitted trace stream reduces into the expected conversation/runtime model.

Stack

This is PR 5/5 in the rollout trace stack.

  • #18876: Add rollout trace crate
  • #18877: Record core session rollout traces
  • #18878: Trace tool and code-mode boundaries
  • #18879: Trace sessions and multi-agent edges
  • #18880: Add debug trace reduction command

Review Notes

This PR is intentionally last: it depends on the trace crate, core recorder, runtime/tool events, and session/agent edge data all existing. The command should remain a debug/developer tool and avoid adding new runtime behavior.

The useful review question is whether the CLI exposes the reducer in the smallest practical way for local inspection without turning the debug command into a supported user-facing workflow.

Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai left a comment

Choose a reason for hiding this comment

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

Ok after my comment

Comment thread codex-rs/cli/src/main.rs
cassirer-openai added a commit that referenced this pull request Apr 21, 2026
## Summary

Adds the standalone `codex-rollout-trace` crate, which defines the raw
trace event format, replay/reduction model, writer, and reducer logic
for reconstructing model-visible conversation/runtime state from
recorded rollout data.

The crate-level design is documented in
[`codex-rs/rollout-trace/README.md`](https://github.com/openai/codex/blob/codex/rollout-trace-crate/codex-rs/rollout-trace/README.md).

## Stack

This is PR 1/5 in the rollout trace stack.

- [#18876](#18876): Add rollout
trace crate
- [#18877](#18877): Record core
session rollout traces
- [#18878](#18878): Trace tool and
code-mode boundaries
- [#18879](#18879): Trace sessions
and multi-agent edges
- [#18880](#18880): Add debug trace
reduction command

## Review Notes

This PR intentionally does not wire tracing into live Codex execution.
It establishes the data model and reducer contract first, with
crate-local tests covering conversation reconstruction, compaction
boundaries, tool/session edges, and code-cell lifecycle reduction. Later
PRs emit into this model.

The README is the best entry point for reviewing the intended trace
format and reduction semantics before diving into the reducer modules.
cassirer-openai added a commit that referenced this pull request Apr 22, 2026
## Summary

Wires rollout trace recording into `codex-core` session and turn
execution. This records the core model request/response, compaction, and
session lifecycle boundaries needed for replay without yet tracing every
nested runtime/tool boundary.

## Stack

This is PR 2/5 in the rollout trace stack.

- [#18876](#18876): Add rollout
trace crate
- [#18877](#18877): Record core
session rollout traces
- [#18878](#18878): Trace tool and
code-mode boundaries
- [#18879](#18879): Trace sessions
and multi-agent edges
- [#18880](#18880): Add debug trace
reduction command

## Review Notes

This layer is the first live integration point. The important review
question is whether trace recording is isolated from normal session
behavior: trace failures should not become user-visible execution
failures, and recording should preserve the existing turn/session
lifecycle semantics.

The PR depends on the reducer/data model from the first stack entry and
only introduces the core recorder surface that later PRs use for richer
runtime and relationship events.
morozow pushed a commit to morozow/codex that referenced this pull request Apr 23, 2026
## Summary

Adds the standalone `codex-rollout-trace` crate, which defines the raw
trace event format, replay/reduction model, writer, and reducer logic
for reconstructing model-visible conversation/runtime state from
recorded rollout data.

The crate-level design is documented in
[`codex-rs/rollout-trace/README.md`](https://github.com/openai/codex/blob/codex/rollout-trace-crate/codex-rs/rollout-trace/README.md).

## Stack

This is PR 1/5 in the rollout trace stack.

- [openai#18876](openai#18876): Add rollout
trace crate
- [openai#18877](openai#18877): Record core
session rollout traces
- [openai#18878](openai#18878): Trace tool and
code-mode boundaries
- [openai#18879](openai#18879): Trace sessions
and multi-agent edges
- [openai#18880](openai#18880): Add debug trace
reduction command

## Review Notes

This PR intentionally does not wire tracing into live Codex execution.
It establishes the data model and reducer contract first, with
crate-local tests covering conversation reconstruction, compaction
boundaries, tool/session edges, and code-cell lifecycle reduction. Later
PRs emit into this model.

The README is the best entry point for reviewing the intended trace
format and reduction semantics before diving into the reducer modules.
morozow pushed a commit to morozow/codex that referenced this pull request Apr 23, 2026
## Summary

Wires rollout trace recording into `codex-core` session and turn
execution. This records the core model request/response, compaction, and
session lifecycle boundaries needed for replay without yet tracing every
nested runtime/tool boundary.

## Stack

This is PR 2/5 in the rollout trace stack.

- [openai#18876](openai#18876): Add rollout
trace crate
- [openai#18877](openai#18877): Record core
session rollout traces
- [openai#18878](openai#18878): Trace tool and
code-mode boundaries
- [openai#18879](openai#18879): Trace sessions
and multi-agent edges
- [openai#18880](openai#18880): Add debug trace
reduction command

## Review Notes

This layer is the first live integration point. The important review
question is whether trace recording is isolated from normal session
behavior: trace failures should not become user-visible execution
failures, and recording should preserve the existing turn/session
lifecycle semantics.

The PR depends on the reducer/data model from the first stack entry and
only introduces the core recorder surface that later PRs use for richer
runtime and relationship events.
@cassirer-openai cassirer-openai force-pushed the codex/rollout-trace-sessions-agents branch from e3bfbd5 to 5e2a4ef Compare April 23, 2026 18:42
@cassirer-openai cassirer-openai requested a review from a team as a code owner April 23, 2026 18:42
cassirer-openai added a commit that referenced this pull request Apr 23, 2026
## Summary

Extends rollout tracing across tool dispatch and code-mode runtime
boundaries. This records canonical tool-call lifecycle events and links
code-mode execution/wait operations back to the model-visible calls that
caused them.

## Stack

This is PR 3/5 in the rollout trace stack.

- [#18876](#18876): Add rollout
trace crate
- [#18877](#18877): Record core
session rollout traces
- [#18878](#18878): Trace tool and
code-mode boundaries
- [#18879](#18879): Trace sessions
and multi-agent edges
- [#18880](#18880): Add debug trace
reduction command

## Review Notes

This PR is about attribution. Reviewers should focus on whether direct
tool calls, code-mode-originated tool calls, waits, outputs, and
cancellation boundaries are recorded with enough source information for
deterministic reduction without coupling the reducer to live runtime
internals.

The stack remains valid after this layer: tool and code-mode traces
reduce through the existing crate model, while the broader session and
multi-agent relationships are added in the next PR.
@cassirer-openai cassirer-openai force-pushed the codex/rollout-trace-sessions-agents branch from 5e2a4ef to b98bcf9 Compare April 23, 2026 21:18
@cassirer-openai cassirer-openai force-pushed the codex/rollout-trace-sessions-agents branch from b98bcf9 to 0dd8afa Compare April 23, 2026 21:25
@cassirer-openai cassirer-openai force-pushed the codex/rollout-trace-debug-reduction branch from b2b8892 to d4d3242 Compare April 23, 2026 21:31
@cassirer-openai cassirer-openai force-pushed the codex/rollout-trace-debug-reduction branch from d4d3242 to c36e821 Compare April 24, 2026 00:41
@cassirer-openai cassirer-openai changed the base branch from codex/rollout-trace-sessions-agents to main April 24, 2026 00:41
@cassirer-openai cassirer-openai enabled auto-merge (squash) April 24, 2026 00:48
@xli-oai xli-oai force-pushed the codex/rollout-trace-debug-reduction branch from c36e821 to 2aea138 Compare April 24, 2026 01:32
@cassirer-openai cassirer-openai merged commit e3c8720 into main Apr 24, 2026
25 checks passed
@cassirer-openai cassirer-openai deleted the codex/rollout-trace-debug-reduction branch April 24, 2026 01:56
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 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.

2 participants