Skip to content

A seat can find its own pane by emitting a token and seeing where it appears #1124

Description

@fujibee

A seat that was started by hand — no spawn, so no placement record and no pane
label — cannot be repaired. --fix skips it with no_placement_record, and when
it names itself the environment answers with the pane the shared app-server was
launched from. Every route we have depends on something that seat does not have.

There is a route that depends on none of them, and it was measured on the live
workstation with a control.

The measurement

A seat always knows who it is: it was started with actas <name>, so it holds
its team and agent. What it does not know is where it is. It can establish that
by emitting a value and finding which pane displays it.

before      the token was absent from every pane          (control)
seat A      asked to echo token 1   ->  appeared in pane P
seat B      asked to echo token 2   ->  appeared in pane Q

Two seats, two different panes. So this is not "all codex output renders in the
daemon's pane" — each seat's output reaches its own pane. The control rules out
the token having been there beforehand, which is the failure this same session
walked into elsewhere: a confirmation line already in the scrollback reads as
proof of the act that was supposed to produce it.

Why this route is different from the ones we have

route depends on
environment the process tree, which for a shared app-server is the daemon's
session id the terminal's session-to-pane map, measured to disagree with what is running
pane label the naming mechanism that is itself the thing being repaired
emit and observe nothing but the seat's own output reaching its own pane

The third row is worth stating plainly, because it was the basis for the label
route and it is weaker than it first appears: the label is written by spawn, by
--fix, and by the seat itself. It is not an independent authority. What it does
have is that it is written per pane rather than read from an inherited
environment, so it does not fail identically for every seat under one daemon.

Cost, and what is not established

One read per pane, once, at the point a seat cannot resolve itself any other way
— not on every action. On this workstation that is a few dozen reads.

Not established: what a seat should emit so the token is not mistaken for content
(it must not collide with anything a person might type); how to bound the scan
when a pane's readable window is short — measured at 80 lines on one driver
(#1121), so a token can scroll out between emitting and scanning; and what
happens when two seats probe at the same time.

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