Skip to content

feat(chat): hand terminal commands to the terminal lens - #1580

Merged
devswha merged 6 commits into
mainfrom
feat/terminal-commands-switch-to-terminal
Oct 22, 2026
Merged

devswha merged 6 commits into
mainfrom
feat/terminal-commands-switch-to-terminal

Conversation

@devswha

@devswha devswha commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Change

Implements the maintainer-approved terminal-command handoff mockup. Terminal-only commands picked
from the slash menu or typed by hand now use the normal Send/Enter flow, without the extra
composer notice.

  • Switch only this browser to Terminal after an accepted direct send or explicit Send now.
    Queue acceptance, automatic delivery, refused/unconfirmed sends and watch-only devices do not
    switch. A successful replay of a discarded pending message is not treated as delivery.
  • Show a dismissible command hint in the existing terminal banner column, with Back to Chat.
    It has no timer, consumes no terminal grid row and returns to the previous chat reading position.
  • Render terminal-only commands as one quiet Ran in terminal row with Open Terminal, without
    outcome chips or unconfirmed output previews.
  • Keep ordinary command chips, Hermes informational result cards and /resume → Earlier sessions.
  • Update English source strings, all three translations, DESIGN.md and the guides. Rewrite the two
    existing unreleased fragments; git tag --contains returned no tags for either introduction.

Design reference: Warp's real-terminal agent workflow, adapted to
Ovis's existing Chat/Terminal lenses and the supplied mockup. No reference code or pixels are copied.
The implementation uses the existing terminal banner, theme tokens and chat-position memory.

No server or shared protocol changes, no pane.focus, no new settings or composer buttons.
Nearby rewind, New tab button and next-agent/tool-copy work is left separate.

Validation

  • Final bun run check fast: exit 0, 5,816 passed, 0 failed, 8 pre-existing skips across
    415 files. Run with UNIT_TEST_WORKERS=2 and TMPDIR=/run/user/1000/ovis-check-uC6vDL
    (executable tmpfs) to avoid shared-disk contention; assertions and timeouts were unchanged.
    Workflow syntax, generated types/themes, typecheck, build and unit tests all exited 0.
    Report: /tmp/terminal-autoswitch-fast-ram/report.json, source unchanged and verified.
  • Final demo build: exit 0.
  • bun scripts/terminal-autoswitch-demo-regression.ts: exit 0, covering delayed acceptance,
    draft preservation, reading-position restoration, explicit versus automatic queue delivery,
    concurrent discard, watch-only input gates and absence of focus/takeover.
  • bun scripts/agent-skill-menu-demo-regression.ts claude-terminal: exit 0, 42 captures across
    1280/390/320 px in light and dark.
  • bun scripts/command-outcome-demo-regression.ts: exit 0, including preserved ordinary
    command outcomes and Hermes informational cards at 1280/390 px in light and dark.
  • bun scripts/composer-fit-demo-regression.ts: exit 0.
  • bun scripts/held-rows-demo-regression.ts: exit 0.
  • Accent-stripe lint and git diff --check: exit 0; changed React components have no LSP errors.
  • Independent Codex review: APPROVE after fixing and reproducing the pending discard/ACK race.
    The new race assertion failed on the pre-fix demo and passed on the final build.

The earlier disk-backed bun run check fast completed with exit 1 under heavy host load
(load average 114 on 32 cores).
Workflow syntax, generated types/themes, typecheck and production build all exited 0; source
fingerprints were unchanged. The unit failures were timeouts in unchanged server files:

  • server/push.test.ts: early finish not received within 2 seconds; exact isolated rerun exited 0.
  • server/opencode.test.ts: long-session pagination timed out at 60 seconds; exact isolated
    rerun exited 0.
  • server/conversation.test.ts: Devin history-cache reset timed out during SQLite fixture work.
    With the same test and 60-second timeout, TMPDIR=/dev/shm passed in 78 ms (exit 0),
    confirming shared-disk contention rather than a changed behavior.
  • server/session-history.test.ts: rollback-journal store timeout, which the maintainer confirmed
    also fails on main under load and is being fixed separately.

The final full run above passed all four cases. No test was newly skipped, weakened or edited to
hide these failures.

Demo screenshots are stored locally under /tmp/terminal-autoswitch-shots/:

  • agent-skill-menu/claude-terminal/: menu, insertion, terminal hint, quiet row, dismissal and
    session picker at 1280, 390 and 320 px, light and dark.
  • edges/: delayed receipt, refusal/unconfirmed drafts, reading-position restoration, queued
    send, explicit Send now and watch-only at 1280 and 390 px, light and dark.
  • command-outcome/: ordinary outcome chips, terminal-only rows and Hermes result cards at
    1280 and 390 px, light and dark.
  • {ko,ja,zh}-phone-light.png: manually inspected translated hints at 390 px.

All captures use the fictional demo, never a live herdr session.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 062eb4e3-172f-487f-b9ae-08d737da88f6
📥 Commits

Reviewing files that changed from the base of the PR and between 586a3b8 and 58d4915.

📒 Files selected for processing: 25
  • DESIGN.md
  • changelog.d/command-outcomes.md
  • changelog.d/composer-terminal-commands.md
  • docs/agent-commands.md
  • docs/guide.md
  • scripts/ci-browser.sh
  • scripts/ci-browser.test.ts
  • scripts/command-outcome-demo-regression.ts
  • scripts/skill-menu-cases/claude-terminal.ts
  • scripts/terminal-autoswitch-demo-regression.ts
  • src/App.tsx
  • src/components/ChatView.css
  • src/components/ChatView.tsx
  • src/components/Composer.tsx
  • src/components/PaneTerminal.css
  • src/components/PaneTerminal.tsx
  • src/components/SessionHistory.tsx
  • src/lib/compose.test.ts
  • src/lib/compose.ts
  • src/lib/i18n.ja.ts
  • src/lib/i18n.ko.ts
  • src/lib/i18n.zh.ts
  • src/lib/usePaneCommands.ts
  • src/lib/ws.test.ts
  • src/lib/ws.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

A terminal command sent before the pane's catalog loaded kept the empty catalog in the receipt callback, so the view never switched even when the catalog arrived before the delivery was confirmed.
@devswha

devswha commented Oct 21, 2026

Copy link
Copy Markdown
Owner Author

Merge pass: Codex (gpt-6-astra) on 05fb637 found a MEDIUM: showSentCommand kept the command catalog from the moment of the send, so a terminal command sent before the pane's catalog loaded never switched the view, even when the catalog arrived before the delivery receipt. Fixed in 40f6493 (the receipt reads the current catalog through a ref). Remaining gap, filed as a follow-up: Composer and PaneTerminal fetch the catalog independently, so a receipt that lands before PaneTerminal's own catalog still does not switch. Re-reviewing the new head.

…s-switch-to-terminal

# Conflicts:
#	scripts/ci-browser.test.ts
@devswha

devswha commented Oct 21, 2026

Copy link
Copy Markdown
Owner Author

Merge pass: CodeRabbit did not review head d5a201c (review limit reached). Per the maintainer's rule, this merges on the two merge-pass reviewers (omo-native-code-reviewer and Codex gpt-6-astra, both PASS on the reviewed head), required CI on GitHub-hosted runners, and the merge pass's own verification.

…s-switch-to-terminal

# Conflicts:
#	DESIGN.md
#	src/components/ChatView.tsx
An older bridge without submit receipts (or a capability snapshot that has not arrived in time) gets raw input and reported ok, so a terminal command switched the view and said it ran with nothing confirming delivery. Such a send is now marked unconfirmed and never switches.
The dialog moved the focus inside on the next animation frame, so an Escape pressed right after it opened (from the composer's /resume) went to the message box and was ignored, leaving the dialog over the composer. The agent picker now takes the focus in the dialog's layout effect; the first Resume button still takes it once the rows arrive.
@devswha

devswha commented Oct 22, 2026

Copy link
Copy Markdown
Owner Author

Merge pass: CodeRabbit did not review 58d4915 (review limit). Merging on omo-native-code-reviewer (PASS on 58d4915) and Codex gpt-6.1-sol Fast at xhigh reasoning (PASS on 58d4915), required CI on GitHub-hosted runners, and local runs of scripts/agent-skill-menu-demo-regression.ts and scripts/session-history-browser-qa.ts. Since 40f6493: main merged in (conflicts resolved), b03284a keeps unconfirmed legacy sends from switching the view, 58d4915 gives Earlier sessions the focus on its first paint (Escape pressed at once was ignored after #1573).

@devswha
devswha merged commit 346dfd4 into main Oct 22, 2026
9 checks passed
@devswha
devswha deleted the feat/terminal-commands-switch-to-terminal branch October 22, 2026 00:27
devswha added a commit that referenced this pull request Oct 22, 2026
…#1596)

<!-- See CONTRIBUTING.md for checks, translations, contract tests and
the changelog (a file in changelog.d/, never CHANGELOG.md). -->

## Change

A command Chat sends as typed and that leaves the agent waiting in a
picker, panel, form, confirmation, prompt or editor left Chat stuck.
Claude Code's `/usage` (and `/cost`, `/stats`, `/status`) opens the
Settings panel, Chat shows nothing, and the agent sits there until
someone presses Esc in the terminal. The catalogs marked only a handful
of such commands terminal, so most went out as ordinary sends.

This PR applies one rule to every agent's catalog. A typed form that
leaves a screen waiting for a key, which no reader turns into a card, is
`terminal`. Those forms now go through the Terminal-command handoff from
#1580. The form decides: bare `/fast` is terminal, `/fast off` is sent.
Commands that print and return to the agent's input stay ordinary sends,
even when their output reaches only the screen. The rule is written down
in `docs/agent-commands.md`.

Data only: `server/skills/<agent>.ts` and their tests. No protocol,
HTTP/WS or client change, so `REMOTE_BUNDLE_VERSION` is untouched.

### Per agent

| Agent | How it was checked | Now terminal |
|---|---|---|
| Claude Code (pin 2.1.301) | Each offered builtin sent bare in an
isolated 2.1.306 session; screen read after 2.5 s, then Esc. Account,
cloud and setup flows a signed-out session cannot open were read from
their definitions in the binary. | 47 more rows (54 total): `cost`,
`usage`, `stats`, `status`, `help`, `memory`, `sandbox`, `tasks`,
`workflows`, `powerup`, `scroll-speed`, `mobile`, `passes`, `add-dir`
and `cd` (a path still asks to confirm), `mcp`, the account/cloud/setup
flows, and PC-only `diff`, `ide`, `copy`, `voice`, `keybindings`,
`stickers`, `radio`. Bare only: `fast`, `autocompact`, `advisor`,
`export`. `/plan open` (PC editor). |
| Codex (codex-rs 83086188 = rust-v0.163.0) | Source | `keymap`,
`experimental`, `approve`, `memories`, `import`, `new`/`fork` (worktree
picker in a repo), `archive`, `delete`, `worktree`, `side`/`btw`
(ephemeral thread), `copy`, `tui`, `mention`, `daemon`, `warnings`, `cd`
(trust prompt), `usage`, `title`, `statusline`, `pets`, `feedback`,
`subagents`, `vim` (leaves the composer in Normal mode), `logout`. Bare
only: `rename`, `export`. `/goal edit`. |
| omp (53a0377d, pin 18.12.3) | Source | `move`; bare `btw` (history
overlay; was `none`), `modelpreset`, `marketplace`; `/advisor
configure`, `/todo edit`. `/switch` now opens the `omp-model` card: it
is the picker that card already reads when Chat sends `/model` as
`/switch`. |
| gjc (e9179a14) | Source | `transcript`; bare `routing`, `provider`;
`/provider login`, `/session delete`. |
| OmO (senpi 2026.10.19-2) | Installed engine source | `share`, `trust`,
`import` (`/import <path>` confirms); bare `rename`/`name` (text input).
|
| Hermes (354724fb) | Source | `reload-mcp`, `update`, `undo`
(confirmations), `prompt`/`compose` ($EDITOR), `palette`, `tasks` (alias
of `agents`), `journey`/`learning`/`memory-graph`,
`subscription`/`upgrade`/`topup` (pickers when the account can change
the plan), `login` (device code only on screen), `debug` (uploads
publicly as soon as it is typed). `new`/`reset`/`clear` confirm first
unless sent with `now`, `--yes` or `-y`, which stay ordinary sends.
`curator adopt/prune/purge/rollback`. |
| Devin (3000.11.92) | Probe in an isolated session + binary strings |
`shortcuts`, `btw`, `handoff`, `logout`; bare `mode`, `revert`, `bug`;
`/add-dir <path>` (trust prompt). |
| Antigravity (1.4.3 probe, pin 1.4.0) | Probe in an isolated session |
`artifact`, `codesearch`/`cs`/`search`, `context`, `diff`, `help`,
`tasks`, `rewind`/`undo`, `feedback`, `logout`; `/open <file>`
($EDITOR). |
| OpenCode (v1.19.3 and v2 843a6c51) | Source | `status`, `debug`,
`help` (dialogs), `diff` (route or focused panel). |
| Command Code (1.84.0 package) | Bundle source | bare `add-dir`,
`compact-mode`, `context`, `language`. |
| pi, Grok | Source | No change: `clone`, `new`, `compact`,
`deep-research` and `goal` act and return. |

### Decisions for review

- **Exit commands stay ordinary sends** (`/exit`, `/quit` everywhere
they were offered), as Claude Code's `/exit` already was: nothing waits
for a key. `logout` is terminal where it signs out and leaves a sign-in
screen or exits.
- **Screen-only output is not terminal.** For example omp `/jobs`, gjc
`/context`, Codex `/raw` and `/daybreak`, and Hermes's info commands.
Chat shows the screen preview under the command chip, and nothing is
stuck. One rule for screen-only reports (the tables already mark some of
them terminal) is a separate question.
- **Hermes `/debug` is terminal for consent, not for a screen.** It
uploads a log report to a public paste service the moment it is typed.
- **omp `/switch` maps to the existing `omp-model` card.** That reader
is screen-based (`server/dialogs/omp.ts:255`) and documents `/switch` as
what opens its picker. Not re-recorded live in this PR.

### Follow-ups found along the way (not in this PR)

- OpenCode: a pasted bare server command (`/init`, `/review`, custom
commands) only completes on the first Enter, `/redo` with nothing staged
sits in the autocomplete, and `/undo` leaves the undone text in the
input that Chat's next message joins.
- Command Code: any argument on an action-only command (`/clear x`,
`/compact x`) is sent to the model as a prompt.
- Hermes `--tui`: long output from any command opens a pager (Esc/q),
which this classification of the default classic CLI does not cover.
- Commands that move the agent to a new session file (Codex `/clear` and
`/cd`, omp `/wt`, gjc `/handoff`, Hermes `/new` and `/branch`) need the
chat binding to follow.

## Validation

- `bun run check fast` at 1da06ef: exit 0. Unit tests: 5749 pass, 0
fail, 8 skip in 412 files. Workflow syntax, generated types and themes,
typecheck and build all ok.
- `bun test server/skills/ server/commands.test.ts
server/catalog.conventions.test.ts src/lib/compose.test.ts`: 388 pass, 0
fail. The catalog tests pin each agent's new terminal rows and forms.
- Live probe evidence for Claude Code 2.1.306: 17 bare commands held the
screen until Esc (`help`, `cost`, `usage`, `stats`, `status`, `memory`,
`export`, `sandbox`, `tasks`, `workflows`, `powerup`, `scroll-speed`,
`autocompact`, `fast`, `mobile`, `add-dir`, `passes`). `/add-dir /tmp`
showed the 3-way confirmation, `/cd <new dir>` the trust prompt, and
`/scroll-speed 3` still opened its picker. `/fast off`, `/export
<file>`, `/color red`, `/autocompact 500k`, `/context`, `/branch`,
`/fork`, `/subtask` and `/rename` returned to the prompt.
- No browser regression needed: the composer behaviour is #1580's, and
`scripts/skill-menu-cases/claude-terminal.ts` uses fictional rows.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
devswha added a commit that referenced this pull request Oct 22, 2026
<!-- See CONTRIBUTING.md for checks, translations, contract tests and
the changelog (a file in changelog.d/, never CHANGELOG.md). -->

## Change

Terminal-only commands sent from Chat (#1580, catalog from #1596)
switched the whole pane to the Terminal lens and left the reader to come
back by hand. The maintainer asked for a quick terminal that pops up
from Chat, runs the command, and returns to Chat. This PR replaces the
lens switch with a **terminal peek**.

- **Opens on an accepted send.** When a terminal command is accepted (a
direct send or an explicit **Send now**), the pane's own attached xterm
shows over the chat transcript, in this browser only.
- **Nothing new is attached.** There is no new attach, no `pane.focus`
and no take-over. The stored lens and `?view=` stay `chat`, and the
header keeps Chat pressed.
- **The chat stays where it was.** It stays mounted under the grid
(`visibility: hidden`), so it keeps its reading position and keeps
receiving pushes.
- **Desktop:** the composer, queue, held rows and prompt dock stay in
place, dimmed and `inert`. The grid takes the keys, and a press on the
dimmed column keeps it focused.
- **Phone (coarse pointer or ≤768px):** the KeyBar takes the composer's
place. The composer is `display: none` but keeps its draft, and the soft
keyboard is not raised.
- **Head:** it sits in the existing banner column and says "/cmd ran",
with **Back to Chat** and **Keep Terminal** (Keep Terminal replaces
#1580's X). It has no focus trap and no Escape handler, so Escape always
reaches the agent.
- **Ways back:** Back to Chat, the header's Chat, Mod+Shift+J, a phone's
Back (≤640px), another pane and a reload all end the peek. Keep Terminal
and the header's Terminal save the Terminal lens. Every end blurs the
grid, so later keys reach no pty, and a desktop refocuses the message
box.
- **Claude Code returns by itself, from an allow list.** The peek ends
when Claude writes the `local_command` answer for a closed panel,
timestamped after the send's own outcome (the PC's clock, never the
browser's). The allow list is the commands recorded on Claude Code
2.1.306 as answering only at close: `/usage`, `/cost`, `/status`,
`/stats`, `/help`, `/config`, `/theme`, `/permissions`, `/hooks`,
`/skills`, `/workflows`, `/passes`, `/resume`, `/powerup`, `/fast`, each
sent bare.
- `/diff` answers when its panel opens, so it would end the peek at
once.
- `/export`, `/plugin`, `/mobile`, `/autocompact`, `/add-dir`, `/mcp`
and `/scroll-speed` write user-type entries the chat skips.
  - `/sandbox` and `/tasks` write nothing.
- Under Claude's fullscreen renderer most panels write nothing at close,
so the head says "Chat may come back when you close it", never that it
will.
- A held terminal draft, the find bar or an IME composition leaves the
return to the reader.
- **Every other agent returns by hand in this PR.** Their automatic
return comes in a follow-up, from per-agent screen recognizers: herdr
reports their pickers as idle, so a status edge cannot drive it.
- **"Ran in terminal" row:** its Open Terminal, and the outcome chip's
terminal action, open a peek that only ends by hand.

Client only: nothing under `server/` or `shared/` changes, there is no
HTTP/WS contract change, and `REMOTE_BUNDLE_VERSION` is unchanged. Older
remote PCs get the whole feature.

### Decisions for review

- **Shape, chosen by the maintainer:** the terminal over the chat
transcript area, not a floating card and not the full lens switch.
- **Automatic return for Claude Code only in this PR**, also chosen by
the maintainer. It uses an allow list rather than a deny list, because
the recording showed `/diff` answering at open.
- **Mod+Shift+Space:** it does not dictate into the inert composer
during a desktop peek.
- **Peek on a phone at ≤640px:** a sheet opened over the peek closes
without ending it.

## Validation

- `bun run check fast` at 89f7665 (merged with main 195a08a+,
including #1596): exit 0, unit 5827 pass / 0 fail / 8 skip in 417 files;
workflow syntax, generated types and themes, typecheck and build ok.
- `bun scripts/terminal-autoswitch-demo-regression.ts` at 89f7665: exit
0, 62 PASS lines.
- `bun scripts/terminal-autoswitch-demo-regression.ts` (1280 and 390 px,
light and dark, loopback demo) covers:
- the peek opens only on an accepted send or Send now; refused,
unconfirmed, queued, auto-delivered and discard-raced sends open none
  - the lens key, `?view=` and the header's Chat are unchanged
- the same chat log node is hidden, then visible, and the reading
position is kept
- desktop: inert composer, and a press on it keeps the grid focused;
phone: KeyBar and hidden composer
- Escape reaches the pty; Claude's `/config` returns by itself;
`/doctor` stays after Escape
- every way out ends the peek; typing after a return sends no input
frame
- no extra attach or detach, and no `/pane/focus`, focus or take-over
frames; watch-only behaviour
  - find bar, sheets and dictation during a peek
- `agent-skill-menu-demo-regression.ts claude-terminal`,
`command-outcome-demo-regression.ts`, `composer-fit-demo-regression.ts`,
`held-rows`, `prompt-dock`, `deep-link`, `settings-pages` and
`phone-split-grid` demo regressions: exit 0 at 16f0fc9.
- `src/lib/terminalPeek.test.ts` and `src/lib/sheetHistory.test.ts`:
pass.
- Built with an implementer, three independent reviewers (invariants,
the automatic return, phone UX and tests), a verify-and-fix round (10 of
11 findings fixed, 0 refuted) and a final read-only review (verdict:
ship). The final review's non-blocking note about pressing the dimmed
composer is fixed in 5bc5a68 with a regression step.
- Claude Code close records were recorded live on 2.1.306 in an isolated
herdr session, under both the default and the fullscreen renderer.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
devswha added a commit that referenced this pull request Oct 22, 2026
main's #1580 added scripts/terminal-autoswitch-demo-regression.ts to the
browser lane and this branch adds scripts/health-flap-demo-regression.ts.
Both moved the lane count in scripts/ci-browser.test.ts from 76 to 77, so
git merged the line silently while the lane now runs 78 scripts. Set the
count to 78 and assert both new scripts are in the lane.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
devswha added a commit that referenced this pull request Oct 22, 2026
Main added scripts/terminal-autoswitch-demo-regression.ts to the browser
lane (#1580) while this branch added
scripts/revision-bound-update-demo-regression.ts. Both raised the lane
count from 76 to 77 on the same line, so git merged it cleanly, but the
merged lane runs 78 scripts: the count is 78 now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
devswha added a commit that referenced this pull request Oct 24, 2026
## Change

Follow-ups from #1441's review (#1444). Per item:

**Fixed**
- **M1, a failed command-list read left the menu and the terminal
handoff empty** (`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).
- **M3, pi's argument forms** (`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 1` was 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.
- **M4, unused contract pieces**: `CommandOutcome`, `outcomes` and
`invalidatePaneCommands` are in use since #1450 (`GET /api/pane/prompt`
returns `outcomes`, and `ChatView` invalidates the pane's commands on
`catalog_changed`). Only `PendingMessage.outcome_id` has no producer and
no reader. Its removal goes with the #1493 PR, which also edits
`shared/protocol.ts`, so two open PRs of mine never touch the same file.
- **M6, the first omo-looking process won** (`server/conversation.ts`
`paneProcessRoots`): 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.
- **LOW, held and the start time** (`server/omo.ts`):
`omoProcessIdentity` now reports `held` (a holder record and a readable
start), so the start is read once per lookup, not twice (one `ps` fewer
on macOS). There is a test for `held: false` when the start cannot be
read.
- **LOW, the access check after a Hermes pane's process lookup** now has
a test (removing that check fails it). The one case in
`server/core/omo-pane-send.test.ts` that needs no `/proc` now runs on
every platform instead of Linux only.
- **LOW, OpenCode v2 pin** (`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.
- **LOW, Claude skill echoes** (`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.
- **LOW, `server/pane-routes.test.ts`** compares `/quit`'s description
across the omo and pi catalogs instead of pinning "Quit omo".
- **LOW, `O_NOCTTY`** lands in the #1452 PR, which owns
`server/skills/walk.ts`.

**Not changed, and why**
- **M2, draft confirmations went back through the terminal guard**: that
guard is gone since #1580. A terminal command now goes out through the
normal send, and the terminal peek opens on its receipt. `send`
intercepts only `/resume`, and "Clear it and send" and "Send anyway"
call `send` directly.
- **M5, the convention test**: `terminalBound` in
`server/skills/claude.ts` is 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
flag `src/lib/terminalPeek.ts`'s per-agent screen-return lists (#1630,
#1637), which are intentional.
- **M7, fallback refusals for real omo panes without a holder**
(`--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.
- **LOW, `agentPrompt`'s access check**: the guard is passed into the
herdr RPC and checked once connected, right before `agent.prompt` is
written (`server/herdr/client.ts`).
- **LOW, the FIFO test reads `/etc/codex/skills`**: read-only, and the
assertion is `toContain`, so a host's own machine-wide skills cannot
fail it.
- **LOW, Codex prompts hidden when the version is unknown**: an
unreadable version means a fresh session or a Codex whose rollout has no
`cli_version`. Showing removed prompts on a modern Codex would offer
rows that do nothing.
- **LOW, terminal-only commands before the catalog loads and through
quick replies**: since #1580 these go through the normal send by design.
The peek reads the catalog when the receipt arrives, so a list that
loads after the send still opens it.
- **LOW, a cached old client**: the app shell revalidates on load
(`server/AGENTS.md`), so the client catches up on the next load.

Fixes #1444

## Verification

- Each new test fails on origin/main (production code from main, tests
from this branch) and passes here:
- `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..."
- The Hermes access test fails when the `inTime()` after the Hermes
lookup is removed.
- Browser, on the demo app with `/api/pane/commands` failing and then
recovering, at 1280 and 390 px: this branch asks again and the `/` menu
lists `/config` with its TERMINAL badge; main never asks again and the
menu stays empty.
- Reviews: omo-native-code-reviewer APPROVE, 5 LOW. I removed the unused
`claudeBuiltinNames` and 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 `/review`
alias is the limit stated under Claude skill echoes.
- `bun run check fast` on 452f3f9: workflow syntax, generated files,
typecheck, build and unit tests (6413 pass, 0 fail) all ok.

---------

Co-authored-by: mp <mp@local>
devswha added a commit that referenced this pull request Oct 28, 2026
… list (#1591) (#2164)

Fixes the items of #1591 that were still open on main. #1805 fixed only
the "before the capability snapshot" half of its MEDIUM.

## Change

**Unconfirmed sends (the MEDIUM).** A bridge without `submit` takes a
message as raw input and sends no receipt (`HerdrSocket.submit` → `{ ok:
true, unconfirmed: true }`). Three paths treated that as delivered,
although nothing said the pane got the message:

- `useComposerSends.composerSend`: the composer cleared the draft.
- `useComposerSends.actOnPending`, Send now on a held copy: `removeCopy`
dropped its recovery row.
- `useTerminalSends.sendComposerText`, the held queue's Send now: the
queue row went.

The text now stays as a pending row in the `uncertain` state, with the
new error code `submit_unconfirmed`
(`PendingMessageStore.keepUnconfirmed`, or `fail(..., uncertain)` for
the held copy). This is the existing row: "Not confirmed. Check the
terminal before sending again." with Copy and Discard saved copy, and no
Send now. So it is never sent again from here, and a reload keeps it.
The composer box still lets the text go, since the message did leave. No
new strings.

**Catalog race (LOWs 2 and 5).** Composer, ChatView and PaneTerminal
each read the pane's command list through `cachedPaneCommands`. The
cache kept only the read started *last*, so while the terminal's own
read was on its way, the box's answered read was shared with nobody. A
receipt for a terminal command then found no command and opened no peek.

- An answer is now kept unless a newer read's answer already is.
Invalidation and out-of-order answers still never let an older list win.
- `paneCommandsNow` reads the list at once. PaneTerminal's
`showSentCommand` uses it at the receipt.
- `usePaneCommands` uses it on its first render, so a chat shown again
draws its "Ran in terminal" rows at once instead of as plain bubbles
first.

**Tests (LOWs 3 and 6).**

- `src/lib/useComposerSends.test.ts` (new): composer send and held-copy
Send now, each answered unconfirmed and confirmed.
- `src/lib/paneCommandCache.test.ts` and
`src/lib/usePaneCommands.hook.test.ts`: the shared answer and the first
render.
- `scripts/terminal-autoswitch-demo-regression.ts` holds the pane's
command reads:
  - `later`: the box's read answered, the terminal's still waiting.
- `all`: nothing answered when the message leaves, the 40f6493 order,
which nothing covered.
- `scripts/skill-menu-cases/claude-terminal.ts` gets back the checks
#1580 dropped: heading order, badge text and fit, and ranking.

**Not changed here.** A `sent` frame from another connection for a
pane's shared first message still counts as delivery for Send now. That
only switches this view, and telling the two apart needs the server's
`pending-result` to say which action dispatched the message, a WS
contract change. Filed as #2162.

## Design precedent

No new UI. The not-confirmed state is the row Ovis already uses for a
send whose delivery it cannot prove (Pi transcript receipts, a dropped
connection). The Codex and Claude apps likewise keep a message whose
delivery is not confirmed visible with its text, rather than treating it
as sent.

## Verification

- Unit: the two unconfirmed cases and the first-render case fail with
the production files reset to main and pass with the change. The
confirmed controls pass on both.
- Browser, `bun scripts/terminal-autoswitch-demo-regression.ts`:
  - On this branch: 72 PASS, exit 0.
- On main c739ad0 with only the new script: the `later` case fails (the
menu never gets the list, because the box's answer is not shared).
- `all` passes on main (40f6493 fixed it). With 40f6493's ref update
removed in a throwaway tree, it fails, so the case guards that fix.
- `bun scripts/agent-skill-menu-demo-regression.ts claude-terminal`:
passes with the restored checks, 42 captures at 1280, 390 and 320 px,
light and dark.
- `bun run check fast`: exit 0. Unit 7910 pass, 0 fail. Typecheck and
build pass.
- Reviews of 85cf605:
  - Codex Sol 6.1 fast xhigh: PASS, no actionable findings.
  - omo code reviewer: APPROVE, no CRITICAL, HIGH or MEDIUM. Its LOWs:
- On a PC without `submit`, each chat message leaves a "Not confirmed"
row until discarded. This is the intended trade-off: matching transcript
text to clear them is what the pending store refuses to do.
- The old held queue's Send now path (`sendComposerText`) has no unit
test of its own. Its submit function is internal to the hook.
- `usePaneCommands` reads the cache during render without subscribing to
it. This is harmless: the list is what its own read brings.

All captures come from the demo, never a live herdr session. Client-only
change: no server, `shared/` or remote bundle change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant