Skip to content

Document session JSONL schema stability for external integrations #20952

Open

Description

@sanyathoque

What feature would you like to see?

A docs page that defines which session JSONL fields/events are stable for external tooling and which are internal/subject to change.

Problem

External integrations (dashboards, wrappers, review surfaces, CI helpers) consume Codex session JSONL, but there is no explicit stability contract. This forces parsers to depend on implementation details and breaks across updates.

Proposal

Add a docs section (for example docs/session-jsonl.md) that includes:

  1. Event envelope shape and required top-level fields.
  2. Event type catalog currently emitted in session JSONL.
  3. Stability level for each field:
    • stable for external use
    • experimental
    • internal
  4. Versioning guidance:
    • how additions/removals are communicated
    • how external parsers should handle unknown fields/events
  5. One or two realistic examples from interactive and codex exec runs.

Why this helps

  • Lowers friction for community integrations without requiring new runtime features.
  • Reduces duplicate "parser broke" issues.
  • Creates a clear foundation for future lifecycle APIs/events.

Acceptance criteria

  1. Docs explicitly define a stability contract for session JSONL fields.
  2. Docs list at least one canonical sample per run mode (interactive and exec).
  3. Docs include forward-compat parser guidance (ignore unknown fields, branch by version when present).
  4. Changelog/release notes point to this contract when format-affecting changes ship.

Scope note

This request is docs-first and additive. It does not require changing current JSONL emission behavior.

Activity

  1. added
    documentationImprovements or additions to documentation
    CLIIssues related to the Codex CLI
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on May 4, 2026
  2. github-actions commented on May 4, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. etraut-openai commented on May 4, 2026

    @etraut-openai
    Contributor

    I don't think we're prepared to treat this as a documented, stable contract at this time. We will endeavor not to make unnecessary changes, but you should expect to see this schema to continue to evolve.

    We are treating the app server interface as a durable, stable, and fully-documented API. I don't know if that interface works for your use case, but if you're concerned about long-term interface stability, that might be a better option for you.

  4. sanyathoque commented on May 5, 2026

    @sanyathoque
    Author

    Thanks for the clarification — this is helpful direction.

    I’ll treat session JSONL as internal/evolving and move integration proposals toward the app-server interface when long-term stability is required.

    If useful, I can open or draft a docs-only follow-up that explicitly guides external integrators to prefer app-server over session JSONL for stable client integrations.

  5. Herrtian commented on May 22, 2026

    @Herrtian

    The maintainer direction above makes sense to me: documenting rollout JSONL as a stable schema would probably over-promise. I prepared a smaller follow-up branch that takes the opposite approach and documents the boundary instead:

    https://github.com/Herrtian/codex/tree/docs/rollout-jsonl-stability-note

    The branch adds a short note to codex-rs/thread-store/README.md saying:

    • local rollout JSONL is a storage format, not a stable external API;
    • durable external integrations should prefer the codex app-server protocol;
    • local-only rollout readers should tolerate unknown fields/item types and validate the Codex version they target.

    Validation I ran:

    git diff --check -- codex-rs/thread-store/README.md

    PR creation appears to be limited by the repo's invitation-only contribution policy, so I'm leaving the branch here. If this is useful as a docs-only clarification, could a maintainer invite a PR or pick it up internally?

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

    documentationImprovements or additions to documentationsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions