Repository navigation
Menus: whole menu in remote_status, remote_send_keys with confirmation, resize - #2
Merged
Merged
Conversation
…e_resize
The first voice test found a session waiting in an interactive menu and
remote_status said only its footer ("↑/↓ choose · ←/→ change size · enter
confirm · esc not now"), also with lines=120. The capture was complete;
the one-line heuristic picked the footer because it did not know menu key
hints.
remote_status
- Key hints under menus are status lines.
- New menu heuristic (dispatcher.find_menu, shared with the dispatcher):
the heuristic speaks the menu's question, every option and the selected
one instead of one line.
- The summariser prompt asks for the question, every choice and the
selected one.
- The capture reports paneWidth, paneHeight and alternateOn. A short pane
on the alternate screen gets a note that a menu may be cut off.
- The log records which path answered, without screen text.
- pending_input captures 40 lines for waiting panes and quotes a menu's
question.
remote_send_keys
- Presses 1 to 10 keys from a fixed list (arrows, enter, escape, tab,
shift tab, 1-9, y, n).
- Same read-back, confirm, opt-ins, risk and audit as remote_send.
- Bound to the hash of the menu or permission dialog that was read back.
- New dispatcher verb keys, which runs one send-keys without -l.
remote_resize
- Confirmed tmux resize-window, 80-300 columns, 24-120 rows.
- New dispatcher verb resize.
Dispatcher 0.5.0. An older dispatcher is named as too old.
Tests use synthetic menus only. There is a live test on an isolated tmux
server with a fake menu program.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, permission choice
- Tab and BTab (dispatcher.MODE_KEYS) go only into a bound menu or a
permission dialog. Shift+Tab at an idle Claude Code input cycles the
permission mode (accept edits, bypass), which would get around the
permission-answer opt-in. The hub refuses before preparing; the
dispatcher refuses `menu none` with them (`mode_keys`) whatever the
opt-ins.
- Menu speech adds the footer's key hints beyond up/down, enter and esc
("Its key hints also say: "left/right change size"").
- Key answers to a permission dialog say which option they pick
(find_menu parses those dialogs).
- remote_resize and the dispatcher's resize: a pane without Claude Code
only with sendToAnyPane / --send-to-any-pane, as for keys.
- Clearer wording: a bad_request at confirm no longer always means "too
old", and the read-back says when it dropped earlier key presses or an
earlier resize.
- Threat model: Shift+Tab mode switching, the menu binding covers only
the first screen, answer mode bound to none, and resize-window resizes
the whole (possibly linked) window.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hout numbers - dispatcher.keys_problem (hub and dispatcher): a digit, Enter, Escape, y or n only as the last key (key_order), so nothing lands on the screen a choice opens (no "1 BTab BTab" cycling the permission mode); without a bound menu no Tab/BTab (mode_keys) and no Up/Down before Enter (history_submit). - find_menu: options without numbers under a picker footer (up/down plus enter or esc hints), one selection mark; longer option descriptions under such a footer. A picker footer with an unreadable menu is refused for keys (menu_unreadable) and the status fallback speaks the block above it. - remote_status: menu words appended to a summary; cut note only when no whole menu was found or the screen fills the pane. - Read-backs: unnumbered options and choices without numbers, key hints only for keys beyond moving and choosing, resize names its effect on other panes and clients; clearer mode_keys wording; orphaned KEY_NAMES docstring. - Tests (fake tmux, hub end to end, live isolated tmux with a plain menu) and docs (SWITCHBOARD threat model, REFERENCE, DESIGN). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…submits nothing `keys ... answer none` (the registry says waiting for permission, no dialog on the screen) counted as a bound dialog, so it skipped every unbound-screen rule: `Up Enter` recalled and submitted an earlier prompt, `BTab BTab BTab` cycled the permission mode toward bypass, and Enter would submit a draft. Answer mode now counts as bound only with a dialog_hash on the screen; with `answer none` hub and dispatcher accept one UNBOUND_ANSWER_KEYS key alone (1-9, y, n, Escape), else `dialog_unreadable`, like the text path's one digit. Tests on both sides; the send/keys tool tests get a looser ssh timeout (they timed out under heavy box load). Docs updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n the screen Security review fixes and follow-ups on the menu capture branch: - Answer mode is bound only by a dialog_hash on the screen. A registry-only permission wait (`keys ... answer none ...`) is refused whatever the keys, on the hub (remote_send_keys) and in the dispatcher (`dialog_not_visible`): with a stale registry, `Up Enter` recalled and submitted an old prompt, `BTab BTab BTab` cycled the permission mode toward bypass and `Enter` submitted a draft. The one-key allowance (UNBOUND_ANSWER_KEYS) is gone. - The dispatcher `version` probe runs alongside the list instead of as a third round trip before the capture (still cached 5 minutes per machine), so key tests no longer time out under load. - find_menu parses options 1 to 99 (menus with 10+ options keep every option), keeps the lines under each option as its description, skips Claude Code's input status line (never a footer; `shift+tab to cycle` no longer matches the `tab to` hint) and rejects a marked line alone between two borders (an input box draft) as an option. - The heuristic status names option descriptions in short, dropping them when otherwise not every option fits; after a model summary only a short options list follows, not the whole menu again. - resize carries the Claude Code session id the owner heard and the dispatcher rechecks it; the read-back and the result say how to undo it (tmux set-option -w -u window-size). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…no drafts as menus, cut menus - dispatcher.dialog_bound: a permission answer counts as bound only when find_menu reads a menu at the bottom of the screen and the dialog line is part of it. Prose "Do you want to ...?" or a prose Yes/No list above an idle input box gets the unbound rules on hub and dispatcher (mode_keys, history_submit, menu_unreadable, draft_present, vim_normal), and the read-back no longer says it asks for permission. - find_menu: a run of options between two borders whose option 1 line starts with an input prompt, without a picker footer, is a multi-line input draft, never a menu (both box styles). - remote_status: on the alternate screen a picker footer whose menu cannot be read gets a cut note at any height, with the resize offer under 120 rows; the menu_unreadable refusal names the resize. - Tests: dispatcher and hub cases for prose dialogs, 2- and 3-line numbered drafts, a 31-line menu in a 24-row alternate pane, and a live tmux case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, no shell menus - find_menu: `_input_box` finds the closing border past empty lines under the last option or description line, and the opening border above option 1 past other lines; a box whose first line starts with an input prompt is a draft (`> 1. fix` / `2. tests` / empty line, and `> notes` / `> 1. fix` / `2. tests`), never a menu. - Defence in depth: a bound menu without a picker footer while shows_draft sees a draft is refused (`draft_present`), hub and dispatcher. - keys_problem(..., answer=True): in a permission dialog Tab and BTab are final keys (Shift+Tab chooses "allow all edits during this session" in the edit dialog and closes it), so `BTab Enter` or `BTab 1` is `key_order` on hub and dispatcher. - Panes without Claude Code: only a menu or dialog under a picker footer binds (bound_menu_hash, dialog_bound(claude_pane=False)); shell output `1. Yes` / `2. No` above the prompt gets the unbound rules, and an unbound screen reads back no option as chosen. - Tests for each case on dispatcher and hub; docs updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
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.
Follows the first real voice test.
1. remote_status showed only a menu's footer. The capture (capture-pane -p -J -S) already held the whole menu; the heuristic fallback (used when the summary fails) picked one line, the footer. Now the question, every option (10+ too) with the selection, short descriptions and the footer reach the summary and the fallback, on the normal and alternate screen and in short panes (cut note + offer to resize). After a model summary only a trimmed option list follows.
2. remote_send_keys. Allow-listed keys only (arrows, Enter, Escape, Tab, BTab, digits, y/n), at most a few, sent with send-keys without -l. Same two-step flow as remote_send: read-back of the keys, the pane and the menu on screen, confirm in a new turn (remote_send_confirm: minConfirmSeconds, expiry, single use, client binding), risky gating, audit-logged. Keys are bound to the menu or dialog the owner heard (hash); a permission dialog also needs the permission-answer opt-ins; answer mode is refused when no dialog is visible (stale registry); Tab/BTab only into a bound menu/dialog and never after a selecting key; drafts and vim mode are protected. Needs dispatcher 0.5.0; an older dispatcher gets a spoken refusal.
3. Resize (tmux resize-window within 80-300 x 24-120), confirmed and audit-logged; the read-back says how to undo it.
Reviews: security + correctness, several rounds (one real finding fixed: answer mode with a registry-only permission wait could recall history or cycle the permission mode). Gate: pytest 1491 passed, 9 skipped; ruff, format, mypy --strict clean; keys tests stable under parallel load.
🤖 Generated with Claude Code
https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh