Repository navigation
fix(codex): follow-ups to #16 and #19 - #20
Conversation
From the merge reviews: - devswha#19: codexHistoryTail read the remembered chain as it was. After a backtrack the live file's tail reached an archived parent, the read threw, and an app-server TUI without an open rollout lost its screen match until the entry was evicted. Both codexHistoryTail and codexHistorySegments now use the chain only while every file in it exists, and look it up again otherwise. transcriptStream's own check is folded into that. - devswha#16: the 32 candidates for a screen match are interactive threads only, so a burst of `codex exec` runs no longer pushes a pane's own thread out. - devswha#16: another pane now claims a newer thread only when its screen shows that thread's first message as well as its answer. An answer of this pane quoted or pasted there claims nothing. Its screen is matched against this pane's own thread and its own binding too, so a match is unique across all of them. - devswha#16: the conversation route hands its session snapshot down, so an unsure poll takes no extra snapshot, and closed panes' bindings are dropped with it. Not changed: narrowing `source='vscode'`. On this machine, TUIs attached to a Codex Desktop app-server record originator "Codex Desktop" too, so the store cannot tell a Desktop or plugin thread from a TUI's. A thread no pane shows keeps reading as unsure, never as another conversation. Tests: the archived-parent tail and the exec burst each fail without their change. A pane showing only the other thread's answer leaves this pane unsure; the pane that typed it claims it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Merged. Thanks. Each change is guarded by a test that fails without it, and pruning uses only the route's own snapshot, so a failed snapshot can't wipe the bindings. One trade-off worth writing down in the code or docs: a claim now needs the thread's first message within the other pane's last 400 lines. If pane B ran a long session while A's chat was closed, B's first question has scrolled off, so B's thread is never claimed and A shows "unavailable" until B's chat is opened. A first message under 8 normalized characters ("hi", "fix it") can never be claimed at all. It never shows the wrong conversation, so this is fine for now. A test for binding pruning and the uniqueness rule would also be welcome. Nit: |
Rebased onto main (devswha#15 and devswha#20 merged). The whole answer runs inside devswha#15's per-pane serialize: read, open the queue, keys, close. A composer submit can't land between them. Review follow-ups: - "Send now" on a held message goes through the same check as the composer. It is disabled, with the reason as its title, while Codex's queue is open in the terminal. - The remembered question (the one the queue really opened on) is matched by title and options, the newest such one. It is dropped when the pane's rollout changes. An older skipped question with the same title no longer takes its place. - closeQueue tells the question just answered from its twin by prompt id, and after 600ms treats an identical question still open as the next one (Codex takes the Enter at once). Two questions with the same title and options no longer leave the queue open. Checked live on Codex 0.156.1: two identical queued questions, each answered from its card, with the queue folded back to "? 1 question" in between. The earlier queue flows still pass. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Thanks. The follow-ups are in #23:
|
From the merge reviews. #15 (composer submit): - A submit is stamped when it reaches the server. Nothing of it is typed once 45s have passed, whether it waited behind a stalled message in the pane's queue or not: it answers submit_timeout ("nothing was typed"). A send that starts in time ends within two more 10s RPCs, and the client now waits 90s, so a message it gave up on never reaches the pane later. A contract test with a 50ms deadline fails without the check. - The collapsed-queue fallback no longer takes a numbered menu row (`› 1. …`) under the queue for the main prompt. - Text typed after the sent part keeps its leading whitespace. An edit inside the sent part while it was on its way stays in the box with a note that it was not sent, rather than silently waiting for a resend that would duplicate it (checked in a browser). #20 (Codex bindings): - The claim trade-off is written down where it lives: the other pane's first message must still be in its last 400 lines and read as 8+ letters or digits, otherwise this pane stays unsure. It never shows another conversation. - A contract test covers the uniqueness rule (a pane whose screen also matches this pane's thread claims nothing) and pruning (a closed pane's binding stops counting). Each part fails without its code. - codexHistorySegments' doc comment is back above it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Follow-ups from the merge reviews of #16 and #19.
#19
codexHistoryTailstill read the remembered chain as it was. Right after a backtrack, the live file's tail reached the archived parent andreadRangethrew, so the candidate was dropped. An app-server Codex TUI with no open rollout fd then had nothing to match, and the pane showed terminal output until the entry was evicted. NowcodexHistoryTailandcodexHistorySegmentsboth use the chain only while every file in it exists, and look it up again otherwise. The checktranscriptStreamhad of its own is folded into that.#16
sourcecliorvscode). A burst ofcodex execruns no longer pushes the pane's own thread out.first_user_message) as well as its answer. A pane where this pane's answer is only quoted or pasted claims nothing. The screen is also matched against this pane's own thread and that pane's binding, so a match has to be unique across all of them.vscode. On my machine, TUIs attached to a Codex Desktop app-server recordoriginator = "Codex Desktop"too, including the TUIs herdr starts. So the store can't tell a Desktop or plugin thread from a TUI's thread. A thread that no pane shows keeps reading as "can't tell", never as another conversation.Testing
bun run typecheckis clean;bun test: 281 pass.codexHistoryTailafter the parent is archived under a remembered chaincodex execrows newer than its thread/newin A was never taken for its old conversation.🤖 Generated with Claude Code