Skip to content

Codex generation-record route can serve a record after the verified pane root or a launcher is replaced, or a verified PID is reused #3879

Backlog

Description

@fsafey

OpenRig version

main at eeb7cb3 (package.json 0.7.21). The 0.7.22 npm release has the same route code for this path.

OS, Node and tmux versions

macOS 27.0.1, Node 22.23.1, tmux 3.6a

Harnesses involved

Codex

What you ran and what happened

# Found by reading the route and confirmed with deterministic route tests (mocked tmux and process census).
# Not seen in the field: it needs a process replacement or PID reuse inside the request window.
GET /api/sessions/<session>/generation-record      # a Codex seat with a verified identity verdict

The route checks only that the pane root PID is the same before and after its thread lookup. Three cases still return the record:

  1. A PID the identity verdict recorded (the pane root, or the native Codex process for a dual-PID verdict) now belongs to a process that started after the verdict. The route never compares a process start time with the verdict's observedAt.
  2. The pane root, or a launcher between it and Codex, is replaced during the lookup while the root PID stays the same (PID reuse) or the chain below it changes.
  3. The binding or the occupant tenure changes during the closing pane read: tenure and binding are read before that last await (and before the node:fs import), not after it.

A Codex process replaced or reused during the thread read itself is already refused on main by the fresh recheck from #3603, so that case is not part of this report.

Expected: each case returns 409 record_identity_unverified, as the route already does for a changed pane root PID.
Actual: 200 with the record of the conversation the lookup read.

A prepared change with 7 route tests that fail on main is ready to open as a PR.

Instance state that might matter

None; the cases are timing races around one request.

Checks

  • I searched existing issues and Discussions for this.
  • I am on the latest published version, or I said which version above.

Activity

  1. added
    bug
    area: harness
    needs-triage
    on Nov 24, 2026
  2. mvschwarz commented on Nov 24, 2026

    @mvschwarz
    Owner

    Thanks, @fsafey, for the report and the route tests. As you describe it, the Codex generation-record route checks only that the pane root PID is unchanged around its thread lookup, so it can still return the record with 200 in three cases: a PID the identity verdict recorded now belongs to a process that started after the verdict, the pane root or a launcher below it is replaced during the lookup, or the binding or occupant changes during the closing pane read. You'd expect 409 record_identity_unverified in each case, as for a changed pane root PID today. Thanks also for the offer of your prepared change. We'll come back here on the approach.

  3. mvschwarz commented on Nov 25, 2026

    @mvschwarz
    Owner

    Thanks for waiting, @fsafey. We read #3886 against current main; this is a source review, not a native reproduction. Your reports identify real gaps in the checks, and say they haven't been seen in the field. Please keep the read-order fix: read tenure and binding after the last await, with the filesystem import earlier.

    For the added process checks, we'd like refusal only on positive evidence of a changed process, not merely an uncertain start time. As written, the same-second comparison or an unparseable start can reject a legitimate process, and a refusal during rig walk fails that piece. Please build on the native proof's existing process-identity evidence—persist the needed PID/start identity and compare it across the lookup—instead of using the verdict's observedAt as a birth-time boundary. For evidence that must be newer than the request, readProcessTableCensusNow exists; fresh: true can still join a read in flight. Preserve existing checks and distinguish unknown evidence from an observed replacement. Would you reshape #3886 along those lines? It stays your change; this is direction, not a merge or release promise.

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

    area: harnessbugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions