Repository navigation
fix(chat): follow-ups from the agent command forms review - #1893
Conversation
A failed read of the pane's command list left it empty until the pane, agent or PC changed, so the menu showed nothing and a terminal command sent from Chat got no terminal handoff. A failed read now keeps the list the pane had and asks again after 2, 5, 15 and then every 30 seconds. Refs #1444
pi's /model, /thinking, /name, /login, /import, /export and /bug forms for an argument used { sub: "*" }, which the protocol does not define: the client read it as the literal subcommand "*", fell back to the bare form, and so took /name Release 1 for a terminal screen. They now use "other", the form the protocol defines for any other argument, and the server's outcome matcher drops its own reading of "*".
Refs #1444
paneProcessRoots took the first omo-looking foreground process, held or not, so an unheld one listed before the real omo (omo's bundled Claude SDK binary under /omo-ai/, a helper script) made typing fall back to herdr's label. It now prefers the process that holds a session and keeps the first one only when none does. omoProcessIdentity says whether its holder counts (held: a holder and a readable start), so the lookup no longer reads the start a second time (a second ps on macOS). Refs #1444
… too OpenCode's source had one pin, 1.19.3, so on a v2 pane the builtins both TUIs share were always listed as unverified while the v2-only extras verified against 2.0.32. A source may now name one pin per TUI, and OpenCode names both.\n\nRefs #1444
Claude's command echoes were dropped for every name in Claude's reference, its bundled skills (code-review, debug, loop, simplify...) included, so neither those skills nor a skill of the user's own named like one showed as skill activity. Only Claude's own commands are left out now.\n\nRefs #1444
…d of pinning its words Refs #1444
…lookup on every platform The Linux-only omo block also held a case that needs no /proc, so it never ran on macOS; it runs everywhere now, beside a new case for the access check right after a Hermes pane's process lookup (removing that check fails it). Refs #1444
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CodeRabbit hit its review limit on this PR, so here are the agent reviews and how each point was resolved: omo-native-code-reviewer: APPROVE, 5 LOW notes:
Codex (gpt-6.1-sol, xhigh reasoning): APPROVE, 2 LOW notes:
Both reviewers checked the security role of the held-omo choice. Only |
|
Merge pass gate review of 914065a: one blocker (MEDIUM). An older retry's answer can overwrite the newer list in the shared command cache. Reproduced with fake timers and controlled responses
Code: Fix: clear the pending retry when an invalidation or any new read starts, or give each read a sequence number and let only the newest one write to the cache. Please add a regression test that remounts after the out-of-order answers and expects the newer list. Holds
The merge pass re-checks the fix commit, looking only at the changed range. |
…wer out of order The merge pass found that after a failed read, a catalog change and the pending retry can start two overlapping reads of a pane's commands. When the later read answered first, the earlier one's answer then overwrote the shared cache, so a remount showed the older list without asking again. Each read now has a sequence number, and only the read started last for that pane and agent writes the cache. Refs #1444
|
Fixed in 452f3f9: the out-of-order retry and refresh.
The earlier Integration tests failure was infrastructure: "The self-hosted runner lost communication with the server" on herdr-ci-...-P620-3. This push reruns it. |
|
Merge pass review-work report. Overall: PASSED.
The fix in 452f3f9
Held from the gate
All required checks are green and no review thread is open. CodeRabbit did not review this PR (rate-limited or skipped). The reviews above stand in for it. |
## Change Follow-ups from #1399's review (#1445), for Command Code (`cmd`) panes. Per item: - **2, the footer check was strict** (`server/dialogs/cmd.ts`, `server/dialogs/live.ts`): a permission prompt now gets its card when its footer wraps (split hint, word or character wrap) or uses the ctrl+e / ctrl+y variants. These are the shapes the published `command-code` 1.88.0 renderer draws (read statically from the npm package; the CLI was never run or logged into). A stale or incomplete footer, or anything drawn below it, still gives no card. Normal status chrome is hidden while a permission dialog is open, so it cannot sit under the footer. - **LOW, an ordinary numbered menu was labelled an approval card**: a menu is an approval card only when its rows are Command Code's own Yes … No choices, so a theme picker with the same footer is not one. - **4, herdr's model stuck in the transcript cache** (`server/conversation.ts`, cmd metadata branch only): the served model follows the pane's current model, and the ETag changes with it. The response is a new object, so the cached page is never mutated. herdr's live model now also replaces a model recorded in the transcript, which is what the item asks for. This branch is only reached where herdr reports the pane's Command Code session, which no released herdr does yet (#1647), so the changelog entry says so. - **5, store validation copied from `server/pi.ts`**: both now use `server/transcript-store.ts`. Behaviour is identical, and the old names are re-exported. - **6, test gaps**: tests for the cmd metadata branch, for the keys each answer sends from every cursor position, and for refusing a stale card over HTTP (409 `prompt_changed`, no keys sent). Session resolution and the skills source were already covered. - **LOW**: the unused `CmdTranscriptOptions.home` is removed. **Not fixed** - **1, the card id covers everything above the rows**, so a card goes stale when output above an open dialog redraws, as before. Narrowing the id to the dialog was tried and reverted: two review rounds showed that command text (a heredoc) can imitate the dialog's frame, including its real layout (rule, blank line, heading, subtitle). Then two different commands got the same id, and a stale card could be answered. Doing this safely needs Command Code to expose the dialog, or a capture proving a boundary that command text cannot imitate. A test pins the safe behaviour. - **LOW, a multi-line command's title**: left as main draws it, for the same reason (it would need the same boundary guess). - **3, the shell's cwd won over the agent's**: already fixed on main by #1745. - **LOW, the comment saying the body is part of the id**: it is accurate with main's id, which covers everything above the rows, the body included. Fixes #1445 ## Verification - New tests fail on origin/main and pass here: footer shapes, the Yes/No menu check, the model and ETag refresh without a transcript append, and the answer keys. Tests from the reviews are kept as regressions. Heredoc and indentation changes give different ids, a quoted dialog frame in the real layout gives different ids, and file-permission card bodies equal main's. The stale-card route test gets 409 with no keys sent. - Single-file runs after the rebase onto main: `server/cmd.test.ts` 56 pass, `server/prompt.test.ts` 357 pass, `server/cmd-conversation.test.ts` 2 pass, `server/pi.test.ts` 31 pass, `server/dialogs/registry.test.ts` 55 pass, `server/dialogs/interaction-plan.test.ts` 23 pass, `server/dialogs/claude.test.ts` 13 pass. - Live check over HTTP, against a real headless herdr session of its own (not a fake socket) and the server's `/api/pane/prompt` routes. A pane reported as `cmd` drew Command Code's shell permission dialog at 80 columns, where the terminal wraps the footer mid-word (`… bypass all perm` / `issions (Docs ↗)`): - this branch: an approval card with Yes / Yes, don't ask again / No. origin/main: only the generic fallback card (↑ ↓ Enter Esc). - a theme picker with the same footer: this branch gives the generic menu card; origin/main labels it an approval card titled "Theme". - a line redrawn above the open dialog gives a new id; answering the old id gets 409 `prompt_changed` and no byte reaches the pane; answering the new id sends only Enter. - Reviews: - Round 1: omo-native-code-reviewer and Codex (gpt-6.1-sol, xhigh) each found a HIGH in the narrowed card id (a heredoc hiding the command prefix). - Round 2: both found more ways around the narrowing, and file cards showing the whole screen. That led to restoring main's id. - Round 3: both APPROVE with no HIGH or MEDIUM. - After the rebase (one import conflict in `server/pi.ts`, where main's #1899 added `fileURLToPath`): Codex (gpt-6.1-sol, xhigh) reviewed the rebase against the new main (#1899's store and agent directory code, #1893's cache ordering, #1890's dialog reader order) and APPROVED with no findings. - `bun run check fast` on this head: workflow syntax, generated types and themes, typecheck, build and unit tests ok (6800 pass, 0 fail, 13 skip). --------- Co-authored-by: mp <mp@local>
Change
Follow-ups from #1441's review (#1444). Per item:
Fixed
src/lib/usePaneCommands.ts): a failed read now keeps the list the pane already had and asks again after 2, 5 and 15 s, then every 30 s while the pane is open. Before, the list stayed empty until the pane, agent or PC changed. When a retry and a refresh overlap, only the read started last writes the shared cache, so an older answer cannot replace a newer list (found by the merge pass).server/skills/pi.ts,server/outcome.ts):{ sub: "*" }is not a form the protocol defines. The client read it as the literal subcommand*and fell back to the bare form, so/name Release 1was taken for a terminal screen. These forms now use"other", which the protocol and the client already define for any other argument. The server's outcome matcher no longer reads"*", and no catalog emits it any more.CommandOutcome,outcomesandinvalidatePaneCommandsare in use since feat(chat): show what became of a sent command, from evidence only #1450 (GET /api/pane/promptreturnsoutcomes, andChatViewinvalidates the pane's commands oncatalog_changed). OnlyPendingMessage.outcome_idhas no producer and no reader. Its removal goes with the Native catalogs: Tab race after the fresh read, after-Tab check misses, cold scan outside the budget (#1489 follow-ups) #1493 PR, which also editsshared/protocol.ts, so two open PRs of mine never touch the same file.server/conversation.tspaneProcessRoots): an omo pane now binds to the omo process that holds a session. Before, an unheld one listed earlier won, such as omo's bundled Claude SDK binary under/omo-ai/or a helper script. With no held process the first one still answers, unheld, so nothing new skips Claude's draft refusal.server/omo.ts):omoProcessIdentitynow reportsheld(a holder record and a readable start), so the start is read once per lookup, not twice (onepsfewer on macOS). There is a test forheld: falsewhen the start cannot be read.server/core/omo-pane-send.test.tsthat needs no/procnow runs on every platform instead of Linux only.server/skills/opencode.ts,server/commands.ts): a source may name one pin per TUI. OpenCode names 1.19.3 and 2.0.32, so on a v2 pane the builtins both TUIs share are verified too.server/skill-invocations/claude.ts): only Claude's own commands are left out now. A bundled skill (code-review,debug,loop,simplify...), or a user's skill named like one, is recorded as skill activity and shows in Chat with its skill chip. A user's skill named like one of Claude's commands (review,init) is still not recorded: the echo alone cannot tell it from the command.server/pane-routes.test.tscompares/quit's description across the omo and pi catalogs instead of pinning "Quit omo".O_NOCTTYlands in the Command Code discovery: bound the work per folder, and follow-ups from #1449's review #1452 PR, which ownsserver/skills/walk.ts.Not changed, and why
sendintercepts only/resume, and "Clear it and send" and "Send anyway" callsenddirectly.terminalBoundinserver/skills/claude.tsis where the catalog design keeps each agent's terminal screens (AgentCommandSource.terminalBound). It is not a second list beside a source of truth. A semantic duplicate check would flagsrc/lib/terminalPeek.ts's per-agent screen-return lists (feat(chat): open terminal commands in a peek over the chat #1630, feat(chat): return the terminal peek to Chat from each agent's input row, and hold sends while a screen is open #1637), which are intentional.--no-session, another project's folder, a deleted cwd, Windows): without a holder record an omo process cannot be told from its own Claude SDK child, so those panes keep Claude's draft checks. That fails safe.agentPrompt's access check: the guard is passed into the herdr RPC and checked once connected, right beforeagent.promptis written (server/herdr/client.ts)./etc/codex/skills: read-only, and the assertion istoContain, so a host's own machine-wide skills cannot fail it.cli_version. Showing removed prompts on a modern Codex would offer rows that do nothing.server/AGENTS.md), so the client catches up on the next load.Fixes #1444
Verification
src/lib/usePaneCommands.hook.test.ts(React test renderer, fake timers)server/skills/pi.test.ts"tells pi's bare commands from the ones given an argument"server/conversation.test.ts"binds an omo pane to the omo process holding a session..."server/omo.test.ts"counts an omo's holder as held only while the process's start is readable"server/skills/opencode.test.ts"verifies the builtins both TUIs share on a v2 pane as on a v1 one"server/skill-invocations/claude.test.ts"records a bundled skill's echo..."inTime()after the Hermes lookup is removed./api/pane/commandsfailing and then recovering, at 1280 and 390 px: this branch asks again and the/menu lists/configwith its TERMINAL badge; main never asks again and the menu stays empty.claudeBuiltinNamesand strengthened the hook test; the rest are covered above. Codex (gpt-6.1-sol, xhigh) APPROVE, 2 LOW. I made the held test independent of a readable host start (Windows); the/reviewalias is the limit stated under Claude skill echoes.bun run check faston 452f3f9: workflow syntax, generated files, typecheck, build and unit tests (6413 pass, 0 fail) all ok.