Repository navigation
feat: gjc chat, gjc and omo marks - #39
Merged
Merged
Conversation
herdr labels a gjc pane `gjc` but names no session, so its chat fell back to scrollback. gjc writes omp's session shape into one directory per cwd (~/.gjc/agent/sessions/v2-<digest>, older ones slug-named) and keeps that directory open while it runs, so the pane's gjc process points at it through /proc (live-verified with gjc 0.17 in the test herdr session). Without /proc the directory whose cwd is the pane's is used: a v2 directory names it in .gjc-managed-session-scope.v2.json, an older one in its sessions' header. The newest session there is read with the omp parser and metadata rules under a new `gjc-transcript` source. An omp-shaped assistant message that failed (stopReason "error") carried no content, so a prompt stood with no answer; its errorMessage now shows as the answer. This covers omp and omo too. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
gjc and omo fell back to an initial in a disc. Both now have their own marks, from the project icons: gjc's mascot (gradients and glow with ids per instance, as omp's mark does) and omo's light tile. herdr labels an omo pane `pi` while it waits and `claude` while omo's claude-sdk child runs, so the sidebar showed another agent's mark, and one that changed as omo worked. The snapshots the browser gets (the machines list, /api/session, the WebSocket greeting) now name such a pane `omo`, decided by its process tree like the transcript lookup, checking only panes labelled `pi` or `claude`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
devswha
pushed a commit
that referenced
this pull request
Oct 7, 2026
…thout a pairing code (#525) ## Intent Fix mobile connection to herdr-web-ui (https://github.com/devswha/herdr-web-ui) and simplify its pairing as much as possible. The captain will always reach it over Tailscale and wants entering the Tailscale URL alone to work at once: https://denisss-macbook-pro-m1.tail5cc90b.ts.net:7317. What happened instead: the captain's phone, signed in to the SAME Tailscale account as this Mac ([email protected], the only user on this tailnet, all nodes untagged, Tailscale 1.102.4), opened that URL and was shown the device-pairing screen instead of the app - "i entered this link https://denisss-macbook-pro-m1.tail5cc90b.ts.net:7317 but it asks oairing! it can not connect!". The captain now asks to fix this pairing difficult logic. Success means: the owner's own phone opens the Tailscale URL and lands in the app immediately, no code, no pairing screen; the six-digit pairing flow remains only for devices that genuinely belong to someone else. ## What Changed - Added the opt-in `HERDR_WEB_TAILSCALE_SERVE_ONLY=1` declaration: on a tailnet that `tailscale status --json` proves is owned by a single login with no tagged node, a serve-proxied request carrying no login header is admitted as the owner, so the owner's own phone opens the serve address and lands in the app with no pairing code. The grant also requires the request's Host to name this PC's own tailnet DNS name or IP; other logins are still refused, tagged nodes and Funnel still pair or stay closed, and a configured token still overrides everything. - Reworked the Tailscale identity layer in `server/tailscale.ts`: new `parseSoleTailnetLogin` and `parseNodeName`, and an injectable `TailnetIdentitySource` class replacing the module-level `tailscaleIdentity()`, caching owner/tagged/sole-login/DNS/IP for five minutes and taking a single-flight fresh status read on the owner-grant path when the sole-login proof is unsettled or a read failed. - Extended `decideAccess` in `server/access.ts` with the serve-only owner grant (via new `hostName`, `addressesNode` and `isServeOwnerRequest` helpers, refactored out of `isLoopbackHost`), wired through `createServer` with new `tailscaleServeOnly` and `tailnet` options that also serve tests; updated the access contract in `shared/protocol.ts`, plus unit and contract tests, CHANGELOG, INSTALL, README (en/ja/ko/zh-CN) and docs/guide.md. ## Risk Assessment ✅ Low: The change is well-bounded: an opt-in flag guards the new grant, every previously authorized fix is correctly applied and verified against the code, the grant floor is enforced before any identity-dependent branch, and unit plus contract tests exercise real behavior in both directions; no defect or unrequired component was substantiated. ## Testing Every scenario derived from the intent passed live against the real product. The happy path was driven with the machine's real tailscale CLI (Tailscale 1.102.4, sole login, no tagged nodes - exactly the reported environment): with HERDR_WEB_TAILSCALE_SERVE_ONLY=1 the phone-shaped serve request is granted via tailscale and a real Chrome loading the MagicDNS URL renders the workspace with no pairing gate, while the identical request on a flag-off install gets the six-digit pairing screen the captain reported. Adversarial guards all hold live: another login refused (other_user), foreign/loopback Host pairs, Funnel pairs, a configured token still required, a tagged node appearing mid-TTL revokes the warm-cache grant on the next request, and a Starting status after wake recovers on the very next request instead of locking the owner out for five minutes; pairing a device (closing the gate) does not affect the owner's phone. New unit and contract tests for the change also pass. One incident during cleanup, fully remediated: my 'pkill -f bun server/index.ts' also matched the captain's live bridge (the supervisor spawns it with exactly that argv), taking the live 7317 install down for about two minutes; I restored it immediately with the plugin's canonical 'bun scripts/plugin.ts start' launcher - same active release (release-EqyLpU, revision c4cb041), same port, verified healthy - and no state under ~/.config/herdr-web-ui was touched. - Live validation: ✅ go - 9 of 9 scenarios driven live against the product | Scenario | Result | Live | Evidence | | --- | --- | --- | --- | | Owner's own phone opens the Tailscale URL and lands in the app immediately, no code, no pairing screen (HERDR_WEB_TAILSCALE_SERVE_ONLY=1, one-login untagged tailnet) | ✅ pass | live | live-s1-owner-phone-no-code.txt (authenticated:true via:tailscale, /api/session 200) and ui-phone-serve-only-lands-in-app.png (real Chrome at the MagicDNS hostname renders the workspace, no gate, /ws… | | With the flag off (the default), the same phone request gets the six-digit pairing flow, which keeps working for devices that belong to someone else | ✅ pass | live | live-s2-s7-guards.txt (pairing_required, 401) and ui-phone-flag-off-pairing-screen.png ('Pair this device with a code from the PC' gate); pairing a device over /api/devices/pair succeeds (live-s9-gate… | | A genuinely different Tailscale login is refused, never silently granted, even on a serve-only install | ✅ pass | live | live-s2-s7-guards.txt: Tailscale-User-Login [email protected] -> other_user refusal on /api/health and /api/session | | A tagged node appearing on the tailnet revokes the no-code grant on the next request, even from a warm cache inside the 5-minute TTL | ✅ pass | live | live-s4-s8-transitions.txt: request 3 granted from warm cache, tagged peer flips the staged status, request 4 immediately pairing_required (401); server driven over live HTTP with a staged tailscale C… | | After the Mac wakes with tailscaled still Starting, the owner is asked to pair at most once and the next request succeeds (no 5-minute negative-cache lockout) | ✅ pass | live | live-s4-s8-transitions.txt: Starting -> pairing_required, flipped to Running -> immediate next request granted via tailscale | | A rebinding page or non-serve proxy presenting its own Host gains nothing: the Host must name this PC's MagicDNS name or tailnet IP | ✅ pass | live | live-s2-s7-guards.txt: Host evil.example and Host 127.0.0.1 with forwarding header -> pairing_required; the MagicDNS name and the 100.x tailnet IP both granted (live-s1-owner-phone-no-code.txt) | | Funnel (public internet) stays closed even with serve-only on and the sole-login proof | ✅ pass | live | live-s2-s7-guards.txt: Tailscale-Funnel-Request header -> pairing_required | | A configured token is still required of everything but a paired device on a serve-only install | ✅ pass | live | live-s2-s7-guards.txt: HERDR_WEB_TOKEN install -> token_required without credentials, via:token with the bearer | | After the first device is paired (gate closed for strangers), the owner's phone still lands in the app without a code | ✅ pass | live | live-s9-gated-owner-still-in.txt: device paired over the real pairing endpoints, then the phone-shaped request still authenticated via tailscale and /api/session 200 | <details> <summary>Evidence: Owner's phone granted with no code (real tailnet, serve-only install)</summary> `GET /api/health?scope=bridge with Host=denisss-macbook-pro-m1.tail5cc90b.ts.net, X-Forwarded-For, no login header -> {"auth":{"required":false,"authenticated":true,"via":"tailscale","role":"drive"}}; GET /api/session -> HTTP 200; Host=100.110.31.92 (tailnet IP) and UPPER-CASE name also granted` ```text === S1: owner's phone (serve-proxied, no login header, Host = this PC's Tailscale name) on serve-only install (port 37611) --- GET /api/health?scope=bridge {"ok":true,"auth":{"required":false,"authenticated":true,"via":"tailscale","role":"drive"},"bridge_protocol":1} --- GET /api/session (auth-gated endpoint; phone lands in the app iff not 401) HTTP 200 --- same, Host = this PC's tailnet IP 100.110.31.92 {"ok":true,"auth":{"required":false,"authenticated":true,"via":"tailscale","role":"drive"},"bridge_protocol":1} --- Host name in UPPER CASE (same PC) ``` </details> - Evidence: Phone browser at the Tailscale URL lands in the app (serve-only on, no pairing screen) (local file: <code>~/.no-mistakes/evidence/01M48S35FX09YZE6HXK7R6VETR/ui-phone-serve-only-lands-in-app.png</code>) - Evidence: Same URL on a flag-off install shows the six-digit pairing screen (the reported bug, still the default) (local file: <code>~/.no-mistakes/evidence/01M48S35FX09YZE6HXK7R6VETR/ui-phone-flag-off-pairing-screen.png</code>) <details> <summary>Evidence: Guards: flag off pairs; other login refused; foreign Host pairs; Funnel pairs; token still required</summary> ```text --- Host name in UPPER CASE (same PC) {"ok":true,"auth":{"required":false,"authenticated":true,"via":"tailscale","role":"drive"},"bridge_protocol":1} === S2: SAME phone request on an install WITHOUT the flag (port 37613, default) -> six-digit pairing remains --- /api/health?scope=bridge {"ok":true,"auth":{"required":true,"authenticated":false,"reason":"pairing_required"},"bridge_protocol":1} --- /api/session status code HTTP 401 --- /api/session refusal body {"error":{"code":"unauthorized","message":"pair this device, or use the token"}} === S3: someone else's Tailscale login is refused on the serve-only install (port 37611) {"ok":true,"auth":{"required":true,"authenticated":false,"reason":"other_user"},"bridge_protocol":1} {"error":{"code":"other_user","message":"this PC belongs to another Tailscale user"}} === S5: rebinding/foreign Host gains nothing on the serve-only install (port 37611) {"ok":true,"auth":{"required":true,"authenticated":false,"reason":"pairing_required"},"bridge_protocol":1} HTTP 401 --- Host = plain 127.0.0.1 loopback name with forwarding header (a local proxy that is not serve) {"ok":true,"auth":{"required":true,"authenticated":false,"reason":"pairing_required"},"bridge_protocol":1} === S6: Funnel (public internet) stays closed on the serve-only install (port 37611) {"ok":true,"auth":{"required":true,"authenticated":false,"reason":"pairing_required"},"bridge_protocol":1} === S7: a configured token is still required of the phone on a token install (port 37617, serve-only on) --- phone-shaped request, no token {"ok":true,"auth":{"required":true,"authenticated":false,"reason":"token_required"},"bridge_protocol":1} {"error":{"code":"unauthorized","message":"token required"}} --- with the token as bearer {"ok":true,"auth":{"required":false,"authenticated":true,"via":"token","role":"drive"},"bridge_protocol":1} ``` </details> <details> <summary>Evidence: Status transitions: Starting recovers next request; tagged node revokes warm-cache grant inside TTL</summary> ```text === S8: Mac wakes, tailscaled still 'Starting' -> owner asked to pair once, then recovers on the NEXT request --- status: BackendState Starting (what tailscale status --json says right after wake) Starting - {'7': {'LoginName': '[email protected]'}} --- request 1 (serve-only install, port 37619, phone shape, no login header) {"ok":true,"auth":{"required":true,"authenticated":false,"reason":"pairing_required"},"bridge_protocol":1} --- tailscaled reaches Running (one login, no tags) - the SAME minute, well inside the 5-minute cache TTL --- request 2, immediately: the grant path must re-read, not answer the stale negative {"ok":true,"auth":{"required":false,"authenticated":true,"via":"tailscale","role":"drive"},"bridge_protocol":1} HTTP 200 === S4: a node gets tagged while the cache is warm (Running sole -> Running with tagged peer), inside the TTL --- request 3 (cache already proved sole login on request 2): still granted {"ok":true,"auth":{"required":false,"authenticated":true,"via":"tailscale","role":"drive"},"bridge_protocol":1} --- a tagged node joins the tailnet (status flips; still well inside the 5-minute TTL) --- request 4, immediately: the warm cache must NOT keep granting; the no-login request pairs again {"ok":true,"auth":{"required":true,"authenticated":false,"reason":"pairing_required"},"bridge_protocol":1} HTTP 401 ``` </details> <details> <summary>Evidence: After pairing a device (gate closed) the owner's phone still gets in; strangers still pair</summary> ```text === S9: pair a device first (closing the gate for strangers), then re-check the owner's phone --- POST /api/devices/pair/start from this PC (localhost, local access) {"code":"584600","expires_at":"2026-10-06T14:59:46.697Z"} --- POST /api/devices/pair with code 584600 (as a stranger's device would) HTTP 204 (device cookie set) --- owner's phone after the gate closed (no cookie, no token, serve-only install) {"ok":true,"auth":{"required":false,"authenticated":true,"via":"tailscale","role":"drive"},"bridge_protocol":1} HTTP 200 --- stranger-shaped serve request after the gate closed {"ok":true,"auth":{"required":true,"authenticated":false,"reason":"pairing_required"},"bridge_protocol":1} ``` </details> ## Pipeline Updates from [git push no-mistakes](https://github.com/kunchenguid/no-mistakes) <!-- no-mistakes-pipeline-attestation:v1 {"head_sha":"15c2bd4db0c4eed4f624e0e59da4cdf82b222df5","steps":[{"step":"intent","status":"completed"},{"step":"rebase","status":"completed"},{"step":"review","status":"completed"},{"step":"test","status":"completed"},{"step":"document","status":"completed"},{"step":"lint","status":"completed"},{"step":"push","status":"completed"},{"step":"pr","status":"running"},{"step":"ci","status":"pending"}]} --> <details> <summary>✅ **intent** - passed</summary> ✅ No issues found. </details> <details> <summary>🔧 **Rebase** - 1 issue found → auto-fixed ✅</summary> -⚠️ `CHANGELOG.md` - merge conflict rebasing onto origin/main 🔧 Fix applied. ✅ Re-checked - no issues remain. </details> <details> <summary>🔧 **Review** - 2 issues found → auto-fixed (2) ✅</summary> -⚠️ `CHANGELOG.md:65` - The new serve-only entry sits inside the `## [0.3.52] - 2026-10-06` `### Fixed` section (header at line 64), but the base commit 54e5a1f is already past the v0.3.52 release prep, and `## [Unreleased]` has its own `### Fixed` section at line 16. This branch's change is unreleased work attributed to a shipped version; at the next release prep it stays stranded inside the historical 0.3.52 block instead of moving with [Unreleased]. This is the previously authorized fix (recorded decision `changelog-entry-under-released-0.3.52`) still unapplied at this head. Remedy: move the 8-line entry (lines 65-72) up under `## [Unreleased]` → `### Fixed`, appended after the existing Codex entry; the PR link is added later by the pipeline's PR step. - ℹ️ `server/index.ts:1029` - The grant-path predicate `token === "" && pairedDevice === null && isServeOwnerRequest(requestShape)` is path-blind, so on a serve-only install every phone-shaped request — including static assets (JS/CSS/icons/sw.js), `/api/health` without scope, `/api/auth` and `/api/devices/pair` — awaits a fresh `tailscale status --json` spawn in `freshIdentity` (server/tailscale.ts:255-259 skips the early return only when the cache proves sole-login and the Host matches, i.e. exactly the phone's case). For non-`/api`/non-`/ws` paths the computed `access` is never consulted (static serving falls through; `requiresAuth` and the readOnly/mutating checks are all gated on `/api/` or `/ws`), so the read adds one bounded CLI spawn plus its latency (~20-100 ms, 2.5 s worst case) to each such response on the intended happy path (first phone page load pays one spawn per asset wave) while buying nothing. Remedy: add `(pathname === "/ws" || pathname.startsWith("/api/"))` to the grant-path predicate — behavior-preserving for every response, since `/api/*` (including `/api/health?scope=bridge`, the one open endpoint that reports auth) and `/ws` are the only paths that observe `access`. 🔧 Fix applied. 1 warning still open: -⚠️ `docs/guide.md:213` - The changed sentence says "Your own devices get in without a code only when you set HERDR_WEB_TAILSCALE_SERVE_ONLY=1 ... Without it, the phone pairs with a six-digit code." That contradicts the rest of the change's own documentation and the code: `tailscale serve` stating the owner's login already grants entry with no flag (server/access.ts:121, guide.md:259 "A login that matches this PC's own gets in", guide.md:267 "Nothing needed: your login", INSTALL.md:156-157 "Nothing to configure"). The flag exists precisely for the requests where serve states no login (the reported Tailscale 1.102.4 phone case), not as the only codeless path. A reader who takes the sentence at face value enables a security-relevant flag (full owner access for no-login proxied requests) they may not need. Siblings carrying the same "set the flag to get codeless phone access" framing: README.md:94, README.ja.md:96, README.ko.md:95, README.zh-CN.md:96. Remedy: qualify the sentences the way INSTALL.md:157 already does — your devices get in without a code when serve states your login; if your own phone is asked to pair anyway, HERDR_WEB_TAILSCALE_SERVE_ONLY=1 lets it in without a code on a one-login tailnet, enabled only when nothing else reaches the port. 🔧 Fix applied. ✅ Re-checked - no issues remain. </details> <details> <summary>✅ **Test** - passed</summary> ✅ No issues found. - Live validation: ✅ go - 9 of 9 scenarios driven live against the product | Scenario | Result | Live | Evidence | | --- | --- | --- | --- | | Owner's own phone opens the Tailscale URL and lands in the app immediately, no code, no pairing screen (HERDR_WEB_TAILSCALE_SERVE_ONLY=1, one-login untagged tailnet) | ✅ pass | live | live-s1-owner-phone-no-code.txt (authenticated:true via:tailscale, /api/session 200) and ui-phone-serve-only-lands-in-app.png (real Chrome at the MagicDNS hostname renders the workspace, no gate, /ws… | | With the flag off (the default), the same phone request gets the six-digit pairing flow, which keeps working for devices that belong to someone else | ✅ pass | live | live-s2-s7-guards.txt (pairing_required, 401) and ui-phone-flag-off-pairing-screen.png ('Pair this device with a code from the PC' gate); pairing a device over /api/devices/pair succeeds (live-s9-gate… | | A genuinely different Tailscale login is refused, never silently granted, even on a serve-only install | ✅ pass | live | live-s2-s7-guards.txt: Tailscale-User-Login [email protected] -> other_user refusal on /api/health and /api/session | | A tagged node appearing on the tailnet revokes the no-code grant on the next request, even from a warm cache inside the 5-minute TTL | ✅ pass | live | live-s4-s8-transitions.txt: request 3 granted from warm cache, tagged peer flips the staged status, request 4 immediately pairing_required (401); server driven over live HTTP with a staged tailscale C… | | After the Mac wakes with tailscaled still Starting, the owner is asked to pair at most once and the next request succeeds (no 5-minute negative-cache lockout) | ✅ pass | live | live-s4-s8-transitions.txt: Starting -> pairing_required, flipped to Running -> immediate next request granted via tailscale | | A rebinding page or non-serve proxy presenting its own Host gains nothing: the Host must name this PC's MagicDNS name or tailnet IP | ✅ pass | live | live-s2-s7-guards.txt: Host evil.example and Host 127.0.0.1 with forwarding header -> pairing_required; the MagicDNS name and the 100.x tailnet IP both granted (live-s1-owner-phone-no-code.txt) | | Funnel (public internet) stays closed even with serve-only on and the sole-login proof | ✅ pass | live | live-s2-s7-guards.txt: Tailscale-Funnel-Request header -> pairing_required | | A configured token is still required of everything but a paired device on a serve-only install | ✅ pass | live | live-s2-s7-guards.txt: HERDR_WEB_TOKEN install -> token_required without credentials, via:token with the bearer | | After the first device is paired (gate closed for strangers), the owner's phone still lands in the app without a code | ✅ pass | live | live-s9-gated-owner-still-in.txt: device paired over the real pairing endpoints, then the phone-shaped request still authenticated via tailscale and /api/session 200 | - `HERDR_TEST_MODE=unit bun test ./server/tailscale.test.ts ./server/access.test.ts (35 pass)` - `bun test ./server/api.contract.test.ts -t serve (both new serve-only contract tests pass against the isolated herdr-web-ui-test herdr session)` - `Live HTTP drive, real tailscale CLI reading the machine's real one-login tailnet: phone-shaped request (loopback source, X-Forwarded-For, no Tailscale-User-Login, Host=denisss-macbook-pro-m1.tail5cc90b.ts.net) against a real bun server/index.ts instance with HERDR_WEB_TAILSCALE_SERVE_ONLY=1 -> /api/health?scope=bridge reports authenticated:true via:tailscale; /api/session 200; tailnet-IP and upper-case Host variants also granted` - `Live HTTP drive, same request against a flag-off instance -> pairing_required (401 unauthorized body); stranger Tailscale-User-Login -> other_user; evil.example and 127.0.0.1 Host -> pairing_required; Tailscale-Funnel-Request header -> pairing_required; HERDR_WEB_TOKEN install -> token_required without credentials, via:token with bearer` - `Live HTTP drive with a staged fake tailscale CLI on PATH: BackendState Starting -> pairing_required once, then Running sole-login -> granted on the very next request inside the 5-minute TTL; warm-cache sole-login grant -> a tagged peer appearing in status -> pairing_required immediately` - `Live HTTP drive: paired a device over /api/devices/pair/start + /api/devices/pair (gate closed), then the owner's phone request still granted and stranger-shaped requests still pairing_required` - `Playwright (real Chrome, host-resolver mapping the MagicDNS name to the test server, phone viewport): the app loads at http://denisss-macbook-pro-m1.tail5cc90b.ts.net:37611/ with no pairing gate and an open /ws; the same URL on the flag-off server shows the 'Pair this device with a code' gate; screenshots captured` - `Cleanup verification: all four test servers stopped, herdr-web-ui-test session stopped, worktree returned to clean (transient .nm-test, dist, .playwright artifacts removed), captain's live install on 7317 verified healthy` </details> <details> <summary>✅ **Document** - passed</summary> ✅ No issues found. </details> <details> <summary>✅ **Lint** - passed</summary> ✅ No issues found. </details> <details> <summary>✅ **Push** - passed</summary> ✅ No issues found. </details> Co-Authored-By: Claude Fable 5.1 <[email protected]>
devswha
added a commit
that referenced
this pull request
Oct 21, 2026
The read-back tests use Bun.markdown.html (Bun >= 1.4 is already required) with GFM autolinks instead of a marked devDependency, so package.json and bun.lock are back to main. The assertions are unchanged; the helper writes the reader's HTML in one spelling (an apostrophe as ', a void tag without " /"). The three read-back tests still fail against the serializer of 82b50fa7 and pass now.
devswha
added a commit
that referenced
this pull request
Oct 29, 2026
…e, and close the omp Ask review follow-ups (#2280, #2233) (#2320) Closes #2280. Closes #2233. ## What it does for the user - **#2280:** an omp started from its npm package shows its approval card in Chat again. bunx and npx run the package's `bin`, `node_modules/@oh-my-pi/pi-coding-agent/dist/cli.js`, under bun or node. Before this, the foreground-ownership check from #2245 did not count that process as omp, so the card was hidden and the answer had to be given in the terminal. - **#2233:** the follow-ups from the #2220 review. - **Mermaid:** an omp Ask question with a ```` ```mermaid ```` fence keeps the card as drawn. The chat would draw a diagram where omp shows the code. - **Look-alike options:** an Ask card whose options would read alike on the card also stays as drawn. Examples: spacing twins, one link's words with two addresses, rows that differ only by case. - **Cross-script look-alikes:** a typed answer no longer picks one of two rows that look alike across scripts, such as `Keep **production**` beside `Keep **prоduction**` with a Cyrillic `о`, or Greek `ο`, capital Cyrillic `Р` or `І`, and the digit `0` beside `o`. Typing either name gives the typed answer, or is refused when the card has none. - **Row numbers (the relaxation the issue offered):** a typed row number picks its row even when that row's name looks like another row's. The card shows each row's number, so typing it is the same as clicking the row. This brings back a typed way to choose between look-alike rows. A row whose own name is that number still comes first. - **Separators only:** on a multiple choice, `,,,` or spaces alone are the typed text (or refused), never `{option_indices: []}`, which made `answerKeys` throw. ## How - **`server/conversation.ts` `agentProcesses`:** recognises an agent's npm entry point (`NPM_ENTRIES`; only omp's for now) when bun or node runs it, like `PI_NPM_ENTRY` in `server/pi.ts`. Python running that path is not omp. `ompOwnsInput`, outcome binding and `agentProcessInFront` all pick from here. - **`server/omp-ask.ts`:** a `mermaid` fence in the question is undrawn, so the card stays as drawn. After a call matches, the card's option labels as the card draws them (`cardDrawn`, folded like `spaced` in promptAnswer) must be distinct; otherwise the card stays as drawn. - **`src/lib/promptAnswer.ts`:** - `skeleton()` folds case first (D146, as before), then maps every letter Unicode's confusables.txt (UTS #39) draws like one ASCII letter or digit to it, then folds again. Folding first keeps case twins together: a capital `I` stays `i`. - The table is `src/lib/confusables.generated.ts`, 1363 entries. It holds only the subset whose target is one ASCII letter or digit. - A typed number reads only literal row names before the number, not skeleton look-alikes. - **`scripts/generate-confusables.ts`:** new; it generates that table. - **Source pins:** `scripts/generate-case-folding.ts` and the new script check the source's SHA-256 before parsing. Both the download and `--source` are refused when the bytes differ from the reviewed file, verified against the official 17.0.0 files. `generate:confusables` is in package.json, and the regeneration steps in docs/development.md. - **`server/omp.contract.test.ts`:** setup and the handoff test now wait on herdr event subscriptions instead of polling. The stand-in notes its key before it draws the screen the test waits for. A new contract test starts a stand-in at `.../node_modules/@oh-my-pi/pi-coding-agent/dist/cli.js` under bun; it names itself omp through `prctl`, as omp 18.13.2 does. The test asserts the approval card. It runs on Linux only. ## Verification - **Tests that fail before the fix:** - unit: 5 failures in `agent-process`, `omp-ask` and `promptAnswer`; - the new #2280 contract test with `conversation.ts` reverted: `/api/pane/prompt` returns `null`; - a probe on main gives `,,,` → `{"option_indices":[]}`, while the Cyrillic and Greek twins each pick a row; - main's generator accepts a CaseFolding.txt with one mapping changed and rewrites the table. - **After the fix:** - `bun run check fast`: green, 8431 unit tests pass, 0 fail; - `bun run check run bun test --timeout 15000 ./server/omp.contract.test.ts` on the isolated herdr: 6 pass; - `generate:case-folding --check` and `generate:confusables --check` both pass. - **Remote bundle (#2233's open point):** - `bun run build:remote` built `herdr-web-ui-linux-x64.tgz`, which carries `shared/markdown.ts`. - The bundle's own Bun (1.4.3) and Bun 1.4.2 both load it. Each draws the recorded 18.13.2 Ask card in Markdown and recognises the npm entry. - `scripts/remote-bundle-smoke.ts` fails on this host, and on origin/main too (no bridge descriptor there, a 404 from `/api/bridge` here), so it is not evidence either way. On this PR, CI's Remote PC bundles workflow built and smoke-tested the bundle on linux-x64, linux-arm64, both macOS runners and Windows: all green. - **`REMOTE_BUNDLE_VERSION`:** not raised. Per docs/development.md, a release PR raises it. ## Reviews **omo-native-code-reviewer:** one HIGH and four LOW. - **HIGH H1:** look-alike letters were mapped before case folding, so `I` became `l` and case twins split. Fixed by folding first; regression cases and a property that every case-folding pair keeps one skeleton are added. - **L1:** the contract test is Linux-only with a 30 s timeout. Done. - **L2:** the alike check also refuses case-only twins and equal labels with different descriptions. Kept; the card then shows omp's own rows. - **L3:** `node --inspect …/cli.js` is not recognised. This fails safe: no card and no keys. - **L4:** the forged test inputs are large. Kept; they are the minimum the entry count needs. **Codex Sol 6.1 fast xhigh:** - **Round 1:** three MEDIUM. - Python running the npm entry was accepted. Fixed: bun and node only. - Same as H1, with the pair `Keep API.` / `Keep api!`. Fixed. - Row numbers were refused for digit-shaped labels (`I`, `l`, typed `1`). Fixed: skeleton-only look-alikes no longer block a number. - **Round 2,** on the new code only: APPROVE, all three verified. ## Known limits (from #2233) - **Over-refusal:** names that differ only by punctuation or spacing (`Keep production` vs `Keep [production]`, `Keep-production`, `<https://…>` vs a bare URL) still share a skeleton, so typing either name gives the typed answer. Their row numbers and a click pick them. - **Not covered by confusables:** confusions that are not one ASCII letter or digit, such as two non-Latin letters, or `m` and `rn`. - **Compatibility characters:** math-bold `𝐈` takes its plain letter's skeleton (`i`), not `l`. - **Polling left:** the other polling in `omp.contract.test.ts` (the stopped-omp test) already used subscriptions. Nothing else polls there now.
devswha
added a commit
that referenced
this pull request
Nov 17, 2026
## What Part 8 of 9 for `src/` in the repo-wide comment pass. This part covers: - **`src/components` from `ConnectPhoneDialog` to `InboxMode`:** the phone QR dialog, conversation search, devices, the directory browser, droplets, the files dialog and viewer, first-start hints, the find bar, highlighted code, the image lightbox and the inbox list, with their CSS - **`src/components` from `SessionHistory` to `SignOutRow`:** settings controls and the settings dialog, the setup guide and the sidebar, with their CSS - **`src/lib`:** pending messages, the phone and plugin runs, Portal, preferences sync, pressed buttons, prompt answers and text, push and push health, receipt resume, the reconnect grace, recent directories, and the relay account controller, boot, channel and dashboard - the tests of all of these About 3,200 comment lines go. Security notes, platform facts, measured values, third-party attributions, and traps that name a concrete breakage stay (the owner's rule for comment-removal PRs). What else stays: - **Machine-read and attribution lines:** the `// fixed wait:` markers (`DevicesPanel`, `relay/accountController.ts`), "adapted from Agent of Empires (MIT)" in `pushHealth.ts`, and the pinned Unicode tables in `promptAnswer.ts` (CaseFolding.txt, confusables.txt / UTS #39). Every change was checked against `origin/main` by syntax tree (CSS with comments stripped). No test, script or doc reads a deleted comment, and no code changes. The one `eslint-disable-line react-hooks/exhaustive-deps` in `FirstStartHints.tsx` stays, as lint directives do. This PR touches relay sign-in and pairing (`src/lib/relay/accountController.ts`, `boot.ts`, the `channel.ts` tests), the devices panel, queued input (`pendingMessages.ts`) and the file viewer's sandbox, with comments and no code changed there, so it waits for a real review (AGENTS.md). ## Rules that only a comment stated (deleted, not enforced yet) - **Preferences sync (`preferencesSync.ts`):** a made-up mute list is never sent to a server that keeps none. - **Push:** a later enable queues a new registration after a removal; registrations and removals keep click order; no probe push is ever sent, and a transient failure is never a notice. - **The relay account (`relay/accountController.ts`):** an earlier sign-in's read never holds back the next. - **Lists and pickers:** - `InboxList`: a query never narrows the list unseen; a failure is never taken for "Loading…" or an empty list. - `Sidebar`: pins of workspaces gone from this PC leave only by a change the user makes. - **Smaller rules:** - `FirstStartHints`: nothing takes the keyboard from the pane, and nothing is announced. - `recent-directories.ts`: missing panes never delete history. - `receiptResume.ts`: the storage shape must not change. - `SettingsControls`: every theme's raised background and strong border stay opaque; five or more options go in a select. `SettingsDialog`: the web server, not a PC, keeps the bridge-update choice. `SetupGuide` adds no server route, and its line breaks come from `text-wrap` only. `Sidebar.css`'s row-fill and grid tokens are aliases only. ## Left open (redesigns, not done here) - **Hand-kept copies that could live in `shared/`:** `pendingMessages.ts HELD_RECEIPT_MS` copies `server/core/pending.ts`'s `PI_RESUME_MS`; `promptText.ts`'s `12_000` copies the server's `finishPrompt` body cap. - **State machines in components and hooks:** - `ConnectPhoneDialog AccountQr` could be a QR-session hook (press, shown, take-down, notice) and a view; its `run` counter could be an `AbortController` per press, `ending` a handle the take-down returns, `endShownCode` a typed result, `pcAccount` a tagged union. - `PendingMessageStore`'s seven parallel maps need a typed state per row; `usePreferencesSync`'s ~20 refs are a send state machine (a reducer). - `InboxList`'s held row order and opening focus could be `useHeldOrder` and `useOpeningFocus`; its `restoring` ref has two meanings. - **Stale-answer guards:** `DevicesPanel`'s three guards, `ConversationSearch`'s `pickSerial`, `pushHealth.ts`'s two counters; one request sequencer or `AbortController` each. - **Values with several meanings:** `pushHealth.ts endpoint`, `relay/accountController.ts PairingConsent` and `deletion`, `promptAnswer.ts nameOf()`. - **Smaller items:** - `push.ts`'s module-global `recovered` handshake. - `FirstStartHints`' locate effect leaves out `finish` (`useEffectEvent`). - `Droplet.tsx DISMISS_VELOCITY` keeps its unit only in a removed comment (`_PX_PER_MS`). - `SettingsControls useRowSentence`'s cleanup check exists for a test window without timers. - `SetupGuide FocusTitle` draws nothing so a layout effect runs before the focus trap reads it. ## Validation - `bun run check fast`: passed (18,593 unit tests, typecheck, build, generated themes and types). - Unit tests of every touched test file and of the modules that import a touched one: 17 + 47 + 12 files, both `conventions.test.ts` and `i18n.test.ts` included. All pass. - Not run: browser regressions (comments only). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gjc panes had no chat view, only a scrollback fallback. herdr labels them
gjcbut gives no session, and the server only knew the Claude, omp, omo and Codex stores.Where gjc keeps its conversation. Checked on this machine with gjc 0.17.2 in the isolated test herdr session:
session/messageentries, andtoolCall/toolResult.~/.gjc/agent/sessions/v2-<digest>. Older directories are slug-named, like-Desktop..gjc-managed-session-scope.v2.json(canonicalPath)./proc/<pid>/fdof the pane's gjc process points straight at it.Resolution (
gjcTranscriptPath):gjcprocess through/procto its open session directory./proc(macOS), use the directory whose cwd is the pane's. A v2 directory gives it in its scope file, an older one in its sessions' header. This mapping is cached, since a directory's cwd never changes.gjc-transcriptsource, with the omp parser and metadata rules.Failed requests show their error. An omp-shaped assistant message that failed (
stopReason: "error") has no content, so the chat showed the prompt with no answer. ItserrorMessagenow shows as the answer. This covers omp and omo too.gjc and omo marks
gjc and omo used to fall back to an initial in a disc. They now have their own marks, from the project icons: gjc's mascot and omo's light tile. The gjc mark keeps its gradient and filter ids per instance, as omp's mark does.
herdr labels an omo pane
piwhile it waits andclaudewhile omo's claude-sdk child runs. So the sidebar showed another agent's mark, and the mark changed as omo worked. The snapshots the browser gets now name such a paneomo:/api/sessionThe name is decided by the process tree, and only panes labelled
piorclaudeare checked. I verified it live:/api/sessionnames real gjc and omo panesgjcandomo, and the sidebar shows both marks.Testing
/api/pane/conversationansweredsource: gjc-transcript, with the user turn and metadataglm-5.3/inherit.gpt-5.6-sol/medium.no_session_path.bun run typecheckpasses andbun testpasses 312/312.bun run test:uipasses 7/7 andscripts/chat-browser-qa.tspasses 5/5./tmp/gjc-*.🤖 Generated with Claude Code