Skip to content

[Proposal] Versioned Session Action Export #18469

Open

Description

@milaforge

What variant of Codex are you using?

CLI

What feature would you like to see?

Ask

Introduce a small, versioned export surface for persisted session actions.

Goal:

  • Given a persisted session → return an ordered list of actions
  • Make it a documented, stable contract for external tools
  • Restrict V1 to data already persisted and reconstructible

Why

Codex already persists and reconstructs session history, but no surface is clearly defined as a stable contract.

This blocks tooling for questions like:

  • What commands ran?
  • What file changes occurred?
  • What tool calls happened, and in what order?
  • What can be safely replayed or inspected?

Rationale

A stable, versioned projection over persisted actions provides:

  • a minimal reproducibility surface
  • a safer alternative to depending on internal rollout formats
  • a foundation for future debugging / incident tooling

Routing question

Where should this live?

  • app-server (thread/read extension?)
  • rollout layer (as backing projection)
  • other surface if preferred

Additional information

Proposal

Expose a stable projection over persisted session history.

Possible entry points:

  • CLI: export actions from a session
  • API: return versioned action stream
  • Extension of thread/read with a documented projection

Prefer: a projection layer over existing persisted data (not raw rollout JSONL).

Example schema (V1)

  • session_id
  • turn_id
  • timestamp
  • action_type
  • tool_name
  • command
  • changed_paths
  • status

Non-goals

  • No reasoning or chain-of-thought
  • No raw prompts by default
  • No dashboards or analytics
  • No new logging system if existing persistence suffices
  • No full forensic completeness

Suggested V1 scope

Keep deliberately narrow:

  • opt-in
  • completed actions only
  • minimal schema
  • explicitly versioned
  • derived from persisted session data

Likely includes:

  • completed command executions
  • completed file changes
  • completed tool calls
  • durable turn/session markers

Excludes:

  • begin/request/delta events
  • approval flows
  • realtime ephemeral notifications

Grounding in current implementation

This proposal builds on existing behavior:

  • Rollouts are persisted and replayable
  • Persisted history is loaded into InitialHistory
  • thread/read + includeTurns returns stored history
  • persistExtendedHistory exists (without backfill guarantees)
  • Rollout items are already projected into turns

At the same time:

  • Persistence is selective (only certain “end” events)
  • Many events are intentionally not persisted
  • Realtime notifications are explicitly ephemeral
  • Stored outputs are already sanitized/truncated

Preference:

  • avoid making rollout JSONL the public contract
  • avoid relying on OTEL as the primary user-facing interface
  • expose a stable projection over persisted session history

Activity

  1. added
    enhancement
    on Apr 18, 2026
  2. added
    CLI
    app-server
    on Apr 18, 2026
  3. removed
    CLI
    app-server
    on Apr 18, 2026
  4. Mahkhmood9 commented on Apr 20, 2026

    @Mahkhmood9
  5. Mahkhmood9 commented on Apr 20, 2026

    @Mahkhmood9
  6. etraut-openai commented on Apr 20, 2026

    @etraut-openai
    Contributor

    @Mahkhmood9, please stop spamming our issue tracker.

  7. Mahkhmood9 commented on Apr 20, 2026

    @Mahkhmood9
  8. jazzyalex commented on Apr 26, 2026

    @jazzyalex

    Adding one downstream-tool perspective from Agent Sessions, which reads local Codex session history for search, transcript browsing, resume workflows, and subagent hierarchy display.

    The most useful contract for external tools would be a versioned projection over persisted history, not the raw rollout JSONL shape. In practice, the hard part is distinguishing:

    • actions that never became durable,
    • actions that are durable but intentionally redacted/truncated,
    • events that exist only as realtime app-server notifications,
    • child/subagent sessions that should be represented as separate durable sessions with a parent edge,
    • cwd/session identity changes that affect whether a resume command is meaningful.

    A small V1 projection would already help if it exposed stable identifiers and ordering:

    • session_id
    • turn_id
    • timestamp
    • action_type
    • tool_name
    • status
    • cwd
    • changed_paths
    • optional parent_session_id / child_session_id edges for subagents

    I would keep prompt text and reasoning out of V1 by default. For local history tools, the highest-value data is usually action ordering, durable status, cwd/path identity, and lineage. That is enough to answer "what happened in this session?", "which subprocess changed this file?", and "can this session be resumed safely?" without making internal rollout files a public API.

    Project for context: https://github.com/jazzyalex/agent-sessions

  9. blain3white commented on Jun 9, 2026

    @blain3white

    This overlaps with what I'm building in Clean My Agent — a local desktop app that reads Codex session JSONLs and exports structured session data. I'd be happy to compare notes if a stable external surface gets defined.

  10. Necmttn commented on Jun 21, 2026

    @Necmttn

    A useful V1 action export should be based on stable action ids and source offsets, not rendered transcript text.

    Minimum fields: schema version, session id, turn id, action id, parent action id, action kind, tool_call id, cwd, command/args, exit status, files touched, timestamps, redaction flags, and source JSONL byte range.

    That gives downstream tools reproducibility without depending on private rollout shapes.


    Generated with ax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions