Repository navigation
fix(chat): reject ambiguous rendered Codex conversations - #34
Merged
Merged
Conversation
…and window controls on an iPad (supersedes devswha#3338-devswha#3341) (devswha#3583) Supersedes devswha#3338, devswha#3339, devswha#3340 and devswha#3341, four iPad fixes by @Noobear that all change `src/lib/viewport.ts` and `scripts/keyboard-viewport-regression.ts` and conflict pairwise. This branch carries their commits unchanged (same author), in the order devswha#3341, devswha#3340, devswha#3339, devswha#3338, resolves the conflicts, and fixes what review found on each. The four PRs name no issue to close; this one closes devswha#3483, which devswha#3339 and devswha#3561 together fix. Thank you, @Noobear: the four fixes, their regression cases and the measurements from your own iPad are all here, and nothing more is needed from you. Closes devswha#3483 ## What changes for a user - **Hardware keyboard on an iPad home-screen app (devswha#3341):** a visual viewport that shrinks for one frame on each key is no longer taken for an on-screen keyboard, so the page does not flash. - **iPad home-screen app in landscape (devswha#3340):** the shell fits the area under the status bar, so a tap into a field no longer slides the screen up and back. - **Fields (devswha#3339):** text fields and selects follow the interface font size like the labels beside them. On an iPhone or iPad a field that is pressed or takes the focus is at least 16px while it has the focus, so Safari does not zoom the page into it. Find in diff does the same on an iPad (devswha#3483). - **Windowed iPad home-screen app, iPadOS 26 and later (devswha#3338):** the header's first button stays clear of the window's close, minimize and full-screen controls. ## Commits Author's commits, cherry-picked in order (the only conflict resolution: one `PASS` line holding every suffix, and one `const ios` instead of two): | From | Commit | |---|---| | devswha#3341 | fix(mobile): apply a shrinking visual viewport only once it lasted a moment | | devswha#3340 | fix(mobile): fit an iPad home-screen app's landscape shell to the visual viewport | | devswha#3339 | fix(settings): fields follow the interface font size; iOS arms a pressed field to 16px | | devswha#3339 | fix(settings): arm a field from its label's press; disarm on a cancelled press | | devswha#3339 | fix(settings): an armed field keeps an interface size over 16px instead of shrinking to it (maintainer, already on the PR) | | devswha#3339 | fix(settings): arm a field a handler focuses, not only a pressed one (maintainer, already on the PR) | | devswha#3338 | fix(ipad): keep the header's first button clear of a windowed app's controls (iPadOS 26) | Then seven commits of this PR: the four fixes below (each `Co-authored-by` the author, whose code they rework), the devswha#3483 regression case, the changelog credit, and one for the review of this PR itself (second table below). ## Findings and how each was resolved Each MEDIUM was reproduced first as a failing case in `scripts/keyboard-viewport-regression.ts` on the unfixed code, then fixed; the case stays as the regression. | # | Finding | Reproduced | Resolution | |---|---|---|---| | 1 | **devswha#3341 MEDIUM** Every viewport event restarted the 40 ms wait, so a keyboard opening under a stream of events was applied only 40 ms after the last one. | Yes: twelve frames with an event each, `a keyboard opening under a stream of viewport events counts while it opens` failed (`data-keyboard` still off at 192 ms). | The first shrinking event starts the wait; later ones leave it running. | | 2 | **devswha#3340 × devswha#3341** timing contradiction: "shrinking" meant shorter than `100lvh`, which is the steady state of an iPad home-screen app under its status bar (and of a Safari tab with its toolbars), so every sync waited there and devswha#3340's own check read no height after the load. | Yes: with both PRs in, `iPad landscape: the shell fits the visual viewport` failed (`published: ''`, 820 instead of 796). | Shrinking is measured against the state applied last, so a steady state and the first sync of a page never wait. (The first version of this fix also said Chrome shrinks all three viewports together; that was wrong, see finding 12.) | | 3 | The one-frame check raced a real clock: an installed Playwright clock keeps running, so a slow runner could let the 40 ms run out between two steps. | Yes (probe: a 40 ms timer fired by itself after `clock.install()`). | The scenario pauses the page clock; only `runFor` moves it. | | 4 | **devswha#3340 MEDIUM** The iPad test read the layout (744px on its short side); an enlarged page zoom (125% lays an 820-point side out at 656px) or a narrow window turned the fit off. | Yes: `iPad landscape at 125% page zoom: the shell fits the visual viewport` failed (656 instead of 637). | The screen's own short side is read. The cases now use the layout a page zoom really produces (85%: 1388×965; 125%: 944×656) and add a 600px window. | | 5 | **devswha#3339 LOW** An iOS press could leave the agent picker (a button drawn as a select) at 16px for good; so could a field whose press ended without the focus, and a disabled field pressed through its label. | Yes: `a pressed picker button keeps the interface size` failed, and with that one skipped `a picker button keeps the interface size after its press` (16px instead of 14px). | Only a text field, a textarea or a native select that can take the focus is armed. A press that ends in a click without the focus is disarmed once the click's default is done; a press that never ends in a click is cleared by the next press. | | 6 | **devswha#3338 MEDIUM** Every home-screen app narrower than its screen got the 68px room, also iPadOS 16-18 Split View, Slide Over and Stage Manager, which draw nothing in that corner. | Yes: `Split View on iPadOS 18: the window's controls are not there` failed. | A probe for iPadOS 26 and later: `CSS.supports("anchor-name: --a")` (CSS anchor positioning arrived with Safari 26; a home-screen app's user agent on an iPad names no system version). Where the controls are not drawn, nothing is marked, measured or listened for. | | 7 | **devswha#3338 LOW** The one-point margin was smaller than what page zoom rounds away (iPad mini at 300%: 377px × 3 = 1131 of 1133; at 115% in portrait: 742.9 of 744). | Yes, with the whole-number widths of the review: `full screen at 300% page zoom: the window's controls are not there` failed. Whether WebKit reports whole numbers there was not checked on a device. | The margin is the scale plus one point. | | 8 | **devswha#3338 LOW** No test of the default wide layout, where the room goes on `.header-side`, nor of a window going full screen. | n/a (coverage) | The cases build the app's zoned header with the sidebar's top row: from 769px the room is on that row and the header adds none, with the sidebar collapsed or under 769px it is on the header, never both; a resize to full screen clears the mark and back sets it. | | 9 | **devswha#3338 LOW** No reference design named. | n/a | See "Reference design". | | 10 | Maintainer note on devswha#3338: the mark only follows `resize`. | Not a defect: every way in or out of a window changes its width. | Left as is, said in a comment. An `orientationchange` listener would read the new orientation against the old width for a moment. | | 11 | Known limit from devswha#3338, unchanged: a window as wide as the screen but shorter is not detected. | n/a | Not in this PR. | ### Second round: the review of this PR (head `3cb28a6ed`) Both reviewers and CodeRabbit found the shrink wait reaching further than the bug it is for. Each row was reproduced first as a failing check of `scripts/keyboard-viewport-regression.ts` on `3cb28a6ed`, with the script reading each state in the event that set it. | # | Finding | Reproduced | Resolution | |---|---|---|---| | 12 | **MEDIUM** The 40 ms wait had no platform gate and also held a shrink while a keyboard was up: an iPhone's and Android's keyboard were counted 40 ms late, a keyboard that grew kept a stale taller shell, and so did a rotation. The comment and this body claimed Chrome shrinks all three viewports together; `src/lib/viewport.test.ts` records 477 / 477 / lvh 533. | Yes: the phone's keyboard (472px), a keyboard that grows (400px), Chrome's measured numbers (477, 477, 533), a rotation with the keyboard up, split view, the virtual keyboard and both home-screen phone scenarios all failed `keyboard flag follows occlusion, not focus alone` when read in their event. | The wait is for the reported case only: an iPad (the platform an iPad reports and an iPad's screen, at least 744 points on its short side), no keyboard counted yet, and a visual viewport shorter than the one applied last. Everything else is applied in its event, in `main`'s order. | | 13 | **LOW** The regression ran the clock 50 ms before every read and its resizes-content case set lvh equal to the visual viewport, so no case could see a delay. | Yes: with the read moved into the event, the existing keyboard-up checks of every phone scenario failed on `3cb28a6ed`. | The clock is paused and a state is read in its event; only a case that must wait runs the clock. The one-frame and stream cases moved to an iPad home-screen scenario; the phone gained a keyboard that grows and `geometry(page, 477, 477, 533)`. | | 14 | **MEDIUM** (Codex) A field that lost the focus while the shrink waited was gone when the wait ended, so the keyboard was not counted and covered the shell. | Yes: on the iPad scenario, blur during the wait: `keyboard flag follows occlusion, not focus alone` failed after the wait. | The focus a dip began with is kept until its wait ends. | | 15 | **Minor** (CodeRabbit) An iPad window made smaller kept its old shell height for 40 ms. | Yes: a smaller window (676 under 700) and a rotation back to landscape both failed `height override follows keyboard or measured standalone inset` in their event. | A dip leaves the window as it was: the wait needs the same width and the same large viewport, so a resized window and a rotation are applied in their event. | | 16 | **LOW** A field disabled while it had the focus kept `data-armed` (16px at rest) after the focus left. | Yes: `the blur of a field disabled while focused disarms it` and `the next press disarms a field that lost the focus without a blur` failed. | The blur disarms whatever it leaves, and a press or a focus elsewhere clears anything left armed without the focus. | | 17 | **LOW** A pressed Settings select widened before the tap ended, which can wrap its row's label and move the select from under the finger. | Yes for the cause: `.select: a press leaves the size` failed (16px at `pointerdown`), and an armed select is wider than at rest (asserted). The tap missing on a device was not reproduced. | A native select is armed only as it takes the focus; a text field, whose box does not follow its text, is still armed by the press. | ### devswha#3339's three review threads All three are settled on this branch (they were raised on the PR's first commit and answered by the author's second): - *Changelog wording*: the fragment says the field "grows to at least 16px and keeps it while it has the focus". - *Arm the field when its label is pressed*: done in the author's second commit, with a regression case (`16px from a press on its label`). - *Clear the armed state after an unsuccessful press*: a cancelled press was handled in the author's second commit; finding 5 adds the press that ends without the focus and the one that never ends in a click, each with a case. ## devswha#3483: Find in diff on an iPad `scripts/diff-find-demo-regression.ts` gains the case devswha#3561 left for after devswha#3339: on the demo, with the platform and touch points iPadOS reports, at 1180 and at 820, the query a tap on Find focuses and the query a tap focuses read 16px, 14px again once the focus leaves; a 20px interface keeps 20px. ## Reference design - **Window controls (devswha#3338):** the answer of desktop apps that draw their own title bar, the Claude and Codex desktop apps and Zed on macOS among them: the top bar's first control starts to the right of the window's controls, the bar keeps its height and nothing else moves. Ovis already does this for Chrome's `window-controls-overlay` mode from `titlebar-area-x`; iPadOS reports no such value, so the room is a measured constant (68pt) converted through the page zoom. - **Fields (devswha#3339):** a field's text at the size of the labels around it, as those apps draw their settings. The 16px while focused differs from them on purpose: Safari zooms a web page into a field under 16px on an iPhone, which an app with its own window does not face. - **devswha#3340 and devswha#3341** change no design: they keep the shell where it already was. - These are named from how the apps are known to behave; none was opened for this PR. ## Screenshots Not uploaded here. Before/after shots were taken on the static demo and handed to the maintainer: Settings → Appearance (selects and text fields) and the New workspace dialog (Directory, the agent picker), as an iPhone at 390px and an iPad at 1180px, at the default and a 20px interface size, at rest and with a text field focused by a tap (32 shots, 16 side-by-side pairs). The computed sizes they show: | | before: rest / focused | after: rest / focused | |---|---|---| | iPhone 390px, default (14px body) | 16px / 16px | 14px / 16px | | iPhone 390px, 20px interface | 16px / 16px | 20px / 20px | | iPad 1180px, default | 13px / 13px | 13px / 16px | | iPad 1180px, 20px interface | 18.6px / 18.6px | 18.6px / 18.6px | The agent picker (a button) follows the same resting sizes and is never enlarged. A native select follows them too and is enlarged only once it has the focus, not by the press. The shots were taken on the first head; the second round changed none of the sizes in this table. ## Validation All on head `1171f74d9` (the branch rebased onto `main` 68f1fa9, plus the second round's commit) unless said otherwise. - `bun run check fast`: passed (workflow syntax, generated types and themes, typecheck, build; unit tests 14770 pass, 0 fail, 51 skip). - In the CI runner image (`herdr-ci-runner:local`, as its own user, in a checkout of its own at this head, through `scripts/ci-browser-parallel.ts`), no retries: - `scripts/ui-regression.ts`, `scripts/ui-contexts-regression.ts`, `scripts/ui-contexts-layout-regression.ts`: 3/3 passed. They also run the checks they import, among them `mobile-viewport`, `keybar-focus`, `mobile-tabs`, `terminal-pinch`, `terminal-input-spacing`, `pane-find`, `settings-tabs`, `header-lens-switch`, `split-view`, `tab-menu` and `secret-input`. - 54 scripts that name the header, the sidebar, fields, the composer or the viewport: 54/54 passed, `keyboard-viewport-regression` and `diff-find-demo-regression` among them. <details><summary>The 54 scripts</summary> `agent-helpers-fold-demo-regression`, `chat-greeting-demo-regression`, `cliproxy-settings-regression`, `composer-draft-demo-regression`, `composer-fit-demo-regression`, `composer-send-demo-regression`, `context-menu-inputs-demo-regression`, `deep-link-demo-regression`, `diff-find-demo-regression`, `drawer-modal-regression`, `droplet-demo-regression`, `file-text-size-demo-regression`, `file-viewer-mobile-regression`, `files-prompt-regression`, `header-context-demo-regression`, `interface-font-demo-regression`, `keyboard-viewport-regression`, `machine-dialog-regression`, `mirror-fold-demo-regression`, `new-session-skills-browser-qa`, `pane-input-focus-demo-regression`, `phone-glass-header-demo-regression`, `phone-safe-area-demo-regression`, `prompt-dock-demo-regression`, `push-health-demo-regression`, `pwa-update-browser-qa`, `recent-folders-regression`, `reconnect-header-demo-regression`, `repo-diff-browser-qa`, `settings-pages-demo-regression`, `settings-palette-search-demo-regression`, `settings-rows-demo-regression`, `sidebar-activity-demo-regression`, `sidebar-agent-tree-demo-regression`, `sidebar-background-workspaces-demo-regression`, `sidebar-branch-line-demo-regression`, `sidebar-context-ring-demo-regression`, `sidebar-declutter-demo-regression`, `sidebar-filter-demo-regression`, `sidebar-heads-demo-regression`, `sidebar-machine-layout-demo-regression`, `sidebar-machine-removal-demo-regression`, `sidebar-peek-demo-regression`, `sidebar-selection-contrast-demo-regression`, `sidebar-spacing-demo-regression`, `sidebar-split-access-demo-regression`, `sidebar-split-demo-regression`, `sidebar-tokens-demo-regression`, `tap-targets-demo-regression`, `terminal-keyboard-demo-regression`, `terminal-served-font-regression`, `terminal-viewport-regression`, `unconfirmed-input-demo-regression`, `workspace-rows-regression` </details> - Each reproduction above: `scripts/keyboard-viewport-regression.ts` on the host's Chromium, failing before its fix and passing after. For the second round the script was also run once with its assertions collecting instead of stopping, on `3cb28a6ed`'s code, to list every check that fails there. - The first head (`3cb28a6ed`) passed the same checks before the rebase (fast checks, 3/3 and 50/50 in the image). Its GitHub run failed one script this PR does not touch, `background-agent-states-desktop-demo-regression` (a disabled row button, `background-agent-detail-demo-run.ts:201`); its sibling failed the same way on another PR's run (42808284998), and it passes here on the rebased branch. - Skipped: `bun run check full`, the integration suite, the Windows and macOS jobs, and every script not listed above. ### iOS Simulator (the test Mac; iPhone 18 Pro and iPad Air 11-inch, iOS/iPadOS 27.0, Safari 27.0) Static demo only. Real touches; a probe logged sizes, `visualViewport` and the marks. First round: `main` f885760 against the branch at `484e67f3e`. Second round, after the review: `main` 68f1fa9 against this head, with the probe timing each mark against its viewport event. - **Safari's zoom (devswha#3339), iPhone:** a control page proves this Safari zooms: a 12px field goes to scale 1.33 when tapped and when a button's handler focuses it; a 16px one stays at 1. On this branch, at the default and at a 12px interface, the sidebar filter, a Settings select, Find in diff (through its button and tapped) and Rename tab rest at the interface size, read 16px while focused, return on blur, and the page stays at scale 1 at the focus and 300 ms and 1200 ms after it. A field focused by a handler is armed inside the focus event, and no zoom followed. This was the open question on devswha#3339. - **Safari's zoom, iPad:** Safari on the iPad never zoomed into a field, on `main` either: the 12px control stays at scale 1 in landscape and portrait, and with the mobile site in landscape. So the zoom devswha#3483 describes did not reproduce on an iPad. The sizes are as intended (filter and select 13px → 16px → 13px, Find in diff 14px → 16px → 14px, at 1180 and 820), but on this iPad they only change how a focused field looks: it grows by 3px, and a select that keeps the focus after its menu closes stays that size until the focus moves. See "A decision left to the maintainer". - **Window controls (devswha#3338):** the home-screen app could be installed and put in a window (641×583). On this branch it is marked, the room is 68px and the header's first button starts at x=68, clear of the controls, which end about 61pt from the window's left edge. On `main` the button sits at x=12, under them. In a Safari tab and in the full-screen app nothing is marked. `CSS.supports("anchor-name: --a")` is true on iPadOS 27. - **Page zoom (devswha#3338, devswha#3340):** at 85%, 100%, 115% and 125% in a Safari tab, `screen` stays 820×1180 while the layout and `visualViewport.scale` follow the zoom (125% in landscape lays out 944px wide at scale 1.25), which is what both fixes assume. - **Landscape shell (devswha#3340):** in the full-screen home-screen app the visual viewport is 788 under a 820 `100lvh`, and this branch publishes `--app-height: 788px`. iPadOS 27 already draws `100dvh` at 788 there, so at rest nothing differs from `main` and the slide on focus did not show on `main`. A difference did show with a hardware key pressed and the keyboard reduced to its floating bar (viewport 719.5): this branch fits the shell to 720px and the composer stays clear of the bar; on `main` the shell stays 788 and the bar covers the composer's bottom row. - **Shrink wait (devswha#3341):** keys sent as HID events caused no one-frame shrink on either build, so the flash was neither reproduced nor refuted. - **The phone's keyboard (second round):** on the iPhone, this head sets and clears `data-keyboard` and `--app-height` in the same task as the viewport event, as `main` does: 0 to 7 ms on both builds over four opens and four closes each, and no 40 ms gap in 16 more keyboard changes. A rotation with the keyboard up is the same on both. - **The iPad's keyboard (second round):** only the iPad waits, and only on a shrink: the keyboard counts 41 to 43 ms after the viewport event (Safari tab and the windowed home-screen app), where `main` counts it in the event; it is cleared in the event on both. One case beyond a plain open waits too: rotating back to landscape with the keyboard up, where the window's resize first un-counts the keyboard and the viewport's shrink 0.8 s later is then held 41 ms. - **A pressed select (second round, iPhone):** at `pointerdown` and in the next frame a Settings select keeps its size, has no `data-armed` and the same box (115×44 at 14px, 106×44 at 12px); with the focus it is 16px and 125×44; the picker opened on 8 of 8 taps. Text fields: no zoom, as in the first round. ### Could not be checked - A real iPad, and a Magic Keyboard: the two home-screen bugs as reported (devswha#3340's slide, devswha#3341's flash) were not reproduced on `main` here. - iPadOS 16 to 18 and iPadOS 26: only the 27.0 runtime is installed, so the probe's false side (Split View, Slide Over on iPadOS 18) ran in the regression only, with the probe faked. - A windowed app 769px or wider on a device (the `.header-side` rule): the Simulator's window would not resize further. The regression covers the rule. - Page zoom inside the home-screen app, a pinch, and an iPhone home-screen app. - Whether WebKit reports whole-number widths under page zoom (finding 7). - On a device: a field losing the focus during the iPad's wait (finding 14), a keyboard that changes height while up on the iPad (the emoji views did not change the viewport), and the tap that finding 17 says could miss (the press no longer changes the select, so it was not provoked). ## A decision left to the maintainer Arming on an iPad follows devswha#3483 and devswha#3561, and the new regression pins 16px there. The Simulator says Safari on an iPad does not zoom into a small field at all, so on an iPad the arming is only a visible 3px growth while a field has the focus. Limiting the arming to the iPhone would be a small change (and devswha#3483 would close as not reproducing); it is not made here because iPadOS 16 to 26 could not be checked. ## Not in this PR - A field with a size of its own (Rename tab uses `--fs-sm`) grows to the generic field size when armed at a large interface size (noted on devswha#3339). - The native iPad app (Capacitor, `app/ios`): not covered, `display-mode: standalone` was not checked there. - A window as wide as the screen but shorter (finding 11). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Noobear <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: sisyphus-dev-ai <[email protected]>
…s up (devswha#3597) <!-- See CONTRIBUTING.md for checks, translations, contract tests and the changelog (a file in changelog.d/, never CHANGELOG.md). --> ## Change **Problem.** On Android (seen on a Galaxy S26 Ultra), with the soft keyboard up in a terminal pane, tapping any key-bar key (Esc, Ctrl, Tab, an arrow, More keys) hides the keyboard. The tap's focus is already kept (`keepFocus` cancels pointerdown and mousedown), so focus is not what moves. The cause is `holdKeyboardForTap()` from devswha#3297. For every touch press of a key it sets `inputmode="none"` on the focused field until the click is handled. That is right for the case devswha#3297 fixed (devswha#3274: Back put the keyboard away but left the field focused, and the next key tap raised it again). But with the keyboard **up**, switching a focused field to `inputmode="none"` makes Blink send the new input type to the IME, and the IME hides the keyboard that is showing. The comment there said it "also leaves a keyboard that is up where it is"; on this device it does not. **Behavior after this PR.** `holdKeyboardForTap()` returns early when `keyboardUp()` is true (the `data-keyboard` attribute `lib/viewport.ts` sets). With the keyboard up, a key tap leaves `inputmode` alone and the keyboard stays up. With the keyboard down (Back put it away), the hold works exactly as in devswha#3297, so devswha#3274 stays fixed. This follows T3 Code's mobile terminal, whose key row over the keyboard (arrows, esc, sticky ctrl/alt, tab) leaves the keyboard up on every key and puts it away only through its own explicit dismiss button (`apps/mobile/src/features/terminal/ThreadTerminalRouteScreen.tsx`). - `src/components/KeyBar.tsx`: the early return and the corrected comment. - `scripts/keybar-focus-regression.ts`: a keyboard-up case. It sets `data-keyboard`, taps Escape and More keys, and asserts the field keeps focus and a `MutationObserver` sees no `inputmode` change during the taps. The keyboard-down case is unchanged. - `changelog.d/keybar-tap-keeps-keyboard-up.md`. Risk: the fix relies on `data-keyboard` being current at the moment of the tap. If it lagged behind a keyboard that was just put away, the tap would skip the hold and devswha#3274's re-raise could come back for that one tap. Note on coverage: `scripts/keybar-focus-regression.ts` is not listed in `scripts/ci-browser.sh` and has no line in docs/development.md. Its check still runs in CI through `ui-contexts-checks.ts` (`checkKeyBarKeepsKeyboardDown`, run by `ui-contexts-regression`), and the new keyboard-up case is inside that exported check, so CI covers it. Only the standalone script is unlisted. `scripts/android-ime-regression.ts`, the one test that asks a real IME whether the keyboard is shown, needs `ANDROID_IME_SERIAL` (an emulator) and did not run here. ## Validation - `bun run check fast` on this branch: typecheck, build and unit tests ok (14795 pass; the one failure, `server/copilot.test.ts` "keeps a logged binding when only the log's timestamps change", fails the same way on main and passed on later runs). - After the doc-comment commit (084ad83, comments only), `bun run check fast` again: typecheck and build ok; unit tests failed on the same copilot test (fails on main too), two `pi-questionnaire-route` timeouts and `scripts/plugin.test.ts` "stop > returns only once the server's process group is gone". Rerun by file, the questionnaire tests pass, and the plugin test passes 2 of 2 on this branch and on main. - In the self-hosted runner image built from `scripts/self-hosted-runner/Dockerfile`, as its own user, through `bun run check run`: - pass: `keybar-focus-regression`, `ui-contexts-regression`, `key-bar-hold-repeat-regression`, `key-bar-customization-demo-regression`, `terminal-keyboard-demo-regression`, `sticky-modifiers-regression`, `keyboard-viewport-regression`, `terminal-input-regression`. - skipped: `android-ime-regression` (needs an emulator; refuses physical devices). - On a device, by hand: Galaxy S26 Ultra, Chrome. On the 0.5.2 release (which has devswha#3297), a key-bar tap with the keyboard up hid the keyboard; on this branch the keyboard stays up through key, modifier and arrow taps. devswha#3274's case still holds: after Back puts the keyboard away, a key-bar tap leaves it down. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…r a Letta scan cut short (devswha#3598) Follow-ups to the low-severity findings the merge pass left on devswha#3572, devswha#3573 and devswha#3575, as one PR, plus what the review of this branch found on the way. Cut from `925872654`; it merges cleanly into `origin/main` at `c94f52572`. ## The five findings ### 1. A grok pane herdr names no session for keeps what it holds (devswha#3572) `server/agent-tasks.ts`. A grok pane reported with no `agent_session` for one snapshot lost its background count, and the hold of a turn that ended on a task, for about ten seconds. The missing id was read as another session, so the pane was looked up as reported. A grok session is found by its id, so that lookup could only fail, and a failed lookup of "another session" lets the state go at once. herdr naming no session is not another session. A grok pane reported without one is now asked for by the session known for it: - Nothing is looked up while that lookup is recent. - Once it is old, the lookup is a real one of the known id. One that fails is a first miss as any: the count stands, the poll asks again ten seconds on by that id, and two in a row let the pane go. - A pane nothing is known of is asked for as herdr reports it. - The session known is used only when it is grok's own: another agent's id is never what a grok pane is asked for by, nor the key its miss is remembered under. ### 2. A failed lookup is remembered with the session it was of (devswha#3572) `server/agent-tasks.ts`. The memory of a failed lookup was kept per pane and agent. For grok, a miss of one session id held off the snapshot lookup of a newly named other session for the retry interval, and could count as the first of its two misses. The pane's misses are now kept by session, for the agent they were of (grok only: an agy session is found by the pane's process, so its miss still holds whichever id herdr names). Both gates read the same entry: the retry spacing, and the "second miss in a row" that lets a pane go. Each session's miss stays beside the others', so herdr naming a session, then none or another, then the first again asks for each only every ten seconds while none of them is found. **Known limit, left as it is.** A lookup that finds a session drops every miss of the pane. Where herdr names in turn a session that is found and one that is not, every snapshot looks one up and the count is told and let go in turn: ten lookups in ten seconds, where main makes two (and leaves the count at 0). Nothing shows herdr naming two ids in turn for one pane; the observed case (an id, then none) is covered by item 1. The comment on `failed` states the limit and a test pins it. Spacing it would mean keeping the other sessions' misses through a lookup that finds one and reading them for a pane whose session is known, which would also hold a snapshot's lookup of a session the pane really went back to. ### 3. Agy: herdr is asked the second time before the locks are read (devswha#3573) `server/agy-store.ts`, `resolveAgyStore` and `agyFreshSession`. The order was identity, locks, second ask, identity. It is now identity, second ask, locks, identity, so the lock read is the last evidence gathered and still lies inside the start-identity bracket. A second answer that names another process ends the lookup before any lock is read. **What the new order costs.** The second ask is made before it is known what the locks show: | Case | Asks before | Asks now | |---|---|---| | A lookup that answers | 2 | 2 | | A lookup that finds no single conversation lock | 1 | 2 | | A greeting refused because a lock is held | 1 | 2 | | A pane herdr names no single Agy for | 1 | 1 | | An Agy whose start identity cannot be read | 1 | 1 | | A greeting refused by its start arguments | 1 | 1 | `docs/agy-chat.md` describes the new order and these costs, and the unreleased fragment of devswha#3573 (`changelog.d/agy-pane-process-recheck.md`) is reworded to it. ### 4. Letta: no output when the pane moved during the last resolution (devswha#3575) `server/conversation.ts`, the Letta branch of `toolOutput`. After the awaited scan the pane is resolved once more, and that resolution was only compared by its own answer. One begun before a `/new` in the pane still names the conversation the output was read from, so when another read saw the pane on the new conversation meanwhile, the old conversation's output was answered. The final check now also refuses when the binding moved since the lookup resolved it (`|| rebound(paneId, transcript)`). ### 5. Letta: a scan cut by its time limit answers "try again" (devswha#3575) `server/letta.ts`, `server/file-tasks.ts`. A transcript scan stopped by its own 10 s limit answered as "no such call" (404 `output_not_found`), though the call may lie past where it stopped. - `lettaToolOutput` throws `LettaScanCut` when it runs out of time with some of what the transcript held as the scan began still unread. It answers null as before at the end of the file, when all of that was read, and at its 256 MiB cap. - The file thread answers a cut scan as `{ cut: true }` (an error crosses a thread as its message alone), and `lettaToolOutputOffThread` rejects with `FileBusyError` for it. - The route gains no new answer: it is the 503 `file_busy` with `Retry-After` it already gives when no file thread is free. Only which cases get it changes. - The `letta-output` file task takes an optional `budgetMs`, as the documents task does, so a test can run a scan with no time on a real file thread. ## Beyond the five findings **OmO has the window item 4 closes for Letta.** The OmO branch of `toolOutput` resolved the pane a last time and compared only that answer (older code, devswha#3359). The review of this branch reproduced it: the held last resolution answered the old session's output after another read had seen the pane on a new session. The same `|| rebound(paneId, transcript)` is added there, with a test and a changelog fragment of its own. Please treat it as an addition to the five; it is one commit (`7fcbbe6a2`) and can be dropped on its own. ## Tests - `server/agent-tasks.test.ts`: a session-less grok pane keeps its count and is asked for by the session known; a pane known as another agent's, or let go meanwhile, is asked for as reported; a miss holds no lookup of another session off; each session's miss is kept beside the others'; the known limit above. - `server/agy-store.test.ts`: the ask counts of the table above; a stand-in Agy that moves its lock while herdr answers the second time; on Linux the order of the reads (ask, identity, ask, locks, identity), and that the start identity read after the locks is what refuses a pid taken between the second answer and the lock read; a greeting with an unreadable start identity asks once. The order test is Linux only: elsewhere the identity is read through `ps` or a Windows handle. - `server/letta.test.ts`: the pane moved during the last resolution; a scan with no time answers `{ cut: true }` on the file thread and `FileBusyError` on the pane's route, for a call the transcript holds and for one it does not; read to the end, the answers are the output and "not found". - `server/conversation.test.ts`: the OmO pane moved during the last resolution ("old session" before the fix, no output now). ## Changelog `changelog.d/grok-unnamed-session-keeps-count.md`, `letta-tool-output-try-again.md` and `omo-tool-output-pane-moved.md` are new; `agy-pane-process-recheck.md` (devswha#3573, unreleased) is reworded to the new order. ## Validation Run at head `aa59268f9`, with `HERDR_TEST_MODE=unit` and a `TMPDIR` of its own: - `bun test server/agent-tasks.test.ts`: 23 pass - `bun test server/agy-store.test.ts`: 24 pass - `bun test server/conversation.test.ts`: 253 pass - `bun test server/letta.test.ts`: 81 pass - `bun test server/file-pool.test.ts`: 21 pass - `bun test server/core/status.test.ts`: 82 pass - `bun test server/conventions.test.ts`: 14 pass - `bun test scripts/changelog-fold.test.ts`: 12 pass - `bun run typecheck`: clean `bun run check fast` at `aa59268f9`: green (unit 14797 pass, 0 fail; typecheck, build, generated files). Reviewed before opening by an independent agent reviewer in three rounds (one medium and several low findings, all fixed or listed above; the last round: ship). Not run: `bun run check full` and the browser regressions (no `src/` change). Nothing was run on macOS or Windows; the Agy path on macOS is untested natively, as `docs/agy-chat.md` already says. `server/agy-store.ts` is imported by `server/windows-native.test.ts`, so this waits for GitHub's Native Windows job. ## Notes for the merge pass - Item 5 changes which cases of `GET /api/pane/conversation/tool-output` answer 503 instead of 404, so this PR touches an HTTP answer and waits for a real review. - The message of `8c44a2908` gives a wrong reason for the `known?.agent === agent` clause (a saved herdr call). `resolveGrokStore` refuses a session that is not grok's before it asks herdr anything; the clause only keeps another agent's id out of what a grok pane is asked for by and remembered under. `aa59268f9`'s message corrects it; a squash message should not carry the old line. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
… a refusal notice reads the global relay's own refusal (devswha#3599) ## Change Follow-ups to the low findings the merge pass listed on devswha#3576 and devswha#3579, one commit each. No HTTP/WS contract change and no new strings. **1. Adding a PC over SSH: herdr's own socket is offered beside an older Ovis only when no session is named (devswha#3576)** — `server/machines.ts` Adding a PC over SSH that runs an older Ovis, with no runtime of this app there, offers herdr's own socket as a session row built from the socket file. With a session typed in the dialog, that row was the named session's socket. Chosen, the PC was saved with the socket (only the default session's socket is saved as herdr to start), so after that PC restarted its bridge said the session was no longer running instead of starting it by its name. The row is now built only when the dialog names no session (`!session && answered && !listedHere`). A named session connects as it did before the card existed: the approval of what the setup installs, then a bridge started for the session by its name. `server/machine-core-choice.test.ts` ("older peer, no bundle") adds the named session: it reaches the approval with no card, and the bridge is started with the session and no chosen socket. The unreleased changelog entry of devswha#3576 (`changelog.d/ssh-add-pc-default-session-restart.md`) now says the offer is for a dialog that names no session. **2. Before the announced date, a refusal notice needs the global link's own pass refusal (devswha#3579)** — `src/lib/relayNotice.ts` Before the date, the notice over the pane read a refusal from the refused flag beside the global link in error. A regional relay's refusal sets that flag too, and a global link that dropped for the network is in error as well (`relay_unreachable`), so a regional refusal plus a network error showed "add this PC", "PC limit" or "needs an account" for as long as the global link was down. Before the date a refusal is now the global link's own: the flag, the link in error, and an error code that names the pass (`pass_*`). A server from before the codes names none and is read as before. Past the date, and with no date, nothing changes: the flag beside any error still reads as a refusal there. **3. A dismissed not-listed or PC-limit notice stays dismissed while the PC asks the relay again (devswha#3579)** — `src/lib/relayNotice.ts` Before the date, a PC the relay closed for its pass looks again every 30 minutes and whenever a pass comes, and each attempt reads `connecting`. The not-listed and PC-limit notices read "no notice needed" for that window, which `useRelayNotice` takes as the state being over: it removed the stored dismissal, and the notice the user had dismissed showed again after the next refusal. While the refused flag stands and the global link has neither let the PC in nor refused it for its pass (it is connecting, or in error for another reason such as `relay_unreachable` between attempts), the reading is now "not known" (`undefined`) where nothing else shows: no notice, and stored dismissals are kept, as before a first answer. No refusal is read from it, so a regional relay's refusal during a global reconnect still shows none. The link online, with the flag set or cleared, still ends the dismissal, and the sign-in reminder that names the date still shows meanwhile. `src/components/RelayNotice.test.tsx` covers 2 and 3: the flag beside `relay_unreachable`, `server_key_refused` and `start_failed` before the date; every `pass_*` code; the flag beside a network error past the date; and `useRelayNotice` driven through a refusal, its retry and the next refusal for both notices, including a page load that lands in the retry. No changelog fragment for 2 and 3: they correct the before-the-date reading that devswha#3579 added, which is not released, and its fragment (`changelog.d/relay-notice-open-visitor-refusal.md`) still reads true. Nothing visible is designed anew (the notice, its wording and its dismissal are as devswha#3579 left them), so no reference app is named. ### Not in this PR Two low findings from the review of this branch. Both are confirmed, both are older than this branch and devswha#3579, and both are outside the three items above, so they are left for a follow-up. - **A dismissed refusal notice can still come back in two other ways.** (a) "Needs an account" (a PC with no account): after the link's 30-minute look-again reads `connecting`, the reading is the sign-in reminder or nothing, the stored dismissal is removed, and the next refusal shows the notice again. (b) Not-listed and PC-limit: when the account service request made on a refusal fails, `pass.state` reads `unavailable`, the reading is "no notice needed", and the dismissal is removed. Both happen on v0.5.2 with no date. Reproduced with real `RelayService` statuses against an enforcing relay, through `useRelayNotice`. The fix belongs in the hook: keep a refusal's dismissal while the status still carries the refused flag and the link is not online. That changes what a dismissal means in released behaviour, so it gets its own PR and changelog entry. - **The relay status line in Settings (`statusText`, `src/components/RelayPanel.tsx`) still reads the refused flag beside any error as a refusal.** With a regional relay's refusal and the global link down for the network before the date, it says "Add this PC to your Ovis account…" while the notice over the pane now says nothing. Before this PR both said it. `RelayPanel.tsx` is unchanged since v0.5.2. The follow-up has to share the notice's date rule with `statusText`: the code rule alone would make the two disagree past the date instead. ## Validation At `c8c0d0656`, with `TMPDIR=$HOME/.cache/ovis-tmp/fu-b HERDR_TEST_MODE=unit`: - `bun test src/components/RelayNotice.test.tsx`: 26 pass - `bun test src/components/RelayPanel.test.ts`: 1 pass - `bun test server/machine-core-choice.test.ts`: 44 pass - `bun test scripts/changelog-fold.test.ts`: 12 pass - `bun test src/conventions.test.ts`: 10 pass - `bun test server/conventions.test.ts`: 14 pass - `bun run typecheck`: exit 0 `bun run check fast` at `c8c0d0656`: green (unit 14796 pass, 0 fail; typecheck, build, generated files). Browser, on the host (not in the CI runner image; this PR's CI runs it there): `scripts/relay-direct-demo-regression.ts` passed (6 checks, the grace and data-limit notices included). Reviewed before opening by an independent agent reviewer: ship, with the two low findings listed under "Not in this PR". Not run: `bun run check full`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
… its button and copies as two lines (devswha#3589) ## Change Follow-ups from the review of devswha#3450 (the Codex visualization reference card), four small items: - **Any mode draws the card.** A reference whose `mode` was not `"wide"` stayed raw reference text, and `wide` was never used. `mode` is no longer read, so every mode draws the same card, also one this app has never seen. `wide` is gone from `VisualizationReference`. - **Each button names its file.** Several cards carry the same words, "Open preview". Each button is now described by its own card's file name (`aria-describedby`). - **A copied selection of a card is two lines.** Measured in Chrome on `main`: the plain text of a selection took the button's words ("…\nOpen preview"), and the chat's rich copy ran the name and the title together, since `lib/markdownClipboard.ts` keeps no line for a span. The button is now `user-select: none`, and a `<br hidden>` between the two keeps them apart in the rich copy. The page draws nothing new. - **Wording.** DESIGN.md and the component comment said a press always lands in a dialog that holds the focus. With **Show beside the pane** the viewer is a panel beside the pane, where the rest of the app stays in reach. Both say so now. No server change. ## Validation - `bun run check fast` passed at 1314146: 14797 pass, 0 fail. - `bun scripts/chat-visualization-browser-qa.ts` passed three times on fresh builds. New in it: the button's description is the file's name, the button is not selectable, the chat's copy of a card is `name\ntitle` as plain text and `name<br>title` as rich text, and a reference with `mode: "split"` draws its card. - `shared/visualization.test.ts`: every mode, a known one, an unknown one and a non-string, gives the same reference and block. It fails on `main`, where an unknown mode is no reference. - `src/components/Visualization.test.tsx`: the button's `aria-describedby` points at the name alone, and the hidden break sits between the name and the title. It fails on `main`. - Not run: the integration suite and the other browser regressions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <[email protected]>
…t it (needs owner OK) (devswha#3585) ## Why Follow-up to devswha#3567, from the merge pass's review of it (its third note). On the self-hosted runner the jobs of one CI run share the client build: the first job to build hands `dist/` to the launcher under a key, and the launcher takes it into the cache when GitHub confirms that the slot runs a job of a trusted run (a push to `main`, or a pull request the writer login opened, at its head). It never checked that the **key** was that run's. The key is a hash the job computes itself; it is only the job's word for what it built. So a trusted pull request's run (agents open PRs as the maintainer account, and CI runs before review) could hand in a build under the key of a new commit of `main` before main's own run builds it. Main's Integration and Browser jobs would then restore and test that `dist/`. Since devswha#3567 a release can be validated by main's run, so that build could stand behind a release too. ## What **An entry belongs to the run that wrote it.** - The launcher's promoter (`scripts/self-hosted-runner/build-cache-promote.sh`) files an admitted build as `entries/<run id>/<key>`, under the run GitHub confirmed for the slot. The run's directory is made by the promoter, must be a real directory of its own user, and is never followed through a link. - A job (`scripts/build-cache.ts`) reads, waits and checks "stored" only under `<cache>/<GITHUB_RUN_ID>/`. With no usable run id it builds without the cache. - The lock carries the run too (`.lock-<key>-<run id>`): another run of the same commit reads other entries, so waiting for its build gains nothing. A waiting job waits for one job's build, not for a chain of them. - Eviction walks the runs' directories, keeps the most recently used entries of all runs within the limit, and removes a run's directory once it is empty. - What a launcher from before filed by the key alone (`entries/<key>`) is removed in the new launcher's first pass: a job of a commit from before would still read it there, whichever run had filed it. - A cache of one's own (no outbox) is unchanged. Sharing between runs was never the purpose: the jobs of one run are. A rerun keeps its run id. ## The launcher is an installed copy `build-cache.ts` comes with the commit a run checks out; the promoter is the copy installed on each runner host, updated by hand. While the two differ, both directions end in "no hit, every job builds", measured with the real scripts of each side (4 jobs of one run, a 2 s build, 0.3 s per GitHub answer): | Jobs | Launcher | Seconds per job | Builds | | |---|---|---|---|---| | new | new | 3.3 / 3.3 / 3.3 / 3.2 | 1 | the cache hits | | new | old | 3.3 / 6.5 / 6.5 / 6.5 | 4 | from this merge until the installed copy is updated | | old | new | 3.4 / 6.6 / 9.8 / 12.7 | 4 | reruns of runs from before, runs in flight at the update | No wait runs out, nothing fails, and nothing wrong is restored. Main's runs are safe from the merge on, whichever launcher is installed: a job of the new code never reads where the old launcher files. **After the merge the owner updates the installed launcher** on every host whose launcher runs with `--build-cache`: copy `scripts/self-hosted-runner/` over `~/.local/share/ovis-ci-runner` by rename (`rsync -a` does; the promoter is started from that directory every second) and restart the unit, as the README says. Merge first, then update: the other order makes the jobs of every run in flight build one after another. Until then every job builds (about one build later than with no cache) and the job log says `was not filed under this run but by its key alone`; this PR's own CI run will show that line. I did not touch the installed copy or the running runners. ## Proof - **The attack is a test** (`scripts/build-cache.test.ts`, "never restores, in main's run, a build that a pull request's run handed in under the key of main's commit"): run 200, a trusted pull request's, hands in a build under the key main's run 100 then looks for; main's job does not restore it and builds its own. Against `main`'s two scripts that test fails: main's job restores the pull request's build without building (13 of the 48 tests fail there). - An independent review agent tried to break it: 16 spellings of main's run id in a claim from a pull request's slot (`0100`, `+100`, `0x64`, `1e2`, `100/../100`, twenty digits, ...) against a stand-in GitHub that reads run ids leniently filed nothing under main's run; FIFOs, links and directories as claim, tar and marker wrote nothing outside `entries/`. Its verdict was ready, with three notes, all in this head: the removal of the old flat entries, the log line that blamed an old launcher (true only with one now), and "every runner host" in the docs. - 19 mutations, each caught: the reader looking by the key alone again; the promoter filing by the key alone; a run directory trusted through a link; eviction following a linked run directory or leaving empty ones; any string accepted as a run; the lock without the run; "already there" or "stored" tested by the key alone; the old flat entries left in place; and others. ## Validation - `bun run check fast`: pass on this head (14784 unit tests pass, 0 fail). - `bun test scripts/build-cache.test.ts scripts/self-hosted-runner.test.ts`: 48 and 53 pass. `bash -n` on both shell scripts; shellcheck is not installed here. - Both transition directions run end to end with `main`'s scripts against these. - **Not run:** real GitHub answers, Docker mounts, the installed launcher and live runners (not to be touched). The first CI run after the launcher is updated is that proof: its jobs log `hit <key>` after the first one's `stored`. - Skipped: integration and browser suites. ## Not in this PR - The slot is tied to the run by the runner's name, as before. In 1,114 self-hosted jobs sampled, no two runs' jobs overlapped on one runner name; each registration also has its own `runner_id` should a tighter check be wanted. - The other two notes of that review are devswha#3580. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
…evswha#3173) ## Change When an interactive socket disconnects or reloads while a queued follow-up message is still waiting (`state: "queued"` and `!item.inFlight`, or an in-flight attempt fails before typing), `PendingInputs.hold` transitions the server's record to `"held"` (`reason: "owner_disconnected"`). However: 1. On connection close (`end(client, "closed")`), `state.closing = true` is already set before `pending.close(client)` runs, so the owner socket never receives that `"held"` transition frame. 2. On the client (`PendingMessageStore`), `suspend()` and `restored()` conservatively convert any `"queued"` or `"sending"` row to `"uncertain"` (`serverOwned: false`) because the browser alone cannot know whether the server began typing before the socket dropped. As a result, when a mobile or desktop browser loses its WebSocket connection while a follow-up is sitting in the queue (`Will send when ready`), reconnecting leaves the saved copy stuck in `"uncertain"` (`"Not confirmed. Check the terminal before sending again."`) with no **Send now** button, even though the server knows nothing was ever typed. This change extends the existing resumable follow-up receipt mechanism (`devswha#2421`, bounded to 10 minutes / 1024 entries / matching `deviceId` + `receipt_resume_id`) with `outcome: "held"`: - When a follow-up with a `resumeKey` transitions to `"held"`, `keepReceipts` records `{ outcome: "held", resumed: true }` in `completed` (and pushes it to any already-attached successor with the same `resumeKey`). - If the held copy later leaves `"held"` (`"sending"`, `"uncertain"`) or is settled (`"sent"`, `"discarded"`, `"dismissed"`), including via `resend_id` after the 60s closed-owner retention window expires, the `"held"` receipt is superseded or removed so a later reconnect cannot overwrite a newer state. - On the client (`PendingMessageStore`), receiving `{ id, outcome: "held", resumed: true }` (either after snapshot lifetime proof or before it via `earlyResumedReceipts`) transitions a non-authoritative saved copy (`!serverOwned`, unproved, `!piReceipt`, `!resendInFlight`, `!unconfirmed`) from `"uncertain"` to `"held"` and persists `state: "held"` to storage, restoring **Held message — review and send** and **`↑ Send now`**. ## Validation - `bun scripts/typecheck.ts` — passed - `bun run build` — passed - `bun test src/lib/pendingMessages.test.ts` — passed (43/43, including new unit test for recovering a disconnected queued message as `"held"` without rearming an in-flight resend or unconfirmed copy) - `bun test src/lib/machineSession.test.ts` — passed (30/30, including early resumed `"held"` receipt settlement after snapshot lifetime proof) - `bun test server/core/pending.test.ts` — passed (59/59, including 11-case parameterized suite covering `held on close`, `overlapping reload`, `held after reattach`, `wrong browser`, `wrong device`, `read-only`, `revoked`, `owner revoked`, `expired`, `resent after closed-owner expiry`, and `ambiguous resend after closed-owner expiry`) - `bun test server/pending-input.contract.test.ts` — passed (115/115, including contract test verifying end-to-end WebSocket replay of a `"held"` receipt on reconnect without typing again) --- ## Maintainer update (behaviour change, accepted by the maintainer) This PR now follows a stricter rule for held messages than v0.5.1: - A held copy offers **Send now** only on live proof: its own live connection, or the bridge's held receipt for this browser within the receipt's ten-minute window. It is never sent automatically. - A **saved** held copy (after a reload, in another tab, after the connection that held it ended, or one an older release saved) shows as uncertain ("Not confirmed. Check the terminal before sending again.", Copy and Discard only) until such a receipt proves it again. - Consequence, deliberate: a held copy on a remote PC (its relay strips the resume ID), after an Ovis server restart or update, past the ten minutes, or one held for another reason (for example `pending_turn_unconfirmed`) once its connection is gone, no longer offers Send now. DESIGN.md says so. - Wire: held receipt frames carry `held` (IDs), `held_ms` (time the bridge still keeps each, 0 < ms <= 600000) and `held_until` (its end on the PC's clock); the `features` frame carries `server_time`. All are optional, and clients that predate them ignore them. The page holds a copy until the sooner of arrival + `held_ms` and `held_until` on its own clock. - A resend checks and claims its receipt inside the pane's serialized turn by the original ID, for its own pane and browser, so concurrent resends type once. ## Validation (maintainer, head 3c361ab) - `bun run check fast`, plus `server/core/pending.test.ts`, `server/pending-input.test.ts`, `src/lib/pendingMessages.test.ts`, `src/lib/machineSession.test.ts` and `server/pending-input.contract.test.ts`. - In the CI runner image (`herdr-ci-runner:local`), on a freshly installed and built clone: - pass: pending-pane-switch-regression (proven lost connection and reload; unproven other browser, expired receipt, ambiguous send, proven on another page, page left open past the window), chat-local-send-follow-demo-regression, chat-size-regression, composer-fit-demo-regression, restored-draft-demo-regression, terminal-autoswitch-demo-regression, terminal-paste-insert-demo-regression, new-session-skills-browser-qa; - ui-regression: passes its pending step, then stops locally at the New workspace folder browser, which fails the same way on v0.5.1 in that image; - machines-browser-qa: not run, it needs an SSH fixture and is not part of CI. --- ## Maintainer update 2 (owner's call, head b2799bf) A hold the person made on purpose is exempt from the rule above: - **Exempt:** a message held at its sender's request (`delivery: "hold"`: Alt+Enter, devswha#3463, or a follow-up with automatic sending off). It stays held, with Send now, through a lost connection, a reload, another tab and a restart or update of the server, as on `main`, and takes no receipt's ten-minute end. Only a Send now that may have typed it makes it uncertain. - **Still under the rule:** an untyped queued follow-up held as its connection closed, and a copy the bridge held for a reason of its own. Saved, these are uncertain until the bridge's held receipt proves them again. - **How the page tells them apart:** the bridge holds a requested hold with no reason and names a reason for every hold of its own. The page keeps that as a mark on the saved copy. There is no wire change. Validation at b2799bf: `bun run check fast` (14736 pass, 0 fail) and `composer-fit-demo-regression`; at 274ceb8, before `main` was merged in again: `server/pending-input.contract.test.ts` (123 pass), `pending-pane-switch-regression` and `restored-draft-demo-regression`. Not run locally: `chat-size-regression`, `ui-regression` and the rest of the browser lane. ## Maintainer update 3 (head 3922dcb) - A receipt's proof ends with the connection that brought it, and only that one: on a page that shows several PCs, one PC's disconnect no longer takes Send now from another PC's held copy. - A tab still on an older bundle, which saves the list without the request mark, no longer turns a requested hold uncertain in an updated tab. - A connection that may not resume when it closes (read-only, revoked) still leaves the `sent` receipt of a send that ends after the close. - The changelog has a `### Changed` entry for the deliberate change described in the first maintainer update. Validation at 3922dcb: `bun run check fast` (14758 pass, 0 fail), `server/pending-input.contract.test.ts` (123 pass), `pending-pane-switch-regression` and `composer-fit-demo-regression`. Not run locally: `chat-size-regression`, `restored-draft-demo-regression`, `ui-regression` and the rest of the browser lane. ## Maintainer update 4 (head bcdfdfa) - A `sent` receipt is never dropped before its ten minutes, however many other receipts follow: a copy another tab still holds on a held receipt is not typed again. - Corrections to the text above: the ten minutes run from when the bridge held the copy as its connection closed; a remote PC on this version does replay the held receipt for a controlling browser (the relay scopes the resume ID, it does not strip it); a reload or another tab of the same browser inside the window shows the copy held. What loses Send now is the end of the ten minutes, a restart or update of this server or the PC's, a remote PC on an older version, and a watch-only attach. Validation at bcdfdfa: `bun run check fast` (14838 pass, 0 fail) and `server/pending-input.contract.test.ts` (123 pass). The browser regressions were not run locally this round. --------- Co-authored-by: Jimbb <[email protected]> Co-authored-by: devswha <[email protected]> Co-authored-by: devswha <[email protected]> Co-authored-by: Claude Fable 5.2 <[email protected]>
…fter its request was shown (devswha#3581) ## What Follow-up of devswha#3539 (`ovis add` / `login` / `link`, `scripts/plugin-link.ts`). It closes what the reviews of devswha#3539 left open, and what the reviews of this branch then found: - **An approval carries the request's digits.** The terminal no longer asks y/N. The question shows the device's six digits and asks for them: `{label} wants to join your account. Approve it only if its screen shows 123 456. Type 456 to approve, or press Enter to decline: `. All six digits (with or without the space) or the last three approve; anything else declines, a bare Enter and `y` among them (`y` gets "Declined: only a request's digits approve it, not y."). `pair --approve` asks the same way. - A line answers a request only when it was typed after that request's question, with its six digits, was on the screen. A line typed ahead, while nothing is asked, or twice is dropped with a line saying so. - The first line the terminal hands over after a request left the screen unanswered answers nothing (what was typed at that request and not sent would otherwise arrive under the next one). - Input that is not a terminal (`yes | ovis add`, a pipe that writes later, a file, a closed stdin, `ssh` without `-t`) approves nothing, whenever its lines come, and the message names the way out. - `pending.listing` (a listing a renewal took away) is put back while the PC is enrolling too. - The run's last approval window and last listing no longer depend on the next look being as fast as the last one. - The multi-run timing tests have their own timeouts. ## How Three guards on an approval, each with tests that fail without it: - **Digits** (`approves(line, digits)`, exported with `approvalPrompt` and `declinedNote`, used by `link` and by `pair --approve` in `scripts/plugin.ts`): whitespace is removed, then the line must equal the six digits or their last three. Digits that are not exactly six ASCII digits are approved by nothing, and the question then asks for none. - **One-shot drop** (`held`): when a request whose prompt was shown leaves the list unanswered (it ran out, was answered elsewhere, the server restarted), lines already handed over are dropped ("no request is waiting"), and then the next line handed over is dropped too, whenever it comes and whatever it says: "That line answered nothing: a request went away while it may have been typed. Answer again for the request shown now." The prompt is printed again and the line typed under that counts. The cost: the answer to a request that follows one that went away is typed twice. - **Dwell** (`DWELL_MS`, 1.5 s): a line that comes sooner after a prompt first showed is dropped ("too soon to have compared its digits"). It covers a key pressed twice and a second line typed right after an answer. Unchanged from the earlier commits: - **One read for the whole wait** (`typing()`): lines are taken as they come and stamped with the request whose prompt was on the screen (`under`) and the time (`at`). Nothing is ever kept for a later request. - **`terminal` option** (`LinkOptions.terminal`, `scripts/plugin.ts` passes `process.stdin.isTTY === true`): anything else is never read; the command says "This is not run in a terminal, … (over ssh, run ssh -t)." once and declines every request as it shows. Unset counts as not a terminal. - **End of input and read errors**: a terminal whose input ends (Ctrl+D) is said to have, when it does, and declines from then on; a read that fails ends the run then. Ctrl+C sends no answer. - **The read starts after the PC is listed** and the "Signed in…" lines are out. - **Last window**: every look in the last 30 s in which a window may be opened (`LAST_MS`) asks for it, and the first of them lists the PC anew. - Test harness: `keyboard()` queues lines as a terminal does, the test clock passes time during a wait, `answer()` in `prompting` types after the next wait (2 s). `prompting` takes `request: (id) => ({ label?, digits? })`; by default every request shows 111 222, so a line begun for one would approve the next unless the drop or the dwell stops it. ## Review Review of 80eaa66 (two reviewers, both BLOCK): see the comment "Review of 80eaa66: findings and resolution". In short: the HIGH (a line begun at a request that went away approved the next one when its Enter came 1.5 s or more after the next prompt) is fixed by the one-shot drop and by the digits answer; both LOWs are fixed. Review of 9c8aa71: 1. **Medium: input that is not a terminal can still approve.** Fixed with the `terminal` option. 2. **Medium: a second line typed after an answer can approve the next request unseen.** Fixed by the dwell (and now the digits). 3. **Low: the taint never expires.** The taint of the first commit is gone. The one-shot drop that came back for the HIGH above lasts for one line by design: a held line can come at any time. 4. **Low: end of input while nothing is asked silently declines everything; a read error is held until the next prompt.** Both are said or thrown when they happen. 5. **Low (a): the read starts before the PC is listed.** It starts after the "Signed in…" block. **Low (b): one look longer than 30 s steps over the last margin.** Accepted and stated (the `LAST_MS` comment and docs/relay.md). ## Validation - `bun test scripts/plugin-link.test.ts`: 66 pass. - Mutations, each run against the test file: the one-shot drop removed (6 tests fail), `DWELL_MS = 0` (2 fail), the `terminal` option ignored (2 fail, the one the review named among them), `y` approving again (1 fails), the six-digit check removed (1 fails), the flush before the drop removed (1 fails). The reviewers' case ("y" held at p1, Enter 2 s after p2's prompt) fails on 80eaa66's `plugin-link.ts`. - `bun run check fast` through `dori heavy` on the pushed head a01e278, which has `origin/main` 4fb64e6 merged in: every line ok (workflow syntax, generated types, generated themes, typecheck, build, unit tests: 15035 pass, 0 fail, 51 skip in 887 files). - Not run: a real terminal (no pty run of `ovis add` or `pair --approve`; `process.stdin.isTTY` and the `pair --approve` prompt in `scripts/plugin.ts` are covered by no test of their own, only through the shared helpers), a real phone or account service, `bun run check full`, browser regressions, and GitHub-only jobs (Windows, macOS). Needs a real review: it changes what `ovis add` and `pair --approve` take as approval of a device (authentication). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
…devswha#3605) ## Why `scripts/check.test.ts` "slots > takes over a marker whose run has exited but is not reaped yet" failed two local merge gates (devswha#3281, devswha#3570) after five seconds: `the parent did not hear its child exit within 5000 ms PID 1506`. It is not slow under load: it takes 25 to 80 ms when it passes, and when it fails it waits for a word that never comes. The fixture is a perl parent that forks a child, lets it exit without reaping it, and prints `ZOMBIE` from its `SIGCHLD` handler; then it waits in `pause()`. Perl does not run a handler when the signal arrives: it notes the signal and runs the handler at its next look for signals, between statements. A `SIGCHLD` that lands after the last look and before `pause()` is noted and not acted on, and `pause()` then waits for a signal that has already come. The child exits about as long after the fork as the parent takes to print its pid and reach `pause()`, so the two meet. ## What The parent blocks `SIGCHLD` before the fork and waits with `sigsuspend()`, which lets the signal in and waits in one step: a signal that came early is still pending when the wait begins. Test-only, one line of perl. No assertion, wait or timeout changed. ## Proof | Run | Result | |---|---| | `main`'s fixture, 3000 runs, 12 at once on 12 CPUs, unforced (CI runner image, perl 5.38.2) | 5 printed the pid and never `ZOMBIE`; in all 5 the child was a zombie by then | | the new fixture, the same 3000 runs | 0 | | the new fixture, 12000 runs | 0 | | `main`'s test with the gap between the last look for signals and `pause()` made long (the same statement builds a 30-million-item list first; scratch patch) | fails after 5 s, `0 pass, 1 fail` | | this branch's test with the same gap before `sigsuspend()` | passes (200 ms) | In the forced run Bun's own five-second limit ended the test a moment before the fixture's (`this test timed out after 5000ms`); in the gate the fixture's limit came first. Both wait for the same missing word. That the gate's child had exited is not in its log (the test stops before it reads the child's state); in the unforced misses here it had. ## Validation - `bun run check fast`: pass on this head (15146 unit tests pass, 0 fail). - `bun test ./scripts/check.test.ts -t "takes over a marker whose run has exited"`: 3 of 3 on this PC (perl 5.40.1), 1 of 1 in the CI runner image. - Skipped: `bun run check full`, the integration and browser suites (one unit test changed, no product code). No changelog fragment: nothing a user notices. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <[email protected]>
…o IME typing keeps up (devswha#3596) ## Change Refs devswha#3594. Typing Korean at a normal speed in the terminal made the composing syllable lag behind and kept the main thread busy (40–55% of a core in Edge, 70% of it style recalc). The largest source was `fitView` in `src/lib/terminalGlyphs.ts` (devswha#938): xterm rewrites the composition view several times per IME key (its text, place and font), and on each rewrite `fitView` wrote a run of the glyph into xterm's `.xterm-char-measure-element` and read `offsetWidth`, forcing a style recalc of the whole page every time. The fit only depends on the glyph, the font (weight, size, family) and the cell width, so it is now measured once for each of those and cached. The cache is cleared together with the glyph widths when a late face arrives (`followLateFaces`), so a glyph first measured in a stand-in face is measured again in its own. What `fitView` writes to the box is unchanged. Measured on the 0.5.2 bundle with the same change applied: - headless Chromium, 29 Korean syllables at 120 ms/key through CDP `Input.imeSetComposition`: style recalc ~480 ms → ~205 ms, main thread 16% → 11–12%; the box gets the same `font-size`, `letter-spacing`, `padding-left`, `transform` and width as before at every step (ㅎ, 하, 한, 가, 나, W) - Edge on Windows, a Korean sentence at ~500 keystrokes/min: 40–55% → 10–20% CPU, Layouts/Style recalcs 150–250/s → 80–100/s, and the composing syllable keeps up with the cursor The other costs listed in devswha#3594 (the composition box's `getBoundingClientRect` in the xterm patch, the per-syllable `setComposing` re-render) are left for separate changes. ## Validation - `bun test src/lib/terminalGlyphs.test.ts`: 36 pass. The new "measures a composing syllable once for its glyph and font" test fails on main (5 measures instead of 3); the late-face test guards that the cache is cleared. - `bun run check fast`: workflow syntax, generated types, generated themes, typecheck and build pass. Unit tests: 164 failures, all in `server/copilot.test.ts`, `server/codex-processes.test.ts`, `server/usage-login-outcome.test.ts` and `server/usage-account-list.test.ts`, which fail the same way on unmodified `main` on this machine (Volta has no Node for their fixtures); nothing else fails. - Browser regressions on this branch's build, on the isolated test herdr: `scripts/terminal-composition-regression.ts`, `scripts/terminal-ipad-ime-regression.ts` (with `CHROME_PATH` set to Playwright's Chromium) and `scripts/terminal-linux-ime-regression.ts` pass. - Skipped: `bun run check full`, and the Safari/macOS IME checks (no Mac here). --------- Co-authored-by: devswha <[email protected]> Co-authored-by: Claude Fable 5.2 <[email protected]>
…hree more cases (devswha#3262) (devswha#3582) Supersedes devswha#3558, devswha#3559 and devswha#3560. All three change `server/codex.ts` and `server/codex.test.ts`, conflict with each other pairwise, and were each blocked in review. This is one branch from `main` with the three commits of @vibewriter-hand cherry-picked (authorship kept), their conflicts resolved, and maintainer commits on top that fix every review finding. Thank you, @vibewriter-hand: the three cases, the fail-closed direction and the fixtures are yours, and the write-up in devswha#3262 made the reproductions quick. Refs devswha#3262. ## What it does A Codex pane herdr reports no thread for is tied to its conversation only by its screen. Three screens never were: 1. **The last answer is longer than the screen, or holds a code block** (`footedTailTranscript`). The block that ends right above the footer of the last finished turn is compared with a candidate's last finished answer, without its code fences: the whole answer under its `•`, or, from the very top of the read, the end of an answer whose start scrolled off. 2. **The last answer is a short word** (`footedShortTranscript`). The last finished turn on screen (prompt, answer, footer, idle composer) ties the one candidate whose last finished turn was asked exactly that prompt and answered exactly that text. 3. **A second Codex starts in the pane's folder.** Its thread is made at once, and while it was asked nothing it took the match from a pane next to it. A thread that was only started (read whole, no turn recorded) no longer raises a doubt about a turn a screen shows finished, in `matchCodexTranscript`'s footed turn or in the two paths above. Nothing cases 1 and 2 find is remembered as a binding: the screen is asked again on every lookup, as for main's own short answers. A long answer's binding is kept through later turns as before. `matchCodexTranscript` is asked first and the new paths only after it returns null. Part of it moved into `footedTurnOwner` and `idleTurnFooter` unchanged. One thing in it changed on purpose: `footedAnswer` no longer takes a prompt to end at its first blank row (see the last review below). ## Review findings of the three PRs, each reproduced first Every HIGH and MEDIUM was reproduced on its PR head with a test through `codexTranscriptPath` (the fake-herdr harness of `server/codex-processes.test.ts`) that states the correct behaviour and failed there. Nothing failed to reproduce. Those tests are now in that file. ### devswha#3558 (head c065cc2) | Finding | On the head | Now | | --- | --- | --- | | HIGH: a prompt that quotes another conversation's answer binds that conversation | reproduced: `codex resume <B>` returned A, a fresh pane returned A, and A was kept on the next read | Only the one block that ends right above the footer counts, never a prompt, a queued message, a tool's call or its output. The pane is answered its own conversation (case 2), or none when its own is no candidate. | | HIGH: a tool's output (`cat`) that shows another conversation's answer binds it | reproduced | same rule | | MEDIUM/HIGH: an earlier Codex's turn above the header binds the Codex started since | reproduced, idle and with a first turn under way | Read from the last header on; the footer must be the last turn's, with the composer idle below it. | | HIGH: letters and digits alone take `a \|\| b` for `a && b` | reproduced, as a code block and as prose; `endsWith` plus the header slice alone did not fix it | Compared character for character but for wrapping. The whole visible block must be the answer (or its end), not 160 letters somewhere in it. | | MEDIUM: the six tests never reach `codexTranscriptPath` | confirmed: all six pass with the wiring removed | End-to-end tests for the positive and every negative; the unit tests stay for the matcher's details. | | LOW: the thread herdr reported may own a footer | not run | Only this folder's threads may own (`matchCodexTranscript`'s own rule). | | LOW: every unmatched read parses every candidate's finished answers | not run | See the last review's performance finding below. | ### devswha#3559 (head ffe1f20) | Finding | On the head | Now | | --- | --- | --- | | HIGH: `[ok](/tmp/proj/a)`, drawn `ok (a)`, binds the conversation that recorded `ok (a)` | reproduced | A candidate whose latest turn was asked the prompt shown keeps any other from owning the turn (`footedTurnOwner`, `matchCodexTranscript`'s own rule). An answer Codex renders its own way is not read by this path. | | HIGH: a paragraph shaped like a hook row is dropped from the answer, and another `ok` binds | reproduced | same rule: the conversation that gave the longer answer was asked the prompt shown | | HIGH: a candidate with no `task_complete` yet is skipped, and another `ok` binds | reproduced | same rule: an unfinished turn that was asked the prompt shown counts against the match | | MEDIUM: more than 32 threads, a missing or unreadable rollout, a fork whose chain is gone, a read cut by 1 MiB | reproduced, each | Offered only while every interactive thread of the folder is a candidate and was read. A read that shows no prompt at all counts as asked, unless it is a thread that was only started. | | MEDIUM: a prompt or an answer wrapped inside a word never binds | reproduced; a two-row answer wrapped at a space never bound either | Rows are compared as the screen wrapped them (`completedRowsMatch`), punctuation kept. | ### devswha#3560 (head 7c9afe2) | Finding | On the head | Now | | --- | --- | --- | | MEDIUM: the proof is lost when the matched answer scrolls away | reproduced | No screen is remembered any more (see the last review). The pane's short last turn is proven again on each lookup: beside a second Codex that was asked nothing it holds; beside one that ended on the same exchange the terminal stands in. | | MEDIUM: the guard uses the screen read before the other panes were read | reproduced: the old conversation came back after `/new`; base returned null, so this was a regression | The guard is gone with the remembered screen. The one read that still comes after the screen (the loaded threads) is followed by a second read of the pane and its processes. | ## An adversarial review of the rework, before it was opened A separate reviewer was given the first maintainer commit and asked to produce wrong binds, then each fix in turn. What it reproduced is fixed, and its scenarios are tests now: | Finding | Now | | --- | --- | | HIGH: a conversation of another folder that ended on the same answer was weighed only by the letters its read holds, a fence's language among them (` ```bash `), which the screen does not show: this folder's conversation bound alone. A pane started with `codex resume <id>` of another folder got this folder's conversation, where `main` answers its own. | Every candidate that ended on the answer counts, whoever may own it; other reads are searched as Codex draws them too; the thread the command line resumed is a candidate, and no last turn ties a pane while the store cannot show that thread. | | HIGH: a last turn's match was remembered like a long answer's, so after `/resume` in the same TUI (no new thread) the pane kept the conversation it left. Keeping it only while that conversation's next turn ran still answered the conversation a pane had left, two more ways. | Never remembered. | | MEDIUM: a fork whose earlier rollout was not found bound its parent through the tail path | The end of a long answer ties nothing beside a candidate that continues a rollout which was not found. | | LOW: a lock folder that cannot be listed rejected the lookup | The loaded threads are read inside the path's own `try`. | ## The merge pass's review of d43d2b9 Each with a test through `codexTranscriptPath` that failed on d43d2b9: | Finding | Now | | --- | --- | | HIGH (Codex): an unchanged screen kept a conversation after a resume in the same TUI drew the very same rows (another conversation that ended on the same exchange, in the same minute) | Reproduced with the second thread begun before and after the pane was tied. No screen and nothing a last turn ties is remembered: every lookup weighs the screen against what the store holds then. Case 3 is no longer "the screen stands" but "a thread that was only started raises no doubt". | | MEDIUM (Codex): the pane moved while the loaded threads were read, and the stale match was returned | Reproduced by redrawing the pane during the lock-folder read. The pane and its processes are read again after that scan, and a difference answers nothing. | | MEDIUM (Claude): `footedAnswer` read a prompt to its first blank row, so a conversation asked only the first paragraph owned the turn of one asked all of it whose finish was not written yet | Reproduced for a short answer and, on `main`'s own footed turn, for a long one; with the blank row empty and drawn as spaces. Nothing on screen tells where a prompt ends, so every row it may end on is a reading of it, and a conversation asked any of them counts, as the turn's owner or against one. (Reading the whole cell alone came first, and my own reviewer broke it: a code block the assistant printed under the prompt, which has no bullet either, read as asked.) Several possible owners leave the terminal standing in; a turn asked a prompt of several paragraphs now ties its own conversation. | | MEDIUM (Claude): where the loaded threads cannot be read, the end of a long answer bound this folder's conversation by elimination | Reproduced with a lock held by a process whose files cannot be listed. Neither path ties anything there: always on Windows, with more than 32 threads loaded, or with a loaded thread whose rollout or earlier rollout is missing. | | MEDIUM (Claude): a lookup that could not bind scanned every candidate's read again every 2 s, twice | One pass over the folder's, the resumed and the loaded threads. A turn under way is asked of every candidate before any read is searched. What was found in a read is kept while that read stands (told by its length and hash, since the read itself is what was weighed). The lookup's answer, a tie as well as a refusal, is kept for the very same question: the screen, the processes and every read it weighed (it is no binding: one read that grew, or one thread loaded or unloaded, and it is weighed again). Measured through `codexTranscriptPath`, the oldest thread mid-turn, five lookups each: with 8 threads of 1.1 MiB, 151 ms then 67 to 77 ms (d43d2b9: 280 to 366 ms; `main`: 67 to 92 ms); with 24 threads, 337 ms then 209 to 253 ms (d43d2b9: 948 to 1025 ms; `main`: 192 to 247 ms). | | LOW (Claude): case 1 ties nothing while any loaded Codex thread, in any folder, has a turn under way | Stated as a limit, below. A loaded thread of another folder may be the one a resume through the picker put on this pane, and Codex writes an answer only once it is complete, so it cannot be told from a pane whose finish is not written yet without a clock. | ## The merge pass's second review, of bbfb40c Each with a test through `codexTranscriptPath` that failed on bbfb40c (six failed there): | Finding | Now | | --- | --- | | MEDIUM (Claude): the tail path ignored the prompt on screen. The pane's own answer held a local link, which Codex draws as its label and the target relative to the folder; another conversation ended on that drawn text (an orchestrator that read the pane and relayed it) and bound, with the pane's own prompt on screen or with the answer's start scrolled off | Reproduced in both shapes. Where the answer's `•` row is on screen with its prompt above it, the conversation must own the turn as `footedTurnOwner` tells: asked one of the readings of that prompt, and no other candidate asked any of them. And what a conversation may have said is searched more widely (`saidAnywhere`): any 48 letters of the last 160 shown count, not only all of them, and once more without what Codex draws another way (parenthesized stretches such as a link's target, named entities, task marks, tags, fence lines, digits and case, left out on both sides). So the pane's own answer counts against the one that relayed it. My own reviewer then broke three narrower versions of this search (a list Codex numbers itself; an entity that is a letter; rows of figures that leave no letters to look for, where the path now ties nothing), which is why it is this wide. It is on the side of doubt only: what ties a pane is still the one conversation whose last answer is the text shown, character for character. | | MEDIUM (Codex): a read cut by its budget ignored the record it began in, so an answer or a tool's output longer than the read did not count against the conversation that fit | Reproduced for an answer and for a tool's output of 1.1 MB. `readRange` drops a cut first line; the last-turn lookup now reads that record back (`historyTailWithLead`) and weighs it for all it holds, as it does any line that is no record (one being written). | | LOW (Claude): a turn begun before the read, with no message since and its finish not written, did not count as under way | Reproduced. A candidate whose read records nothing of a turn and is not known whole counts as under way. | | LOW (Claude): a short-answer screen beside a thread at work scanned every read again, 2 to 3 times as long as `main` | What each scan finds in a read is kept while that read stands, and `footedTurnOwner` reads it from there. A test counts it: one read that grew costs a third of three. Measured through `codexTranscriptPath` with 24 threads of 1.1 MiB, one growing, the three versions alternating, load average 92 of 128 cores: 465 ms (median of six; the first 1136 ms), bbfb40c 1039 ms, `main` 543 ms. Nothing changed: 371 ms, 840 ms, 645 ms. | ## Beyond the findings Found while writing the negatives, and fixed here: - A one-word exchange (`thanks` / `You're welcome!`) ends many conversations. A thread of another folder opened through the picker (devswha#896) is never among the folder's candidates, so both new paths also weigh every conversation a Codex process has loaded (`loadedRollouts`). - Neither new path is offered for a nested (Kiro) pane, whose guard takes a substantial match alone, nor for a `--remote` TUI, whose conversation is in another store. ## What is left out, and why - **Cases 1 and 2 tie nothing on Windows**, where the conversations Codex has loaded cannot be read, so the pane's own conversation is not known to be a candidate. The same holds on Linux and macOS while more than 32 threads are loaded or one loaded thread cannot be weighed. Case 3 does not need that list. - **Case 1 ties nothing while any Codex conversation the pane could be running has a turn under way**: this folder's, and every one Codex has loaded, from any folder. On a PC where other Codex agents are at work, a pane whose last answer scrolled or is a code block shows the terminal until they are idle. Case 2 is not held back by that: its prompt tells. - **Nothing a last turn ties is kept through another screen.** While such a pane works on its next turn Chat shows the terminal, and the conversation again once a turn ends on something a match reads. A pane that has shown one long answer is bound as on `main` and is not affected. - **Case 3 covers a second Codex that was asked nothing.** Once it was asked the prompt this pane shows, or ended on the same exchange, either conversation could draw that turn (a resume in the same TUI makes no thread), and the terminal stands in, as `main`'s rule for a footed turn has it. The repro in devswha#3262 with the same prompt and the same word in both panes ends there. - **A long prose answer whose visible end holds markdown Codex renders its own way** (emphasis, links, list markers) stays untied: the rendering is not guessed, as in `matchCodexTranscript`. Code blocks and plain text are read. - **Case 1 ties nothing while another conversation the pane could be running holds any 48 letters of the end of the text shown**, a closing sentence two answers share included. - **A folder with more than 32 interactive threads** gets neither new path. **A dead thread that ended inside a turn** (its Codex killed) keeps case 1 off in its folder while it is among the 32 newest. - **No screen copied from a real pane.** This PC's Codex account is at its usage limit until Nov 13, so a finished turn could not be captured; only the header, composer and status rows of Codex 0.167 were checked live, through `pane.read` in an isolated herdr session. The fixtures keep the shapes devswha#3262 reports for 0.164. The hook row (`↳ Hook · …`) is the reporter's observation; a hook row drawn another way ties nothing. ## Found on main, not changed here - `matchCodexTranscript` on `main` binds a block of indented rows at the very top of a read when it equals a whole answer: a pasted prompt whose `›` row has scrolled off reads as one. - A pane a long answer bound keeps that conversation after `/resume` in the same TUI opens another existing one (no new thread, same process), until its screen matches again. - A pane started with `codex resume <id>` that the picker then moved to another conversation is answered the command line's thread whenever its screen proves nothing. ## Validation Run on this PC (Linux), all with `TMPDIR=$HOME/.cache/ovis-tmp/ext-codex`: - `bun run check fast` on the head of this PR (439a7d0): workflow syntax, generated types, generated themes, typecheck, build and unit tests all pass (14578 pass, 0 fail, 50 skip in 878 files). - The touched test files alone: `bun test ./server/codex.test.ts` (117 pass) and `bun test ./server/codex-processes.test.ts` (245 pass, the tests that hold real writer locks included). - Failing-first: 7 tests failed on devswha#3558's head, 11 on devswha#3559's, 3 on devswha#3560's, 7 on d43d2b9 and 6 on bbfb40c for the merge pass's findings, each stating the correct behaviour through `codexTranscriptPath`. - A mutation check of the new paths: 52 guards removed one at a time, each caught by at least one test, except two that are covered twice by design (the slice at the last header behind the rule that the footer sits right above the idle composer; counting candidates of other folders behind the search of their reads as Codex draws them). - An independent adversarial reviewer in a checkout of its own, on every maintainer commit; its scenarios are in the test file. - Lookup times as in the tables above, on a PC at load average 55 to 120 of 128 cores: compare the columns, not the numbers. - Codex 0.167 in an isolated herdr session (its own config, state and Codex home): the header, composer and status rows only, as said above. Not run: the integration and browser suites, macOS and Windows. The diff is `server/codex.ts`, its two unit test files and one changelog fragment; none of them is a file the Windows or macOS jobs run, and no UI file changed, so no browser regression applies. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: VibeWriter_Hand <[email protected]> Co-authored-by: Claude Code <[email protected]>
…s no other test (devswha#3604) ## Why devswha#3602's local merge gate failed Fast checks on two tests of `server/machine-core-choice.test.ts` that its diff does not touch: "chooses the PC's own core server: server error later" (`Expected: "Bearer aaaa…"`, `Received: null` at the relay's check of the request's token, with `GET - /api/health failed`) and, in its wake, "server error after proof" (`Executable not found in $PATH: "ssh"`). That test's relay stands on a port the system handed out (the server under test takes one with port 0 for its tunnel) and checks the token of every request it gets. The server under test never asks a tunnel for `/api/health` without the token, so the request came from another process. `scripts/plugin.test.ts` was running beside it (51.7 s in that lane). It took a port with port 0, let it go and handed it to `scripts/plugin.ts` as `PORT`. The plugin asks that port for `/api/health`, with no token, for as long as it waits for a server: seconds. Every other unit file's servers are on ports the system hands out the same way, in the same container, so one that was given the plugin's port got the plugin's question. Which process sent the request in the gate run is not in its log; the plugin tests are the only ones found that ask a port they do not hold for `/api/health` without a token. ## What `scripts/quiet-port.ts`: a free loopback port outside the ports the system hands out for port 0, so no port-0 server can be on it. The range is read from the host (`ip_local_port_range`; where it cannot be read, every port from 32768 up counts, which covers macOS and Windows), and the port is picked from a stretch of at least a thousand that holds none of them, from 20000 up when that fits. A process is never given the same port twice. `scripts/plugin.test.ts` (four places) and `scripts/plugin-phone.test.ts` hand the plugin such a port. Test-only. No assertion, wait or timeout changed, and `server/machine-core-choice.test.ts` still checks every request's token. ## Proof In the CI runner image (`herdr-ci-runner:local`): | Run | Result | |---|---| | `main`'s `machine-core-choice.test.ts` + one tokenless `GET /api/health` sent to its relay during "server error later" (scratch patch) | the gate's two failures with the gate's messages, `42 pass, 2 fail` | | `main`'s plugin tests beside 4000 listeners that keep taking ports with port 0 and letting them go | 9 tokenless `GET /api/health` arrived at those listeners, on 2 ports; two plugin tests failed themselves ("starts at the same moment", their port taken by a listener) | | this branch, the same listeners | 0 arrived; those two tests pass | ## Validation - `bun run check fast`: pass on this head (15015 unit tests pass, 0 fail). - `bun test ./scripts/quiet-port.test.ts ./scripts/plugin.test.ts ./scripts/plugin-phone.test.ts`: 56 pass on this PC. - The listener runs above were made on the first commit; the second changes only where the port is picked from (on this host and in the image, 20000 to 32767). - Skipped: `bun run check full`, the integration and browser suites (two unit test files and a test helper, no product code). No changelog fragment: nothing a user notices. - In the bare container used for the listener runs, one plugin test ("run the release the app updated to as link") fails on `main` and on this branch alike (`This PC is already in an Ovis account`); it passes under `bun run check fast` and is not about ports. ## Not in this PR - `scripts/windows-plugin.test.ts:180` takes its port the same way (it runs on Windows only, in a job of its own). - Tests that send one request to a port they just let go (`server/push.test.ts:1208`, `server/bridge.test.ts:327`, `server/ssh.test.ts:236`, `server/relay/direct.contract.test.ts:361`, `scripts/check.test.ts:200`): one request within a moment of the release, where the plugin asks for seconds. - `server/updater.test.ts` has its own picker from devswha#3590 (10000 to 19999, fixed); `quietPort()` stays above it wherever the host's range allows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
…vswha#3608) ## Change Follow-ups to devswha#3173 (queued follow-ups recovered as held after a disconnect), from the two reviews of its last head. Each is a way the bridge alone could let a held message be typed twice or offered for the wrong pane; in one browser whose storage works, the page's own re-read before a press already stops the double sends. **The claim comes before the dispatch.** A **Send now** of a saved copy removed the held receipt, typed the text, and only then recorded `sent` under the pane ID it started with. A turn is its pane ID's, so when herdr moved the pane while the text was on its way, the outcome landed under the old ID and a second tab's copy under the new one was typed again (a resend there with another generation typed at the same time). The handler now puts a `sending` claim among the receipts before anything is typed. The move carries it, every resend of that ID under any pane ID answers `pending_busy` while it stands, and the send's end is recorded under the ID the pane has then: `sent`, the "not confirmed" note, or the held receipt back in place when nothing was typed. **The "not confirmed" note outlives its owner's record.** When a Send now ended without an answer inside the first minute after the reload, the closed owner's record aged out as `dismissed` 60 s after the close, and that removal erased the note. Only the record's own disposition was left, and past 1,024 later dispositions the other tab's copy was typed again. A `dismissed` removal now ends only a held receipt. **A pane that ended leaves no held receipt.** herdr may give its ID to another pane, and the same browser attaching there was told the old pane's copy was held, with **Send now**, for a terminal it was never written for. The pane's held receipts now go when it ends, and a follow-up the bridge still holds for it gets none when its connection closes later (the same failure with the pane ending first). What was sent, or may have been, stays and only refuses. **The page's proof no longer stretches when the device's clock is set back.** The bridge ends its receipt on a forward-only clock; the page ended its proof on the wall clock. What is left of a proof now runs on a clock that steps forward by the larger of what the wall clock and `performance.now()` moved since it was last read, so a wall clock set back takes nothing from the time that passed and a sleep `performance.now()` did not count is still counted. ## Validation All on commit `5f414757d`. - `bun run check fast`: passed (unit: 15255 pass, 0 fail, 51 skip; typecheck, build, generated types and themes, workflow syntax). - CI runner image (`herdr-ci-runner:local`, a clone of this commit, each through `bun run check run`), all passed: the contract tests `server/pending-input.contract.test.ts` and `server/submit.contract.test.ts` (228 pass, 0 fail), and the browser regressions `pending-pane-switch-regression.ts`, `composer-fit-demo-regression.ts`, `held-rows-demo-regression.ts`, `restored-draft-demo-regression.ts`, `composer-draft-demo-regression.ts`, `chat-local-send-follow-demo-regression.ts`. - New tests, each failing on main's code and passing here: - `server/core/pending.test.ts`: a pane moved while a Send now is on its way, for each end of the send (sent, not confirmed, nothing typed): the other tab's resend under the new ID with another generation is answered `pending_busy` during the flight (on main it typed at the same time), and afterwards the outcome is known under the new ID. The harness's turns are now per pane ID, as in the bridge. - `server/core/pending.test.ts`: a Send now that ends without an answer inside the owner's first minute, then the record's expiry and 1,100 other dispositions: the other tab's resend is still `pending_uncertain` (on main it typed). - `server/core/pending.test.ts`: a pane that ended with one held receipt and one message still held on a live connection that closes afterwards: a browser attaching under the reused ID is told neither as held; a follow-up taken for the new pane is held and told as before. - `src/lib/pendingMessages.test.ts`: a proof ends after the time that passed with the device clock set back an hour, and after a sleep the forward-only clock did not count. The file's clock tests now move both clocks together. - Not run: `bun run check full`; the full browser sequence of a pane move during a send (the tests drive the bridge and the store directly). The branch is based on main as of devswha#3581 and merges with today's main without conflicts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <[email protected]>
devswha#3532) ## Summary Settings -> Devices and PCs -> **PC load in the status bar** is now on until a device turns it off (`pcLoadOn`: `pcLoad ?? true`). A device that already chose off keeps its choice; the choice still lives in its own `ovis:pc-load` key. ## Why The cost is negligible: the client asks `GET /api/system` for the selected PC only, 5 s after the previous answer, only while the page is visible (`src/lib/system.ts`). The server runs nothing in the background and reads counters the kernel already keeps (`/proc/meminfo`, CPU times, `statfs` on root and home), sharing one reading between asks closer than 1.5 s (`server/system-stats.ts`). The earlier default-off was a judgment about status-bar clutter, not cost; the maintainer asked to flip it. Reference: this follows the app's own status bar; no external app's pattern is adopted. ## Changes - `src/lib/settings.ts`: default on. - `src/lib/settings.test.ts`, `scripts/pc-load-demo-regression.ts`: expect on by default; the regression now turns it off (asserting no PC is asked), then on again. - `DESIGN.md`, `docs/guide.md`, `docs/development.md`: the default, and the stale "PC load in the sidebar" wording replaced with the status bar where it now lives. - `changelog.d/pc-load-default-on.md`. ## Validation - `bun run check fast`: pass (typecheck, build, 14394 unit tests). - `bun scripts/pc-load-demo-regression.ts`: pass at 390 and 1280. - Skipped: `scripts/design-gate-qa.ts` (its pc-load surfaces set the key explicitly) and the CI-image browser suite. Co-authored-by: Claude Fable 5.2 <[email protected]>
devswha#3607) ## Change An HTML file opened in the file viewer's Page view ran its scripts as soon as it was drawn (`sandbox="allow-scripts"`). The page's sandbox was measured with probes that frame a page as the viewer does (Chrome 156 and WebKit 26.6). A page's script reaches no other host by a fetch, an image, a form, a popup or a navigation, but: - it reaches one over WebRTC: a STUN or TURN server of its choosing carries its data (a CSP `webrtc 'block'` is ignored by both browsers), and in WebKit a `preconnect` does too; - it can move its frame to another port of the host name the app is on; - it takes the keyboard focus with `window.focus()`, so keys typed for the message box or the terminal go to the page. So a page's scripts now wait for the person. **Scripts are off until asked.** The Page view draws the file in a frame that allows no script (`sandbox=""`): its HTML and CSS show, with the files the renderer put into it. One line above it says **Scripts in this page are off.** beside **Run scripts**. The press loads the page again with `allow-scripts`, for that file and for as long as the viewer stays open, also through Source and back. Another file, a viewer opened again and a reload start without scripts: nothing is stored. **Over a relay** the rule is the same. The render host (`/s/<id>/~render`) draws the page in a `sandbox=""` frame of its own, under the same page policy, and writes it into its own document only when the app's message says `scripts: true`. The host is revalidated on every load (the shell's cache rule for `/s/*`), so a browser does not pair the new app with a render host it cached earlier; an app still cached from before this change sends no `scripts` field and gets the script-less page until it reloads. The reader (**Open in a new tab** and **Copy link** over a relay) is this viewer, so it starts without scripts too. **Beside the pane, a page with scripts does not take the app's keys.** Nothing on a frame stops its script from taking the focus (`inert`, `tabindex` and a permissions policy were tried), the app sees neither a hover nor a press inside a frame of another origin, and it cannot take the focus back while that frame is there. So the page has the focus only by the person's doing: the **Run scripts** press (until the app has the focus again), a press on the page, or Tab into it. While the app has the focus, the frame takes no pointer, so the press on the page comes to the viewer, which puts the focus in the page; the next press is the page's, and the wheel scrolls it from then on. A frame that has the focus otherwise took it: its scripts are turned off again at once, which is the one thing that gives the keys back, the focus returns to where it was, and the line reads **This page took the keyboard, so its scripts are off again.** (a status line that is already in the document, so it is announced). The popup is unchanged: it holds the focus itself while it is open. **What the press does not close.** A page whose scripts the person runs can still reach other hosts over WebRTC and move its frame to another port; the press is the person's decision about that file. DESIGN.md says what was measured and what stays possible. **What a script-less page can still do, in WebKit only.** It sent no request to any host in either browser (a `preconnect` hint, a meta refresh, an image, a stylesheet, a CSS background). But for a `preconnect` hint WebKit opens a connection to the host the page names, with no request on it (Chrome opens none); a name lookup could not be watched in WebKit. Such a page reads nothing and takes no key, so this tells that host that the file was opened and whatever the file's author wrote into the host's name. It is not closed here: taking the hints out in the renderer needs more than a rule in its `HTMLRewriter`, which reads `<noscript>` as text while a browser without scripts reads it as elements. DESIGN.md states it as measured. **Open in a new tab on a direct connection** still opens the rendered page in a tab of its own with its scripts: that is a press too, and no part of the app is in that tab. Before and after pictures of an HTML file in the popup and beside the pane are on the maintainer's PC under `~/.cache/ovis-tmp/shots-page-scripts/` (none in the tree). ## Validation All on commit `967141d64`. - `bun run check fast`: passed (unit: 15170 pass, 0 fail, 51 skip; typecheck, build, generated types and themes, workflow syntax). - CI runner image (`herdr-ci-runner:local`, a clone of this commit, `bun run build:shell` first, each through `bun run check run`), 23 scripts, all passed: `file-viewer-regression.ts`, `file-viewer-page-scripts-browser-qa.ts` (new), `relay-media-browser-qa.ts`, `relay-shell-browser-qa.ts`, `file-viewer-mobile-regression.ts`, `docked-file-link-demo-regression.ts`, `files-panel-demo-regression.ts`, `files-documents-demo-regression.ts`, `palette-local-page-demo-regression.ts`, `web-panel-mobile-regression.ts`, `deep-link-demo-regression.ts`, `chat-tool-paths-demo-regression.ts`, `link-menu-demo-regression.ts`, `file-text-size-demo-regression.ts`, `files-prompt-regression.ts`, `text-file-edit-regression.ts`, `file-preview-text-browser-qa.ts`, `markdown-outline-browser-qa.ts`, `virtual-source-browser-qa.ts`, `terminal-file-links-regression.ts`, `tap-targets-demo-regression.ts`, `render-crash-demo-regression.ts`, `chat-visualization-browser-qa.ts`. - `scripts/file-viewer-page-scripts-browser-qa.ts` on WebKit 26.6 (Playwright, the test Mac, `PAGE_SCRIPTS_ENGINE=webkit`): passed 3 of 3. Its first WebKit runs failed at the keyboard step: after the page's scripts were taken away, WebKit left the window without the focus and dropped the keys. The guard now asks for the focus again once the window's blur event is over; that is what the 3 runs cover. - The new script's checks: a probe page's script has not run before the press (the frame's pixels, `sandbox=""`, no message from it), the press runs it, another file and a reopened file start without scripts, the popup keeps a page that takes the focus, beside the pane a page whose script takes the focus loses its scripts and gets no key while the message box gets every key, and a press on the page or Tab into it gives the page the keys. `src/components/FileViewer.scripts.test.tsx` covers the frame's sandbox and the relay message (`scripts: false`, then `true`); `scripts/shell-build.test.ts` covers the render host. - Probes for what is said above (kept outside the tree): a script-less page in Chrome 156 and WebKit 26.6, the relay's inner frame in both, and the focus rules in Chrome 156. - Not run: `bun run check full`, real Safari and iOS (WebKit here is Playwright's), Firefox. `relay-media-browser-qa.ts` ran only in the image (it needs ffmpeg). The branch is based on main as of devswha#3589; it merges with today's main without conflicts, and the checks above ran before that merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
…ine, and more password asks are read (devswha#3591) Follow-up to devswha#3566, from the merge pass's reviews of its last head (items a to e). ## Change **(c) A prompt asks only while the cursor is on its line.** git, ssh, ssh-add and sudo print a line break after an echo-off read and work on (git signing in, ssh-add reading its key, sudo running a quiet command) with the prompt still the last text on the screen. The masked field stayed up, empty and enabled, and a second Send waited in the terminal for whatever read next: the shell, when git exits after a failed sign-in, where it is run and kept in history. On main too, for sudo and ssh. The page now takes a prompt as answered once its cursor was seen on the screen's last line that holds text and then left it (`promptHasCursor`, wrapped rows counted with their line; `promptAsks` keeps what was seen), so the field leaves as soon as the program has read the answer. A prompt whose cursor was never on it asks while it is the last text, as on main: a script that prints its prompt with a line break and reads below it (`echo "Password:"; read -s`), or a screen first seen after the answer. Attached panes only: a mirrored pane's repaints carry no cursor, and it keeps the rule it had. Two cases of an attached pane are kept from reading as "asks no more": a prompt whose colon fills the row's last column (the space after it wraps and the cursor is on the next row; herdr's attach stream draws each row at its own place, so the page has no wrapped row to join: the cursor on the row right below, past its start, on a blank row, under a prompt whose last row reaches the right edge, still counts; herdr writes every cell of a row, so that row is measured without its trailing spaces, to the edge or one column short of it), and a chunk that ends inside a frame (the secret is read at a whole frame only, `stamp.boundary`; a herdr-core pane's stream is the program's own bytes, with no frame of herdr's, and is read at every chunk as before). The server's guards are unchanged (herdr's read carries no cursor), so queued text stays held until the screen moves on. What stays open: a `secret` already on its way when the program reads an answer still passes the server's check, which is the screen's text; that is the frame's transit time, where it used to be as long as the program worked (CodeRabbit's thread). **(a)** The typed fallback to a server without `secret-prompts-2` is refused (`unsupported`) when that server also lacks `submit` (0.2.0 and earlier): a message sent to it leaves no request the `pane_busy` check could see. **(b)** The field says when its value is typed unchecked: "This PC is not updated: what you type goes to the terminal without checking that the prompt is still there." (`HerdrSocket.typesSecret`: the server has said what it takes, it has `submit`, and it does not take that prompt.) English, Korean, Japanese and Chinese. **(d)** The yes/no test refuses `y/n` before anything that does not go on as a name, so a bare three-way choice (`y/n/a:`) and a quoted one (`'y/n'`) are choices again, as on main. More than one letter after the slash that follows `y/n` is a path going on, not a third option (`…/team-y/n/repo.git`, which devswha#3566 read as a prompt). **(e)** More asks are read: - ssh keyboard-interactive (a Mac, PAM) and doas: `(you@host) Password:`, `doas (you@host) password:` - sudo in any language (`[sudo] alice의 암호:`, `[sudo] Passwort für alice:`, `[sudo] alice 的密码:`, a full-width colon ends a prompt too) and sudo-rs (`[sudo: authenticate] Password:`; what it asks in the clear, `[sudo: input needed] …`, is not one) - passwd: `Current password:`, `New password:`, `Retype new password:` - mysql and mariadb `Enter password:`, and `enter password for <what>:` (restic, pass) - gpg's pinentry on a terminal: `Passphrase:` - openssl: `Enter PEM pass phrase:`, `Verifying - Enter PEM pass phrase:`, `Enter pass phrase for <file>:` Not read: a prompt above a tmux or screen status line. The server cannot tell the prompt's row from the last one without a cursor, and the page must not offer a field the server would refuse. ### Contract (WS) One feature name is added: `secret-prompts-3`, a `secret` is taken at every prompt `shared/secret-prompt.ts` reads now. devswha#3566 already shipped in 0.5.3's betas (15 to 17) under `secret-prompts-2`, and such a server answers `invalid_secret` at the prompts of (e). So: - `shared/secret-prompt.ts` keeps each released server's rule as it shipped (`SHIPPED[1]`: every server with `secret-input`; `SHIPPED[2]`: one that lists `secret-prompts-2`), and `promptSet(prompt)` says the first of the three that reads a prompt. - `HerdrSocket.sendSecret` sends a `secret` when the server takes the prompt (set 1; set 2 with `secret-prompts-2`; anything with `secret-prompts-3`), and otherwise types it under the guards devswha#3566 gave the typed fallback. - This server lists both names. ## Tests - `shared/secret-prompt.test.ts`: each prompt of (e) and lines that stay no prompt; the choices of (d); `promptHasCursor` on the prompt's line, below it, above it, on a wrapped prompt's rows, on an empty screen, and in the shape herdr draws a prompt that fills its row (one line per row, the space's row blank: the cursor past that row's start counts, at its start or a row further down does not), with rows padded to the pane's width as the page has them (a short prompt with the cursor below it, past the row's start, does not count); `promptAsks` for git's flow, a prompt asked again, and a prompt read on the row below; `secretPrompt(…, 2)` reads devswha#3566's prompts and none of (e), and `promptSet`. - `src/lib/ws.test.ts`: no typing to a server without `submit`, and `typesSecret` false for it; `typesSecret` for a server with the feature, without it, and before the features are known; a prompt of (e) is typed to a server that lists only `secret-prompts-2` and sent as a `secret` to one that lists `secret-prompts-3`. - `server/secret.contract.test.ts`: a `secret` is taken at `([email protected]) Password:` and `[sudo] alice의 암호:`, and the snapshot lists `secret-prompts-2` and `secret-prompts-3`. - `scripts/secret-input-regression.ts`: after Send at git's prompt, with the program printing only a line break, the field leaves while the prompt is still the last text on the pane's screen; a prompt as wide as the pane, its last space wrapped onto the next row, still shows the field and takes the answer, and so does a prompt printed with its line break and answered on the row below (a real herdr attach). - Failing first: the three unit tests of (a), (d) and (e) failed before the change (with only the two new helpers added); the unit tests of 466e778 (the full-row prompt, `secret-prompts-3`, `typesSecret` without `submit`) failed on 464673f, and those of 9ca50cd (padded rows, `-y/n/` paths) on 466e778's rules. The browser step failed with the cursor rule taken out (`TimeoutError` at the field's `waitFor({ state: "detached" })`), and passes with it. - Outside the tree: over 600,000 generated screens `secretPrompt(…, 2)` reads what devswha#3566's file reads and `secretPrompt(…, 1)` what the release before it reads, and `promptSet` agrees with both. Over 500,000 generated screens no prompt devswha#3566 reads is lost, every prompt an earlier server takes is still one, and a prompt read off a screen is read again when sent back. Of 36 lines that are no secret request, two are newly taken, both by the sudo rule: `[sudo] is not installed:` and `[sudo] alice의 암호 틀림:` (anything `[sudo] ` asks up to a colon). - Wording: sudo-rs's `[sudo: authenticate] Password:` is from its source as I remember it, not captured here (running sudo would touch this PC's auth state); the binary holds `input needed`. openssl's and pinentry's are from `strings`; passwd's, mysql's and the localized sudo lines are from their documentation, not run. ## Review history - 466e778: the merge pass's reviews found the right-edge test always true on herdr's padded rows, a herdr-core stream never reaching a frame boundary after an unclosed synchronized update, a prompt read on the row below losing its field (Codex; main showed it), and a repository path with `-y/n/` read as a choice (Codex; devswha#3566 read it). Fixed in 9ca50cd, tests first. Codex's third point, a second device's `secret` passing the server's text-only check after the first was answered, is the transit window listed above and is not closed here. - 464673f: the merge pass's review found the full-row prompt losing its field (a regression against main), the secret read inside a frame, devswha#3566's set already shipped under `secret-prompts-2`, and `typesSecret` true for a server without `submit`. Fixed in 466e778, tests first. - Left for after the release, on this session's list: the second asks of restic, pass, htpasswd and older passwd; the `[sudo] …:` rule also taking lines such as `[sudo] Installing packages:`; a path with `y/n/` under a folder ending in `-y`. ## Validation On 9ca50cd: - `bun run check fast`: pass (unit 14808 pass, 0 fail, 51 skip; typecheck, build, generated types and themes fresh). - `bun run check run bun test --timeout 15000 ./server/secret.contract.test.ts`: 8 pass. - `bun run check run --build -- bun scripts/ui-contexts-regression.ts` (runs `checkSecretInput`): 62 PASS, 0 FAIL. - `bun run check run --build -- bun scripts/ui-regression.ts`: 85 PASS, 0 FAIL. - The browser scripts ran on this PC, not in the CI runner image; CI's browser jobs run them there. - Not run: a herdr-core server (the `terminal-history` read at every chunk is untested), Windows, a mirrored pane in a browser, `bun run check full`, the other integration files and browser scripts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
devswha#3610) Found by a code review of `shared/` and `server/core/` (finding: `server/core/connections.ts:268`). No issue was filed. Authentication, so it is opened now under the merge pass's rule of 2026-11-11. ## Change While nothing is paired and no token is set, any machine on the LAN gets in (`via: "open"`). Once the pairing gate closes (the first device's cookie comes back, or the relay is turned on) its new requests are refused. What it already held was not: - **`/ws`.** A connection admitted through open access carries no device id, so `admit()` registered no revoke listener for it and nothing ended it. It kept sending `input`, `keys` and `submit` into every pane and reading their output, and "Revoke every device" could not close it. - **`GET /api/machines/events`.** Its end hook was a device's revoke or Portal's recheck, and nothing for open access: the stream kept delivering the roster of every PC, shared preferences and seen finishes. Read-only. `server/dispatch.ts` already assumed otherwise ("whoever holds it has no access left by the time there is news"). Now: - `DeviceStore.onGateClosed` is told once, from the write that turns `gated` true (`match` confirming the first pairing, `enroll`, `closeGate`, `revokeAll` on a store nothing was paired in). Listeners are told right after the call that closed the gate, when the store's own fields say so (a microtask: no frame of a connection is read in between), each on its own, so one that throws ends neither the others nor the pairing. `endWithGate(close)` also closes at once when the gate is closed already. - The upgrade marks a connection the open LAN alone let in (`data.open`), a relayed one to another PC too, and `admit()` ends it with the gate: 1008 "Pairing required", its panes detached and its claims dropped as for a revoked device. One whose upgrade passed just before the gate closed is not admitted. - The events stream gets the same end. - Not marked: a connection let in by this PC itself, a token, a Tailscale login, Portal or a device, and one that also holds the bridge token. Another Ovis server reaches a PC bound to one address through that address, which is no loopback, so its sockets are `via: "open"` while that PC is ungated although the bridge token is what let them in. The page: 1008 has no special case in `ws.ts`; it reconnects, the lost roster stream makes it read health, health says unauthenticated and the access gate shows. A browser that holds the first device's cookie reconnects as that device. Read in code (a reviewer's trace), not run in a browser. ## Review history Two independent reviews of the first commit (a177a1a) before it was pushed found: the bridge-token socket marked `open` and ended with the gate (a regression of that commit, reproduced at dispatch level), the events stream outliving the gate (reproduced), and the listeners told inside `save()` before the caller's assignments (a throwing listener left the gate open in memory; reproduced with an injected listener). All three are fixed in e94d58e. They also traced that pending messages need no close in this branch (the "closed" that follows runs it), that queued input re-checks `authorizeSocket`, and that no other long-lived channel can be held through open access. ## Tests - `server/devices.test.ts`: `onGateClosed` told once (first cookie back, or `closeGate`), after the store says gated, not for a later device or a revoke; a listener that throws does not stop the next or fail the pairing; `endWithGate` at once when gated. - `server/core/connections.test.ts`: an open connection and a relayed one end with 1008 "Pairing required" when the gate closes; one let in another way does not; one that closed first leaves no listener; a late one is not admitted. - `server/dispatch.test.ts`: the upgrade marks an open-LAN `/ws` and a relayed one, and neither a bridge-token one nor this PC's own. Each mark's removal, and the bridge guard's, fails it (two mutants). - `server/device-access.contract.test.ts`: on a real server, the stranger's socket closes with 1008 when the first device's cookie comes back and its next upgrade is refused; its events stream ends when the gate closes and its next one gets 401. The test that pinned the old shape (the stream stays open and is only kept from hearing of pairings) now expects its end. - Failing first: the three unit tests of the first commit failed on main; the socket contract test and the events stream contract test each fail with their fix taken out ("the open socket outlived the gate", "the open stream outlived the gate"). ## Validation On f2dba52: - `bun run check fast`: pass (unit 15017 pass, 0 fail, 51 skip; typecheck, build, generated types and themes fresh). - `bun run check run bun test --timeout 15000 ./server/device-access.contract.test.ts ./server/machine-events.contract.test.ts ./server/relay/session-ws.contract.test.ts`: 58 pass. - Skipped: `bun run check full`, the other integration files, every browser script (no page code changes). Not run: a second server behind a bridge token, and the page's path to the access gate after the close. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
## What After the terminal sign-in, `ovis add` (also `login`, `link`) now ends in one QR code with a code to type. A device signed in to the same Ovis account that scans it is paired, links itself, lists the PC and enrolls it: no Add to press, no digits to compare, nothing to answer in the terminal. `ovis add --approve` keeps the approve-here path as devswha#3581 leaves it (the request is approved by typing its digits, not `y`); `--code` is untouched. This is the plan's decision D1, which the owner approved on 2026-11-10: a code the PC shows may put the PC in the scanning signed-in device's account with no Approve press on the PC. The code is a key to the PC, so every guard the plan names is built: - **Made only by an explicit act on the PC**: only by running the command on a loopback server, after the sign-in. The variant that skips the sign-in is not built. - **Only on a real terminal**: where the output is not a TTY the command stops before the sign-in with "The QR code is a key to this PC. Run this in a terminal, or pass --print to write it anyway." - **Cleared**: drawn on the terminal's alternate screen, which is left when a device paired, when the run stops, on Ctrl+C and on any error. A terminal without such a screen, or a recording of the session, keeps the drawing of a code that no longer works. - **Taken back**: `POST /api/devices/pair/cancel` when the run ends, before anything is written to a terminal that may be gone: on success, Ctrl+C, SIGTERM, SIGHUP, an output that takes no more writes, an error and the 30 minutes. Only a killed process leaves its code to run out. - **Short-lived**: three codes at most, about 30 minutes, then the command stops. No code is made once a device got in, nor while that cannot be told. - **Says what it let in**: success only once the PC is in the account that signed in and enrollment finished, naming the account and the device of that account that added it. - **Another account**: a PC that ended in another account than the one that signed in was put there by a device the code let in. Every device that came since the first code is removed without a question, that account's members among them, and the command fails, naming both ids and what went. The relay pass is never named under the other account. - **A device nobody vouched for** (not a member of the account that signed in) is named and asked about: `Keep that device? Type keep to keep it, or press Enter to remove it:`. Only the word keep keeps it. Anything else, no answer, an input that is not a terminal, and a run that ends before an answer (Ctrl+C, SIGTERM, SIGHUP, an error, the 30 minutes) remove it. ## How - `scripts/plugin-link.ts`: `addByQr` is the new default tail of `linkToAccount`. Each round looks at `/api/account/status` and `/api/devices`, and only after an answered look that found no new device and no account is a code made or renewed (`POST /api/relay/code`, then `POST /api/relay/offer`). Where the relay takes no typed code, a pairing pending from elsewhere is ended first, so the QR code carries digits of its own. - Every device that is not in the list read before the first code got in with the code, through the relay or with the six digits at the PC's own address. Only a row that says it is a member of the account that signed in (`account` on `GET /api/devices`) is vouched for. Any other is asked about: a relay device after 15 s (a signed-in one links itself within seconds), a direct one at once. - Removals carry `x-ovis-unless-account` with the account that signed in. `server/devices.ts` then answers `409 account_member` for a device that became a member since the list was read, in one step with the revoke, so the owner's own slow phone is not removed by a removal already on its way. - The device named as the adder is the member that linked itself (`account` and no `added_by`): the one that came since the command started, else the one paired before. None is named when that is not one device. - As a run ends, the code is taken back and the devices are removed before the screen is left and before anything is said. `scripts/plugin.ts` hears a failed write on stdout and stops the run as a signal would. - The keep question uses the same typing rules as devswha#3581: read only on a terminal, only a line typed 1.5 s or more after the question showed answers it. The first line handed over after a shown question left the screen unanswered answers nothing; lines already handed over when the question goes are drained first and do not use that drop up. - `--approve` runs devswha#3581's loop unchanged, and its "another account" message is main's. - Docs: `docs/relay.md` ("A PC with no screen"), `docs/account.md` ("Who may admit a device", "PC API"), `docs/guide.md`; changelog fragment `changelog.d/cli-add-qr.md`. ## Review - **First review** (seven findings, resolved in the second commit): the adder must be a member; a device that typed the digits at the PC's own address counts as let in; a code is renewed only after an answered look; a silent server is waited for; the abort is checked after a look's awaits; negative tests; the changelog's count of codes. - **Merge pass review of e3a7646** (Opus: BLOCK, Codex: CLEAR): one HIGH, three MEDIUM, five LOW, all resolved in 2a66067 and f1c283b. Each finding, its resolution and what the real-signal runs showed are in [this comment](devswha#3586 (comment)). It replaces two statements of the first review: Ctrl+C at the question now removes the device, and so does Ctrl+C during a look. Not changed: someone who enters the sign-in code first makes their account the one that signed in. That belongs to the sign-in step, which `--approve` shares. ## Validation - Ran: `TMPDIR=$HOME/.cache/ovis-tmp/cliqr bun run check fast` on 7a9ce2a, every step ok (15425 pass, 0 fail). - Ran: `bun test ./scripts/plugin-link.test.ts ./scripts/plugin.test.ts ./server/devices.test.ts`, 203 pass (fake PC API, fake account service, injected clock, temp state dirs, port 0). - Failing first: 16 link tests fail on e3a7646's `plugin-link.ts`; the write-order test, the stdout test and the server test each fail without their fix. - Ran by hand, not committed: the real `bun scripts/plugin.ts add` in a pty against fakes, ended by closing the terminal (SIGHUP), SIGTERM and Ctrl+C after a signed-out device paired. e3a7646 leaves the device paired in all three; 7a9ce2a takes the code back and removes it. - Not run: `bun run check full`, a real phone, relay or account service, the browser regressions (no UI change), and the GitHub-only jobs (Native Windows install, macOS). This PR touches `scripts/plugin*` and `server/`, so it waits for GitHub's checks. Needs a real review: it changes who admits a device (a code shown in the PC's terminal admits its holder with no approval on the PC, decision D1), and it adds a header to `DELETE /api/devices/{id}`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
…whose job handed it in (devswha#3606) ## Why Follow-up to devswha#3585, from its reviews. devswha#3585 files a build under the run GitHub confirmed for the slot that handed it in. What was left is how that run is confirmed. **1. A claim was matched to the job the slot runs when GitHub answers, not to the job that wrote it.** A slot runs one job per container, under the same runner name every time. The promoter asked GitHub whether "the slot" runs a job of the run a claim names: - A trusted pull request's job writes `<main's key>.tar` and a claim naming main's run Y, whose jobs are queued, and ends. If GitHub answers only after the slot has started its next container and that one has picked up a job of Y, the build is filed as `entries/Y/<key>` and Y's other jobs restore it. With the per-run layout this was the one path left from a pull request's run to the `dist/` main's Integration and Browser jobs test, and so to a release validated by main's run. - GitHub goes on listing the job of a container that was killed as running, for minutes (about 13.5 after the 2026-11-09 reboot) and sometimes for days (two jobs of 2026-11-05 are still listed on this repository's slots 14 and 18). A job in the slot's next container could name that run and be vouched for by the dead job. **2. An old entry that could not be removed was walked and logged every second.** The flat `entries/<key>` an earlier launcher filed is removed at the start of every pass. One that stayed (a file of another user in it, an immutable file) was `chmod -R`'d and logged once a second, about 86,400 lines a day, and stayed readable by jobs of commits from before devswha#3585. **3. A refused build could leave a staging directory nothing removed.** `admit`'s own cleanup and the sweep of old `.new-*` leftovers used a bare `rm -rf`, which cannot empty a directory extracted without the owner's write bit. **4. The docs said "restart the unit"**, which stops every slot's container and cancels the jobs in flight, and which a promoter change does not need. ## What - **The claim is its container's.** The promoter reads the slot's container from docker (`docker container inspect -f '{{.Id}}' <slot>`) before it takes a claim and again after GitHub has answered, and takes the build in only when both are the same container. `run.sh` already empties a slot's outbox before it starts the slot's next container, so what is in the outbox while a container is the slot's, that container's job wrote. A slot with no container is refused without asking GitHub. - **The job started once that container had.** Docker also says when the container started, and the promoter takes only a job whose `started_at` is not earlier, to the second, with nothing allowed for the two clocks: `run.sh` waits two seconds before a slot's next container, so a killed container's job started at least that long before the next one, and any allowance would let in a job that started just before the kill (the second head of this PR allowed five seconds). A container's own job starts ten seconds or more after it, once the runner has registered. - **The job is on the runner registered under the name now.** A runner that ended its job is gone from GitHub, and the next container registers a new one (ids 24001, 24092, 24098, 24103 for one slot's four last jobs), so a job of an earlier registration is on another id. This does not tell a killed container's job apart, as the first head of this PR claimed: a container that registers over a dead one's runner (`config.sh --replace`) keeps the id (runner 22406 across the 2026-11-09 reboot). The start time does. One more GitHub call per judged claim, about one per CI run. - A refusal because the container changed, or because no runner is registered any more, is innocent, a job that ended while GitHub was asked, and holds nothing off. A job that started before the container, or on another runner, means the claim named a run that is not its own: the slot is held off for ten minutes, as for any claim at fault. - **Old flat entries are renamed first**, to `.new-gone-<random>`, a name no job reads. The rename needs only `entries/` itself, whoever owns what is inside, so an entry that cannot be removed is out of reach at once and is not walked again each second; an eviction tries it again once it is over an hour old. One that cannot even be renamed (`entries/` not writable) is emptied where it is, so no job restores it, and logged once a day while its empty directory stays. - A slot whose container is not running (never started, or stopped) gets nothing taken in. - **The claim was written once that container had started.** All of the above rests on the outbox being empty when a container starts. Were `run.sh` unable to empty it, the earlier job's claim and build would be read while the next container is the slot's. So the promoter refuses a claim or a build last changed before the container started: the system's own time of the last change (`stat %Z`), which a job cannot set back, to the millisecond, read before the file is taken (taking it changes that time). Removing another name of a file (a hard link) sets that time to now, so the restore markers, which the promoter removes and which could be such names, are now removed after the claims are judged, and a claim or a build with a second name is not taken at all. And `run.sh` starts a runner whose outbox still holds a file without the build cache (its job builds). - **`discard()`** (owner's write bit first, then remove, a failure logged and ending no pass) in `admit`'s cleanup and in the sweep. - **README and changelog:** a change to `build-cache-promote.sh` needs only the copy (`rsync -a`): the launcher starts the promoter from the installed directory every second. A change to `run.sh` takes a restart, which cancels the jobs in flight, so it waits for idle slots. **The copy alone applies what closes the paths.** Everything the promoter does is in force from its next pass. `run.sh` changes in one place, the runner that starts without the cache when its outbox could not be emptied: that takes effect at the launcher's next restart, and until then the promoter's refusal of anything older than the container covers the same case. ## Why runner slots starting before the old flat entries are removed open no new window Codex's finding on devswha#3585 (e16d168): after an update the first promoter pass removes the old `entries/<key>`, and a slot's job could start before that pass. - Only a job of a commit from before devswha#3585 reads `entries/<key>`, and such a job read it, whichever run had filed it, on every day before the update. The moment between the copy and the next pass (at most a second) is the last of that exposure, not a new one. - With a restart, the promoter is started before the slots, and its first act, before any GitHub call, is this removal; a slot needs a registration token, a container, a runner registration and a job's checkout and install before anything reads the cache. - A job of a commit that has devswha#3585 never reads there: it takes only `^[0-9]{1,20}$` as its run's directory. ## Proof `scripts/self-hosted-runner.test.ts` and `scripts/build-cache.test.ts` run the promoter against stand-ins for `gh` and `docker`. New cases: | Case | Result | |---|---| | the slot has another container by the time GitHub has answered about the jobs | refused, logged; the next container's own claim is taken in (slot not held off) | | the slot has no container, one that never started, or one that has stopped | refused, GitHub not asked | | the job GitHub lists started 13.5 minutes before the slot's container, on the same runner id (a killed container's job, the runner taken over) | refused; the slot is held off (the next claim costs no call) | | the job started 2 s or 1 s before the container / in the container's own second | refused / taken in | | the job GitHub lists is on another runner than the one registered under the name now | refused; the slot is held off | | a build left in the outbox before the slot's container started | refused, GitHub not asked; the container's own build after it is taken in | | the claim alone, or the build alone, last changed 1 ms before the container started | refused | | a leftover claim and build with second names that are restore markers, the container started 20 ms after they were written | refused, GitHub not asked (before: the markers' removal made both look new) | | the claim alone, or the build alone, has a second name | not taken, GitHub not asked | | `run.sh`: an outbox it cannot empty still holds a claim | that runner starts with no build cache mount or variable, and says so | | no runner is registered under the name any more | refused; the slot is not held off | | a refused build with a `0555` directory and a file nobody may read | nothing left in `entries/` | | an old flat entry that cannot be removed | renamed out of the key's name; one log line in three passes | | an old flat entry in an `entries/` that cannot be written | emptied; one log line in three passes, every pass exits 0 | | an old `.new-*` leftover with a `0555` directory | gone at the next eviction | Twenty-four single-line mutations, twenty-three of the promoter and one of `run.sh` (the second container read dropped; the empty-container refusal dropped; the runner id not compared; a gone runner counted as a claim at fault; `rm -rf` back in `admit`'s cleanup; in the sweep; the rename dropped; the once-a-day mark dropped; the start time not compared; the container's start not passed on; a stopped container accepted; a one-second allowance; the older-than-the-container refusal dropped; the claim's time not read; the build's time not read; the container's start cut to the second; the markers removed before the claims again; the second-name refusal dropped, for the claim alone, for the build alone; the entry not emptied; its log not held to once; the quiet removal logging; `run.sh` going on with the cache): each fails at least one of these tests, and no other test. ## Validation - `bun run check fast`: pass on this head (15258 unit tests pass, 0 fail). - `bun test ./scripts/self-hosted-runner.test.ts ./scripts/build-cache.test.ts`: 59 and 52 pass. - **Not run:** the launcher itself, or the promoter against real GitHub and a real docker. No launcher may be started from a session, and the installed one and its runners were not touched. Read only: the runner ids of this repository's last jobs; that `GET /repos/{owner}/{repo}/actions/runners?name=<slot>` returns the one runner of that name; and `docker container inspect` of this PC's running slots beside the jobs GitHub lists on them: five live jobs started 10 s to 21 min after their containers (a slot waits for a job), and the two jobs of 2026-11-05 still listed on slots 14 and 18 started five days before theirs. - **Not shown:** that GitHub hands a new job to a runner registered over a dead one while the dead job is still listed. If it does not, the killed-container case cannot arise; the start time refuses it either way. - Skipped: the integration and browser suites (no product code). ## For the owner After the merge, on each runner host: `rsync -a scripts/self-hosted-runner/ ~/.local/share/ovis-ci-runner/`. No restart. Until then the hosts run devswha#3585's promoter, which is safe as it is. ## Not in this PR - `run.sh` does not wait until the outbox can be emptied, as the review thread suggested: a slot that never starts takes a runner away for good, where one without the cache only builds. It does not record a slot's container for the promoter either; docker is asked instead, so no restart is needed. Should docker not answer within 10 s, the build is refused and the run's jobs build themselves. - A host whose clock runs more than about ten seconds ahead of GitHub's (the least a job starts after its container) has its builds refused (the job then looks older than its container) and its slots held off: its jobs build without the cache, and the promoter's log says why. - A build is refused when its job ended before the promoter got to it
Latest local redeployment — 2026-11-15
Deployed http://127.0.0.1:7317 at
8e0dbb303474c3a1b9e11ed87503575189c28901. This local merge preserves the prior deployment55f9541eand adds reviewed task heade466a86d(including the two fixes in97ce0cfd). The eight-file deployment delta is only this task's follow-up. The seven Codex implementation/helper/test files exactly match the reviewed head. The automatic virtual-base merge ofserver/grok.tsleaves that file unchanged from the previous deployment.Used the existing herdr plugin's stop/start actions, which load its configured environment and maintain its process ownership records. Old launcher 89703 exited; new launcher 29887 and bridge 29968 serve the same loopback address, with boot ID
331a1fcd-2ab3-4512-9377-223571d63461. Herdr was not restarted. The requested persistent Ovis service remains running. No credentials were printed or copied. Both checkouts are clean; no branch switch, remote push or GitHub merge occurred.Main115 now serves
codex-transcriptwith 7 turns through the deployed HTTP endpoint. A separate fresh lookup against the deployed checkout resolves its expected rollout01a1befe-a9e4-7733-a5b2-53bf35bb43ac. Main114 (w5C:p1) no longer exists in the live session. Its stale conversation URL returns empty scrollback. The main115 viewport contained message evidence, so this does not establish native-only live recovery.Checks run
All deployment checks ran on local deployment commit
8e0dbb303474c3a1b9e11ed87503575189c28901in/Users/hallel/code/ovis, unless explicitly stated. The earlier accepted code checks and independent round-six review remain below; no implementation was edited during deployment.git -C /Users/hallel/code/ovis merge-tree --write-tree HEAD e466a86d: before deployment, exit 0; candidate tree0b7e0ce50fd6ff2e1cf6b484cbbb266b854527d3.git merge --no-edit -m 'chore: deploy reviewed Codex conversation recovery' e466a86d: succeeded on existinghallel/custom, producing that exact tree.git --no-pager diff --no-ext-diff --exit-code e466a86d -- server/codex.ts server/codex-tool-match.ts server/codex-processes.test.ts server/codex-tool-match.test.ts server/codex.test.ts shared/entity-text.ts shared/json-text.ts: exit 0, reviewed code preserved exactly.PATH="/Users/hallel/.bun/bin:/opt/homebrew/bin:$PATH" bun run build: passed;dist/build.jsonreports the deployed revision anddirty: false. Log:$TMPDIR/redeploy-review6-build.log.HERDR_TEST_MODE=unit PATH="/Users/hallel/.bun/bin:/opt/homebrew/bin:$PATH" bun test server/codex-tool-match.test.ts server/codex-delivery.test.ts server/codex-steering.test.ts server/codex-display.test.ts server/outcome-transcript-cache.test.ts: 103 passed, 1 failed, 282 assertions. The failure is the unrelated Omo rename-race expectation inserver/outcome-transcript-cache.test.ts(Command-outcome tracking: read the transcript through the authorized handle devswha/ovis#3398); it throwsConversationUnavailable: no_session_path. Log:$TMPDIR/redeploy-review6-tests.log.HERDR_TEST_MODE=unit PATH="/Users/hallel/.bun/bin:/opt/homebrew/bin:$PATH" bun test server/outcome-transcript-cache.test.ts: isolated rerun, 24 passed, same 1 failure, 93 assertions.git --no-pager diff --no-ext-diff --exit-code 55f9541e -- server/outcome-transcript-cache.test.ts server/omo.ts server/conversation.ts: exit 0, these files are unchanged by the deployment. No claim is made that the failing test was run on the older deployment. Log:$TMPDIR/redeploy-review6-cache-isolated.log.HERDR_TEST_MODE=unit PATH="/Users/hallel/.bun/bin:/opt/homebrew/bin:$PATH" bun test server/codex-processes.test.ts -t "rerun commands|outside the native tail": 2 passed, 0 failed, 14 assertions. Log:$TMPDIR/redeploy-review6-process.log./Users/hallel/.local/bin/herdr plugin action invoke stop --plugin devswha.ovisfollowed by/Users/hallel/.local/bin/herdr plugin action invoke start --plugin devswha.ovis: plugin actions started successfully; old processes exited and new service became healthy.curl --max-time 10 -fsS http://127.0.0.1:7317/api/health | bun -e 'const h=await Bun.stdin.json(); if(!h.ok||h.web_ui.revision!=="8e0dbb303474c3a1b9e11ed87503575189c28901")process.exit(1);console.log(JSON.stringify({ok:h.ok,web_ui:h.web_ui,herdr:h.herdr,relay:h.relay.phase}));': passed, expected revision and new boot ID, herdr 0.9.5/protocol 22, relay online.curl --max-time 30 -fsS "http://127.0.0.1:7317/api/pane/conversation?pane_id=w5D%3Ap1" | bun -e 'const c=await Bun.stdin.json(); console.log(JSON.stringify({source:c.source,turns:c.turns.length})); if(c.source!=="codex-transcript"||c.turns.length===0)process.exit(1);': passed,codex-transcript, 7 turns. No conversation text logged.HERDR_SOCKET=/Users/hallel/.config/herdr/herdr.sock PATH="/Users/hallel/.bun/bin:/opt/homebrew/bin:$PATH" bun "$TMPDIR/reviewer5/live.mjs": main114 absent; main115 fresh lookup matches its expected rollout, 7 turns,toolEvidence: false. Log:$TMPDIR/redeploy-review6-live.log.urllib.request.urlopenread-only HTTP probes:/,/assets/theme-bootstrap-f10f765732.js,/assets/index-CtW-v8-C.js, and/assets/index-D1T1DrAk.cssall returned 200.lsof -nP -iTCP:7317 -sTCP:LISTEN: bridge 29968 listening on 127.0.0.1:7317.ps -p 29887 -o pid,ppid,command: managed launcher in the deployment checkout.git status --shortin both checkouts: clean.git --no-pager diff --no-ext-diff --check 55f9541e..HEAD: exit 2, reports existing blank lines at EOF in the reviewedserver/codex-tool-match.ts:170andshared/entity-text.ts:33; no deployment source edits made.Not rerun: repository-wide CI, typecheck, browser automation/screenshots or Windows install. This is an operational redeploy of reviewed code; validation covered build, the combined checkout's Codex behavior, fresh lookup and the running HTTP service. Native-only live recovery remains unverified.
Also noticed
server/outcome-transcript-cache.test.ts: Omo rename-race test fails in the deployed combined checkout; unchanged Omo/test/conversation files, outside this task's requested fixes.Local deployment
Redeployed local Ovis at http://127.0.0.1:7317 as requested. The clean /Users/hallel/code/ovis checkout stayed on hallel/custom and fast-forwarded from ce5bc58 to reviewed head 7c9783c. Its tree exactly matches merge eae1ce9; the deployed delta is only this task’s four files. No branch switch or push was performed.
The build passed. Restarted the existing managed launcher, preserving its environment in memory without writing or printing credentials. Old launcher 89632 stopped cleanly; new launcher 32529 and bridge 32537 serve the same address and state. Health reports revision 7c9783c, new boot ID 0a467508-3c22-44ce-80b5-beb788c7ba51, herdr 0.9.5 and relay online. Herdr was not restarted. The requested persistent Ovis service is left running.
Main115 was checked through the deployed HTTP endpoint: status 200, source scrollback, 0 turns. This is the previously disclosed post-compaction limitation; redeployment did not resolve it.
Merge status
Merged #34 into hallelshohat/ovis main at eae1ce9 on 2026-11-15T11:26:04Z. The merge tree d705007354fbb8a4e8953fa1d5b1a161130df167 exactly matches the reviewed head 7c9783c. Board review 4 passed with no introduced findings.
The human explicitly approved merging without the required CI checks. No CodeRabbit review ran; the required PR comment records the independent board review and the CI exception. The current worktree is clean and remains on its task branch; it was retained because this session runs in it. At merge time no release or deployment was performed; the later local deployment is documented above. Main115’s pre-existing post-compaction lookup limitation remains.
Change
Working Codex panes can lose their chat when Codex renders Markdown that Ovis's literal message matcher does not recognize. Reuse the existing rendered-message comparison for complete, substantial assistant messages under a recognized working composer. Resume recovery also distinguishes unloaded newer sessions from a still-loaded replacement, and refuses when several loaded threads leave ownership ambiguous.
Rendered matches now undergo the existing conservative competing-text check before being accepted. A conversation skipped by the raw anchor still competes:
&,&,&, and hexadecimal or letter entities can represent the same displayed text. If another candidate may show the message, lookup refuses instead of returning a different conversation and its unrelated history. This fixes review F3 without adding another decoder or changing exact-message and finished-turn matching.The F1 same-folder and cross-folder
/resumesafeguards remain passing. Tests also verify unique formatted messages, punctuation and number preservation, whole-message boundaries, quoted tool/prompt exclusions, candidate order, entity spellings, and the returned conversation response.Decisions by the human
The human requested redeploying local Ovis again after the round-five corrections passed review. Deploy the reviewed follow-up (e466a86, containing 97ce0cf), preserve other local deployment changes, and verify the running service.
After local redeployment, the human reported that main114 and main115 still have the same missing-conversation issue. Investigate and fix these remaining cases, including the previously deferred lookup limitation affecting those panes.
The human requested redeploying local Ovis with the merged fix and verifying the running service.
The human explicitly approved merging PR fix(chat): reject ambiguous rendered Codex conversations #34 without Fast checks, Integration and browser, or Native Windows install CI after being told that no checks ran and the fork has no registered runners.
The human explicitly requested merging PR fix(chat): reject ambiguous rendered Codex conversations #34 after the final board review passed; merge the reviewed change without expanding this task to the recorded pre-existing findings.
Leave the pre-existing fresh-lookup failures in w5C:p1 and w69:p1 unchanged; record them as notes for the human. Fix the introduced entity-equivalence finding F3.
Validation
Both original reviewer entity probes now refuse, and the reviewer's unique soft-wrap probe still resolves. The 24 focused tests pass. Final scoped validation reports 403 passed, 31 platform skips, and the same 4 confirmed baseline failures. All 17 isolated integration tests, 28 convention/changelog tests, and the application typecheck pass; no introduced no-smell findings.
Main115's original Markdown mismatch was previously live-verified on
38f3f097: the patched reader returned its actual rollout with 11 turns. Its recorded message still matches on this correction in a historical replay. The live pane has since compacted and changed its screen; fresh reads now returnno_session_pathon both the parent38f3f097and the correction. The 11-turn observation is the earlier live result, not a new live success on this commit. No production process, configuration, or session was changed.Checks run
Local deployment checks on 7c9783c
git -C /Users/hallel/code/ovis status --short: clean before and after deployment.git -C /Users/hallel/code/ovis merge --ff-only 7c9783cbad5420aea1365531821f66a6c6f9b29f: succeeded on existing hallel/custom branch, four changed files.git -C /Users/hallel/code/ovis diff --exit-code eae1ce92c9e6db88009dacf306ecd8291fd9821f HEAD: exit 0, deployed and merged trees identical.PATH="/Users/hallel/.bun/bin:/opt/homebrew/bin:$PATH" bun run buildin /Users/hallel/code/ovis: exit 0; log at $TMPDIR/local-deploy-build.log.curl --max-time 10 -sS http://127.0.0.1:7317/api/health: ok true, expected revision, new boot ID, herdr 0.9.5, relay online.curl --max-time 10 -sS http://127.0.0.1:7317/build.json: expected revision, dirty false.lsof -nP -iTCP:7317 -sTCP:LISTEN: bridge 32537 listening on 127.0.0.1:7317.No tests or full CI were repeated during deployment: the deployed tree is identical to the already reviewed and scoped-tested tree. No browser UI automation or screenshots; this verification used the running HTTP service.
Final code:
7c9783cbad5420aea1365531821f66a6c6f9b29f, merged as eae1ce9 with the same tree. Unless stated otherwise, checks below ran on this commit. Runtime: macOS, Bun 1.4.4, Node 26.12.0. The PATH prefix avoids the local mise shim interpreting the fixture'sexec -a codexas an actual Codex launch.HERDR_TEST_MODE=unit PATH="/opt/homebrew/bin:$PATH" bun test server/codex.test.ts server/codex-processes.test.ts -t 'rendered entity twins': regression demonstration before the fix, with the new tests and implementation still at38f3f097; all 4 tests failed by selecting the wrong candidate. Includes named, decimal, hexadecimal, letter and embedded-word entities, with both candidate orders in the pure matcher case.HERDR_TEST_MODE=unit PATH="/opt/homebrew/bin:$PATH" bun test server/codex.test.ts server/codex-processes.test.ts -t 'working Codex messages|a resumed Codex chat beside unloaded newer sessions': 24 passed, 0 failed, 99 assertions on the exact tree subsequently committed as7c9783cb. All also passed in the final-commit suite below.HERDR_TEST_MODE=unit PATH="/opt/homebrew/bin:$PATH" bun test "$TMPDIR/round3/ownership.test.ts" -t 'round3:': the reviewer's original isolated probes, 3 passed, 0 failed, 11 assertions on the exact final tree before commit. Both named/numeric cases reported safe refusal; the unique soft-wrap case returned its correct conversation.HERDR_TEST_MODE=unit PATH="/opt/homebrew/bin:$PATH" bun test server/codex-processes.test.ts server/codex.test.ts server/codex-process-store.test.ts: 403 passed, 31 skipped, 4 failed; 1300 assertions across 438 tests. The four failures match those already reproduced with the unchanged base: one macOS process-start fixture and three WAL-side-file assumptions on Bun 1.4.4/macOS. No new failures.env -u HERDR_SOCKET -u HERDR_SOCKET_PATH -u HERDR_ENV -u HERDR_PANE_ID -u HERDR_TAB_ID -u HERDR_WORKSPACE_ID -u HERDR_CONFIG_PATH XDG_CONFIG_HOME="$TMPDIR" XDG_STATE_HOME="$TMPDIR/state" OVIS_STATE_DIR="$TMPDIR/web-state" HERDR_TEST_SESSION=t HERDR_TEST_MODE=integration PATH="/opt/homebrew/bin:$PATH" bun test --timeout 15000 server/codex-binding.contract.test.ts server/codex.contract.test.ts: 17 passed, 0 failed, 108 assertions. Isolated session and state; the short session path avoids the runner's macOS socket-path limit. Cleanup confirmed its socket refuses connections.HERDR_TEST_MODE=unit PATH="/opt/homebrew/bin:$PATH" bun test server/conventions.test.ts scripts/changelog-fold.test.ts: 28 passed, 0 failed, 82 assertions.bunx tsc -p shared/vendor/paseo-e2ee/tsconfig.json --emitDeclarationOnly && bunx tsc --noEmit: passed. Vendor declarations are a prerequisite; the backend has no narrower TypeScript project.bun "$TMPDIR/check-new-smells.ts": passed, 0 introduced findings. Runsbash /Users/hallel/.claude/skills/no-smell/scripts/check.sh 08c9a5d1and compares its 85 pre-existing whole-file hits with added lines in all three changed TypeScript files. Manual review checked helper reuse, cached comparisons, validation and failure paths.bun "$TMPDIR/validate-main115.ts"andbun --preload "$TMPDIR/use-rendered-parent.ts" "$TMPDIR/validate-main115.ts": read-only comparison before commit, using the exact corrected tree and parent38f3f097respectively. Both returnedno_session_pathafter the live pane compacted; neither produced a fresh transcript. No other live panes were rechecked.bun "$TMPDIR/replay-main115-message.ts": passed on7c9783cb. Reads the actual earlier main115 commentary from a bounded portion of its rollout and replays its rendered text with a synthetic working composer; matches the original path. Uses the current valid same-folder candidate set (1 candidate); this is historical matcher validation, not live-pane/UI validation. An initial harness attempt included invalid/non-offered store rows; the final harness usescodexRolloutPath, as the production candidate selection does.git diff --no-ext-diff --checkandgit status --short: clean. The correction changes onlyserver/codex.ts, its two test files, and the changelog fragment.Not run: repository-wide fast checks, browser suites, native Windows or Linux checks. Scoped backend checks cover this correction; broader validation belongs to board/PR CI. No restart, deployment, new dependency or configuration change. The four known baseline test failures were not re-investigated. The two pre-existing pane lookup failures were left untouched as instructed. The conservative ambiguity check can retain the terminal fallback when another candidate may show the same text.
Merge preflight on 7c9783c
gh pr view 34 -R hallelshohat/ovis --json state,isDraft,headRefOid,statusCheckRollup: OPEN, ready, expected head, no checks.gh pr ready 34successfully removed draft status.gh pr checks 34 -R hallelshohat/ovis --required: no checks reported (exit 1).gh api repos/hallelshohat/ovis/actions/runners: zero registered runners.gh variable list -R hallelshohat/ovis --json name,value: no CI variables.gh api 'repos/hallelshohat/ovis/actions/runs?head_sha=7c9783cbad5420aea1365531821f66a6c6f9b29f': zero runs after marking ready. Actions are enabled and the CI workflow is active.gh api graphqlinspecting PR 34 review threads and comments: zero review threads; board review 4 passed. No CodeRabbit review exists./Users/hallel/.herdr-projects/data/bin/herdr-projects details ovis/38: latest review passed on the exact head; accepted scoped checks remain documented above.git status --shortandgit rev-parse HEAD: clean, expected head. No code changed or tests repeated during merge preflight. Required CI remains unrun; no merge, deployment, branch switch, or worktree removal occurred.Completed merge verification
gh pr merge 34 -R hallelshohat/ovis --squash --match-head-commit 7c9783cbad5420aea1365531821f66a6c6f9b29f: succeeded under explicit human approval to waive CI.gh pr view 34 -R hallelshohat/ovis --json state,mergedAt,mergeCommit,headRefOid,url: MERGED, merge eae1ce9, expected reviewed head.gh api repos/hallelshohat/ovis/branches/main: main points to eae1ce9.gh api repos/hallelshohat/ovis/git/commits/eae1ce92c9e6db88009dacf306ecd8291fd9821fandgit rev-parse 7c9783cbad5420aea1365531821f66a6c6f9b29f^{tree}: identical tree d705007354fbb8a4e8953fa1d5b1a161130df167. Earlier exact-tree tests and review apply to the merge.git status --shortandgit branch --show-current: clean, unchanged task branch. No code edits or repeated tests during merge; CI was explicitly waived, not passed.