Skip to content

Codex's diffs from its own session file #988

Closed

Description

@JacobStephens2

Parent

#700

What to build

For each Codex session, thirdshift finds Codex's own session file by the thread ID it already reads from Codex's stream. It reads the diff of each edit Codex made through apply_patch, and adds the diff to the Session trace as Codex's record of that edit. Edits are matched by order and file path, since Codex's stream and its file give an edit different IDs. The Console shows the diff for a Codex edit in place of "Patch unavailable in this log."

Shell edits stay without a diff. When Codex's file can't be found, can't be read, or doesn't match, the edit's record stays as it is and nothing fails. Codex doesn't publish the file's format, so a change to it falls back to today's behavior.

Acceptance criteria

  • With a fake Codex that writes its own session file under a temporary home, each apply_patch edit's diff appears in the Session trace, marked as Codex's record of the edit, and the Console shows it.
  • A file whose edits don't match by order and path adds no diff.
  • Shell edits stay without a diff, and a missing or unreadable file changes nothing and fails nothing.
  • Closes Decide Codex patch evidence retention for Console edit diffs #854.
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

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions