Skip to content

Every codex seat resolves its pane to the one the app-server was launched from #1112

Description

@fujibee

Every codex seat resolves its own pane to the same pane, and it is not theirs.

seat        placement record      naming mark        actually in
agdev-co1   herdr:w1:pJ (stale)   herdr:w1:p2        w1:p2
agdev-co2   herdr:w1:pN           herdr:w1:p2        w1:pN
agdev-co3   herdr:w1:pP           herdr:w1:p2        w1:pP

Three seats, three different panes, one answer.

This was measured rather than reasoned into: agdev-co2 had no reference in its mark at all, was asked to run one send.sh, and wrote herdr:w1:p2 — a pane belonging to a different seat. The wrong value is produced on demand, so it can be reproduced at will.

Why

Self-naming resolves "which pane am I in" from the environment. A codex seat does not get its environment from its pane: it reaches this machine through a shared app-server daemon (Remote: ws://127.0.0.1:… in its own header), and every session under that daemon inherits the environment of wherever the daemon was started. That is w1:p2. So the question "which pane am I in" is answered, for all of them, by the pane the daemon happens to have been launched from.

It is not that codex seats fail to name themselves. They name themselves confidently and identically, and the answer is somebody else's pane.

Why this looked like three bugs

Read one seat at a time, the symptoms differ: one has a stale placement record, one had an empty mark, one points at a neighbour. Read together, the marks are identical and only the placement records differ — and the placement records differ because they came from spawn, which knew the real pane at launch. The half written by the seat is uniformly wrong; the half written by the spawner is right where it exists and stale where the seat has since moved.

Earlier versions of this issue described this as "codex never records its mark" and then as "three different wrong answers". Both were artifacts of looking at seats individually. The correction that mattered was putting all three side by side.

What a fix has to establish

A codex seat cannot trust an inherited environment variable to say where it is. Something else has to answer:

  • the terminal can be asked which pane holds a given process or agent session — the herdr driver already resolves a session id to a pane elsewhere, and that path does not depend on inheritance;
  • or the seat's identity in the terminal (its agent session) is the key, and the pane is derived from it rather than read from the environment.

Whatever the route, the test is the one above: three seats in three panes must produce three answers. A test with a single seat passes today.

Acceptance

  • Each codex seat's mark names the pane it is in, verified with at least three seats in different panes simultaneously.
  • A seat never writes a pane reference that another seat's mark already claims.
  • agdev-co1's pane, relabelled .dotteam:alice by a test thirteen hours ago, is restored by its occupant on its next action.
  • The claude-code path keeps working — it resolves from the environment correctly because its process really is in that pane, and that must not be broken while fixing the case where it is not.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions