Skip to content

Command outcomes: prove Codex and Claude transcripts through one descriptor and return its identity #3402

Closed

Description

@devswha

Follow-up from #3399 (#3398, command-outcome tracking held to the authorized transcript), by the maintainer's decision. Not blocking: the merge pass did not reproduce these two.

#3399 has the OMP, Pi and GJC transcript resolvers return the exact dev:ino of the file they proved through one held descriptor. The outcome read checks that identity before reading. Codex and Claude still prove their file by path, across separate reads:

  • Codex (codexTranscriptPath): it reads /proc/<pid>/fd links, then matches the screen against a by-path codexHistoryTail(path).
  • Claude (claudeTranscriptPath, also used by claudePaneSession): it calls stat(path).isFile(), then reads the file's tail by path in continuedInSession(path).

Neither holds a descriptor whose identity it could pass on. For now the guard is the exact bigint stat in readCommandTranscript, plus the bound-handle check on every byte. A file renamed over the transcript between the resolver's content proof and that stat can't be told apart from the agent's own rewrite.

Fix:

  • Run each resolver's content proof through ONE opened descriptor (O_RDONLY | O_NONBLOCK).
  • Return that descriptor's exact identity, as fix(conversation): read command outcomes through the transcript the resolver authorized #3399 does for Pi (piFile), OMP (ompFile) and GJC.
  • Have the outcome read check it.
  • This changes the return contracts of claudeTranscriptPath and codexTranscriptPath; update their other callers.
  • Add a failing-first test per agent: a transcript renamed over the proven file after the proof gives no result-observed.

Activity

  1. devswha commented on Nov 8, 2026

    @devswha
    OwnerAuthor

    Repro for this work, from the merge pass's Codex review of #3399 at ad59c07 (route: axwith), reproduced:

    Claude and Codex transcript resolution returns only a path, so the command-outcome reader (server/conversation.ts:2685) accepts whichever file occupies that path at its first stat. Renaming a foreign Claude transcript containing a /context echo and its output over the resolved path between the resolver's return and that stat made /api/pane/prompt report /context as result-observed with transcript evidence from the foreign file; the same swap makes Codex's reader return foreign evidence. Pi, OMP, GJC and OmO are already bound to their resolver's held-descriptor identity after #3399; Claude and Codex need the same (resolve once into a held descriptor and read the outcome from it).

  2. added a commit that references this issue on Nov 9, 2026
    1239943
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions