Skip to content

feat(ui): delete a session on an SSH connection - #1086

Merged
YoanWai merged 1 commit into
wainmann:mainfrom
pandysp:fix/ssh-delete
Nov 16, 2026
Merged

YoanWai merged 1 commit into
wainmann:mainfrom
pandysp:fix/ssh-delete

Conversation

@pandysp

@pandysp pandysp commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What changed

d on an agent under an SSH connection, or Delete in its row menu, now asks first and then deletes the agent on its host, the way d deletes one on this machine. Before, it stopped with "delete isn't available on SSH connections yet".

  • The answer runs agent-manager delete --json -- <id> there, the call delete_session already makes for a host::id (feat(cli): delete a session from the CLI and MCP #1045). That command removes the pane, the row, the terminals nested under the agent, and a clean worktree with its am/ branch, as a local delete does. The status line says deleted <name> on <host>, and the host is read again.
  • The confirm counts the terminals that go with the agent, worded like the local delete confirm: delete api on box and 2 terminals? kills their tmux sessions there. The count is the host's terminals whose parent is the row, archived ones included, since the host's delete takes those too.
  • When the host keeps the worktree, the status line says both what happened and why: deleted <name> on <host>; worktree kept (has work): <path>, with the error style a local delete gives that notice.
  • d on a remote terminal closes it, as x does. The host's delete takes agents only, and terminal close already removes the terminal there, the way a local delete removes a local one.
  • d on a remote group still refuses, and now says what is missing: deleting a group isn't available on SSH connections yet.
  • The footer on a remote agent row names d delete, and the row menu offers Delete on live, dead and archived remote agents. The ? key map lists delete among a connection's agent actions.
  • Docs: docs/usage.md and docs/ssh-connections.md drop delete from the refused list. The comment on remote.Client.Delete said the host refuses a worktree with unsaved work. It now says what the host does.
  • Not strictly part of this change: the SSH section of tools/e2e/README.md now lists everything the scenario drives. It claimed attach is left to the unit tests, but the scenario already attaches. Happy to split that out if you prefer.

Why

Kill, revive, archive and restore already run on the host, and delete did not, although the host side shipped in v0.49.0 with agent-manager delete and remote.Client.Delete. Only the list never called it.

Part of #876

Scope

Required behavior

  • d and the menu's Delete on a remote agent (live, dead or archived) ask, then delete it on its host. No ssh call goes out before the answer, and none to an offline host.
  • The confirm names the terminals the host's delete takes with the agent.
  • The host's worktree notice reaches the user, together with the fact that the agent was deleted.
  • A host too old to know delete fails with a message that says to update it.
  • d on a remote group stays refused, with "deleting a group isn't available on SSH connections yet". d on the connection row still removes the connection.

Why this approach

It is the pattern kill, revive, archive and restore already use: one Op in internal/ui/connections with its confirm, one entry in remoteOp, and one uilink.Op that calls the existing client method. No new protocol, host command, version check or setting.

The terminal count sits on connections.Row, filled where the row is found in the host's last snapshot. confirmRemote words the delete confirm through uisession.FollowConfirmLabel, the helper the local delete confirm uses, so both read the same. internal/ui/connections may not import internal/ui/session, so the wording happens in the root adapter, which already does.

A host older than v0.49.0 does not know delete. It falls through to its interactive manager, and decode already turns that into agent-manager there is too old for SSH connections; update agent-manager on that host. This PR pins that with one test line and adds no code for it. The message says "for SSH connections" although every other call to that host still works. I left that wording alone because every older-host call shares it.

Deleting a group on a connection stays out. The host's delete-group moves its sessions to the root and keeps them running, while d on a local group deletes them, so matching the key needs a new host call. It stays in #876 with the other actions there.

Tool coverage

No tool-dependent behavior. The call deletes whatever agent the host runs, through the host's own delete, which is the same for every CLI in builtinTools. Driven with the e2e fixture CLI (command-code on a stub binary).

How it was verified

Branch head 53a6b53, on main d8d389f. I rebased just before opening this. The full suite, the e2e and the real ssh drive ran on 7a4e9e5, which is the same commit on main f9b267e, and "Head" below means that commit. After the rebase I re-ran gofmt, vet, build and the tests under internal/ui, internal/remote and internal/sessioncmd. They pass except the echo-latency test in internal/ui/focus/watch, which CI skips on macOS.

  • MRE first. Before the fix, the new rows in TestRemoteActionsBuildTheirRemoteCall failed with calls = [], want one ["delete" "--json" "--" "s1"], and the SSH e2e scenario's new delete step timed out waiting for the confirm. On a build of main over a real ssh connection, d showed delete isn't available on SSH connections yet (frame below).

  • Each new test fails without its fix. The terminal count, the notice line and the group refusal were checked on head; the rest on the first revision of this branch, where those tests were written.

    • Without the SessionCall delete branch, the adapter rows and TestSessionCallAnswersEveryRemoteAction fail.
    • Without the terminal count, TestRowFindsAgentsAndTerminals and TestRemoteDeleteConfirmCountsTheTerminalsItTakes fail (label "delete api on box? kills its tmux session there.", want "delete api on box and 2 terminals? kills their tmux sessions there.").
    • Without the new notice line, TestADeleteReportsTheHostsNotice fails.
    • With the old group refusal, TestUnsupportedRemoteActionsAreRefusedWithoutIO fails.
    • Without the legend entry or the menu items, TestRemoteLegendOffersDeleteOnAnAgentOnly and TestConnectionMenusOfferOnlyRemoteActions fail.
  • e2e. tools/e2e/ssh_scenarios.py now deletes the grouped agent after the restore step: d, the confirm, deleted api on box, and the host's store no longer has the row. It passes on head.

  • Real ssh. A build of head on its own socket and profile, with a connection to localhost whose binary is a wrapper that gives the host its own HOME, profile and tmux socket. Before any delete, that host listed only the throwaway rows. Driven:

    • d on a remote group: deleting a group isn't available on SSH connections yet.
    • d on an agent: confirm, deleted plain on studio-iso, row gone, and the host's sessions and tmux server no longer have it.
    • d on an agent with two nested terminals: delete nest on studio-iso and 2 terminals? kills their tmux sessions there., then the agent and both terminals are gone from the host's snapshot and tmux server.
    • d on an agent with a clean worktree: deleted clean-wt on studio-iso, and on the host the worktree directory, its git worktree entry and the am/clean-wt branch are gone.
    • Delete from the row menu by mouse, on an agent whose worktree had an untracked file, confirmed with a click: deleted dirty-wt on studio-iso; worktree kept (has work): /private/tmp/…/repo-worktrees/dirty-wt. The host kept the worktree, the file and the am/dirty-wt branch.
    • d on a remote terminal: close terminal loose-sh on studio-iso?, then gone on the host.
    • A second connection to a host running v0.48.1, driven on the first revision of this branch (the error path is unchanged since): d, confirm, then old-host: agent-manager there is too old for SSH connections; update agent-manager on that host. The session stayed on that host.
  • gofmt -l . prints nothing

  • go vet ./... passes

  • mkdir -p /tmp/amtest && env -u TMUX TMUX_TMPDIR=/tmp/amtest go test -race ./... passes: everything except internal/clipboard TestDarwinLiveCopy, which fails the same way on unchanged main (see the table)

  • go build ./... passes

  • Ran it against real sessions

  • New behavior covers every applicable CLI, or Scope establishes a tool-specific fix, new CLI, or explicitly accepted feature exception

  • Holds for every supported platform (macOS, Linux, WSL2) and terminal including over SSH, or the description names what it leaves out

  • Every new action works by keyboard and by mouse, and every new setting lives on a Settings row

What ran where:

Check On which commit Result
Full go test -race ./..., macOS, local Head 83 packages pass. internal/clipboard TestDarwinLiveCopy fails.
TestDarwinLiveCopy alone on unchanged main (f9b267e) main Fails the same way: pbpaste returns what the clipboard already held. go list -deps ./internal/clipboard names only termseq and wsl from this module.
SSH e2e scenario (tools/e2e/ssh_scenarios.py) Head Pass
gofmt, go vet ./..., go build ./..., staticcheck 2026.2.2, check-ui-boundaries, check-file-names, check-file-sizes Head Pass

Only macOS was driven, as the local machine and as the host. The change adds no platform or terminal branch: it reuses the confirm, the row menu and the remote call path kill already takes. I did not drive Linux, WSL2, or a Windows local machine.

Visual evidence

Text frames read back with tmux capture-pane -p, as Capturing a TUI frame in CONTRIBUTING describes. Both builds ran on their own socket and profile against an isolated host over a real ssh localhost. Each block is lines cut unchanged from one frame; blank lines separate frames or skipped rows.

Before: d on a remote agent, on a build of main.

█   root         no agents yet   […] ▐  throwaway-a  on studio-iso                                                ○ idle
█ ╰─ ▾ demo                ○ 2   […] ▐─────────────────────────────│ ✕ delete isn't available on SSH connections yet │──
█    ├─ ○ throwaway-a  idle · co […] ▐  fixture-cli ready          ╰─────────────────────────────────────────────────╯
   Session on studio-iso    space quick prompt mode   ↵/A attach over SSH  x kill  a archive

After: the footer on a remote agent names d:

   Session on studio-iso    space quick prompt mode   ↵/A attach over SSH  x kill  d delete  a archive

The rail with an agent that has two terminals nested under it (frame 04-plain-done), then the confirm d opens on it (frame 05-nest-confirm), which counts them:

█    ├─ ○ nest      idle · command-code   […] ▐  sh-3.2$ /tmp/amsd2/host-am terminal create --json --name=nest-sh1
█    │  ├─ ❯ nest-sh1   idle · terminal   […] ▐  {
█    │  ╰─ ❯ nest-sh2   idle · terminal   […] ▐    "id": "ddf79929",

                                           ╭── ⚠ Delete session ──────────────────────────────────────────╮
                                           │                                                              │
                                           │   delete nest on studio-iso and 2 terminals?                 │
                                           │                                                              │
                                           │   kills their tmux sessions there.                           │
                                           │                                                              │
                                           ├──────────────────────────────────────────────────────────────┤
                                           │   y/↵ delete  n/esc cancel                                   │
                                           ╰──────────────────────────────────────────────────────────────╯

After d and y on another agent, plain, its row goes, and the host has no such session anymore:

█ ▾ studio-iso  ssh                 ○ 3   […] ▐  group  demo                                                       ╭───────────────────────────────╮
█ ├─ ❯ loose-sh         idle · terminal   […] ▐────────────────────────────────────────────────────────────────────│ ● deleted plain on studio-iso │──
█ ╰─ ▾ demo                         ○ 3   […] ▐  fixture-cli ready                                                 ╰───────────────────────────────╯

A clean worktree goes with the agent. Before the delete, the host's git worktree list also listed repo-worktrees/clean-wt [am/clean-wt], and git branch --list listed am/clean-wt (07-host-git-before-clean.txt). After it (08-host-after-clean.txt):

$ git worktree list
/private/tmp/amsd2/h/repo                    99fe914 [main]
/private/tmp/amsd2/h/repo-worktrees/dirty-wt 99fe914 [am/dirty-wt]
$ git branch --list
+ am/dirty-wt
* main

The row menu offers Delete (frame 09-dirty-row-menu), and a worktree with unsaved work stays on the host, with the notice (frame 11-dirty-notice):

█    ╰─ ○ di╭─ dirty-wt ────────────────╮ […] ▐  sh-3.2$
█           │ Attach                  A │     ▐
█           ├───────────────────────────┤     ▐
█           │ Quick prompt mode   space │     ▐
█           │ New terminal            T │     ▐
█           ├───────────────────────────┤     ▐
█           │ Archive                 a │     ▐
█           │ Kill                    x │     ▐
█           │ Delete                  d │     ▐
█           ╰───────────────────────────╯     ▐

█ ▾ studio-iso  ssh       no agents yet   […] ▐─────────────────────────────────────────────────╭──────────────────────────────────────────────────╮──
█ ├─ ❯ loose-sh         idle · terminal   […] ▐  press space to start an agent here             │ ✕ deleted dirty-wt on studio-iso; worktree kept  │
█ ╰─ ▾ demo               no agents yet   […] ▐                                                 │ (has work): /private/tmp/amsd2/h/repo-           │
█                                             ▐                                                 │ worktrees/dirty-wt                               │

d on a remote group:

█ ▾ studio-iso  ssh                 ○ 4   […] ▐─────────────────────────────────────────────────╭──────────────────────────────────────────────────╮──
█ ├─ ❯ loose-sh         idle · terminal   […] ▐  press space to start an agent here             │ ✕ deleting a group isn't available on SSH        │
█ ╰─ ▾ demo                         ○ 4   […] ▐                                                 │ connections yet                                  │
█    ├─ ○ plain     idle · command-code   […] ▐                                                 ╰──────────────────────────────────────────────────╯

A host on v0.48.1 (frame blackbox/09-old-host-delete, first revision of this branch):

█ ╰─ ▾ demo      no agents yet   […] ▐────────────────────────────│ ✕ old-host: agent-manager there is too old for   │──
█ ▾ old-host  ssh          ○ 1   […] ▐  fixture-cli ready         │ SSH connections; update agent-manager on that    │
█ ╰─ ○ old-host-agent  idle · co […] ▐                            │ host                                             │

Summary by CodeRabbit

  • New Features
    • Remote agents can now be deleted from the connections menu, including archived or inactive agents. Deletion requires confirmation and closes the agent’s terminal sessions.
    • Deleting an agent removes its worktree when it has no unsaved work. If work remains, the worktree is kept and a notice explains why.
    • Pressing d on a terminal closes it, like x.
  • Documentation
    • Updated SSH connection help and usage guidance to describe remote agent deletion and its effects.
  • Limitations
    • Deleting a remote group remains unsupported.

d, and Delete in the row menu, on an agent under an SSH connection now
asks, then runs `agent-manager delete` on its host, the call
delete_session already makes. The host's delete, from wainmann#1045, removes the
pane, the row, the terminals under the agent and a clean worktree with
its am/ branch, so the confirm counts those terminals the way a local
delete does. When the host keeps a worktree, the status line says the
agent was deleted there and why the worktree stayed. A host older than
v0.49.0 does not know delete and fails with the existing "too old" error.

d on a remote terminal closes it, as x does, since the host's delete
takes agents only. Deleting a group on a connection stays refused, and
the refusal now names the group: the host's delete-group moves its
sessions to the root instead of deleting them.

Part of wainmann#876.
@pandysp
pandysp requested review from a team and YoanWai as code owners November 16, 2026 21:49
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Remote agent rows now offer deletion through the SSH connection interface. The UI confirms the action, sends the delete command to the host, and reports any host notice. Terminal deletion continues to close the terminal.

Changes: Remote Agent Deletion

Layer / File(s) Summary
Expose and route agent deletion
internal/ui/rail/*, internal/ui/connections/call.go, internal/ui/connections/call_test.go, internal/ui/connections_adapter_test.go
Remote agent menus and legends offer Delete. Session calls route agent deletion to confirmation, while Delete on a terminal closes it. Group deletion remains unavailable over SSH.
Confirm deletion with terminal context
internal/ui/connections/rows.go, internal/ui/connections/rows_test.go, internal/ui/connections_adapter.go, internal/ui/connections_adapter_test.go
Agent rows count their child terminals. The confirmation label states whether deletion kills one or more tmux sessions.
Run host deletion and report its result
internal/ui/connections_adapter.go, internal/ui/connections_adapter_test.go, internal/ui/connections/link/call.go, internal/ui/connections/link/call_test.go, internal/remote/operations.go, internal/remote/operations_test.go
The remote operation dispatches Delete to the link call, which invokes client.Delete. The UI reports completion or a host notice. Tests cover remote actions, notices, and outdated hosts.
Document and exercise remote deletion
docs/ssh-connections.md, docs/usage.md, internal/ui/help/catalog.go, tools/e2e/README.md, tools/e2e/ssh_scenarios.py
Documentation describes remote agent deletion and the group-deletion limitation. The SSH scenario deletes an agent and waits until it is absent from the host query.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SessionCall
  participant confirmRemote
  participant uilink.Run
  participant SSHHost
  User->>SessionCall: Request agent deletion
  SessionCall->>confirmRemote: Request confirmation with terminal count
  User->>confirmRemote: Confirm deletion
  confirmRemote->>uilink.Run: Dispatch Delete
  uilink.Run->>SSHHost: client.Delete(reference)
  SSHHost-->>uilink.Run: Return session and notice
  uilink.Run-->>User: Report completion or notice
Loading

Possibly related issues

  • wainmann/agent-manager#876: This PR implements remote agent deletion with the clean- and dirty-worktree outcomes described in the issue; the issue’s other requested actions remain outside this change.

Possibly related PRs

Suggested labels: type:feature, area:ui

Suggested reviewers: ribeirojose

Merge Risk: Minimal · up to 53a6b

This change adds confirmed deletion of remote agents over SSH. A host notice is shown when a worktree is kept because it has unsaved work. Terminal deletion and the refusal of remote-group deletion are unchanged. No concrete defect was found, and the change is ready to merge.

Security architecture risk: Minimal · up to 53a6b

Remote deletion requires confirmation and uses the existing SSH deletion operation and host-side safeguards. The inspected change establishes no introduced or worsened security or failure-containment issue.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — One confirmed agent-delete request targets an ID on one configured SSH connection. Its intended destructive scope includes that agent, its child terminals, associated pane and hook state, stored rows, and eligible worktree cleanup under the existing remote execution authority.

Trust Boundaries and Controls

  • observed — The confirmation captures the host/session request rather than resolving the selected row again when accepted. Cancellation drops the card without running the request; acceptance queues the captured call. Offline checks occur before confirmation and again before queuing.
  • observed — Host-supplied IDs pass an allowlist validator and are sent after an option terminator through word-by-word shell quoting. The host rejects terminal IDs for agent deletion and rejects self or parent deletion when a caller identity is present. Returned notice text is stripped of escape sequences and control characters before display.
Pre-merge checks: Passed 12 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Scope Fidelity Warning The Scope section (Required behavior and Why this approach) is present and specific, so this check applies. The diff adds user-visible behavior that the Scope section does not request. 1. Row menu for… Either: - Restore the if !row.sess.IsShell gate in remoteMenuItems (internal/ui/rail/menu.go) so remote terminal rows do not list "Quick prompt mode" or "New terminal". Or add that menu change to the Scope section with a reason. - Remove …
Passed Passed checks: 12 passed

Check name Status Explanation
Title check Passed The title "feat(ui): delete a session on an SSH connection" follows the Conventional Commits format used by the repo, with a valid type and scope. It matches the main change: remote agent deletion ove…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template closely. It covers What changed, Why (with the linked context Part of #876), Scope with required behavior and the chosen approach, Tool coverage with a …
Tmux Socket Isolation Passed The check is about tmux invocations. The changed-file inventory covers 19 files: docs, Go files under internal/remote and internal/ui, and tools/e2e (README and ssh_scenarios.py). I searched every add…
Sensitive Output Leak Prevention Passed The PR adds no log.*, slog, or new fmt.Print/Fprint logging calls. I checked every added line in the changed Go and Python files for output calls and for credential or personal-data terms. The only ne…
New Logic Test Adequacy Passed The PR adds new behavior in several Go files. Each has a matching test in the same package, next to the file it covers. - internal/ui/connections/call.go: SessionCall gets a Delete branch. `TestSe…
Breaking Change Disclosure Passed The check covers breaking changes to the public CLI (flags, subcommands), stored Settings values, documented environment variables, and MCP tool names or schemas. I inspected the PR's changed-file lis…
Visual Evidence Passed The change can be shown visually. It changes TUI behavior: the footer, row menus, confirm dialog, and status lines. The PR description has a "Visual evidence" section. It gives a "Before" frame, from …
Tool And Platform Coverage Passed Overall: PASS. Tool coverage passes, and the platform/terminal portion passes on the documented-exclusion rule. Tool coverage (PASS). The PR adds OpDelete and a remote Delete call. It rout…
Input And Configuration Surface Passed The check fails only on three conditions. Each is absent from this diff. 1. Keyboard-only or mouse-only actions. The one new action is delete on a remote agent. It has a keyboard path and a mouse path…
No Speculative Fallbacks Passed The check fails only for a new fallback, nil-guard, or dual path that handles a shape this repository cannot produce. Reviewing the production changes against the base found no such branch: - `interna…
Full details: Title check

Explanation

The title "feat(ui): delete a session on an SSH connection" follows the Conventional Commits format used by the repo, with a valid type and scope. It matches the main change: remote agent deletion over SSH from the connection list, which the changeset implements through the connections UI, remote operations, and the adapter.

Full details: Description check

Explanation

The description follows the repository template closely. It covers What changed, Why (with the linked context Part of #876), Scope with required behavior and the chosen approach, Tool coverage with a justification that no tool-dependent behavior applies, and a detailed How it was verified section with the checklist. Visual evidence is provided as text frames, with before and after captures. The author also documents what was not verified (Linux, WSL2, Windows) and explains the one failing test on unchanged main. The Closes # line is left as a template placeholder with a 'Part of #876' reference instead, which is acceptable for a partial feature.

Full details: Tmux Socket Isolation

Explanation

The check is about tmux invocations. The changed-file inventory covers 19 files: docs, Go files under internal/remote and internal/ui, and tools/e2e (README and ssh_scenarios.py). I searched every added line in the *.go and *.py files for tmux, exec.Command, kill-server, kill-session, set-hook, set-option, "-L" and "-S". The only matches are user-facing strings in the confirm label and tests, such as "kills their tmux sessions there." No added line runs a tmux command, and no removed line did. The new delete path calls the existing remote.Client.Delete, which runs agent-manager delete --json on the SSH host. That path does not run a local tmux command, so the socket-pinning rule does not apply. The operations.go change is a comment-only edit. No new or modified tmux path exists, so the check passes.

Full details: Sensitive Output Leak Prevention

Explanation

The PR adds no log.*, slog, or new fmt.Print/Fprint logging calls. I checked every added line in the changed Go and Python files for output calls and for credential or personal-data terms. The only new user-visible output is the status line and confirm label in the TUI. - internal/ui/connections/link/call.go: ApplyCall builds "deleted " + call.Name + on + "; " + result.Notice. The Notice comes from the host's delete result and reads like worktree kept (has work): &lt;path&gt;. The content is the agent name, host alias, and a worktree path, all already shown in existing status lines such as "killed …" and "opened terminal …". None of these is a password, token, key, or secret. - internal/ui/connections_adapter.go: confirmRemote builds the delete label with uisession.FollowConfirmLabel, using the agent name, host, and terminal count. This matches the existing confirm text pattern for other lifecycle actions. - internal/remote/operations.go: only a doc comment changed. The Delete implementation is unchanged. - Test files and the e2e scenario are exempt, and they contain no real credentials. The worktree path is an operational local path shown to the user who triggered the delete. It is not personal data under this check. Nothing in the diff writes to a log or persistent output stream.

Full details: New Logic Test Adequacy

Explanation

The PR adds new behavior in several Go files. Each has a matching test in the same package, next to the file it covers. - internal/ui/connections/call.go: SessionCall gets a Delete branch. TestSessionCallAnswersEveryRemoteAction covers agent delete (OpDelete) and terminal delete (OpCloseTerminal). - internal/ui/connections/link/call.go: Run gets a Delete case and ApplyCall gets a notice branch. TestRunTurnsEachCallIntoItsHostCommand covers the command mapping. TestADeleteReportsTheHostsNotice covers the error-style notice path. The no-notice success path is covered by TestRemoteActionsBuildTheirRemoteCall ("deleted api on box"). - internal/ui/connections/rows.go: the terminal count is tested in TestRowFindsAgentsAndTerminals. The fixture includes an archived child and a child of another agent, and expects 2. - internal/ui/connections_adapter.go: confirmRemote delete labels are tested in TestRemoteDeleteConfirmCountsTheTerminalsItTakes, for 2 terminals, 0 terminals and 1 archived terminal. The remote-op mapping is covered by TestRemoteActionsBuildTheirRemoteCall. The group refusal is covered by TestUnsupportedRemoteActionsAreRefusedWithoutIO. - internal/remote/operations.go: Delete gets only a comment change. The error path it introduces, the too-old host, is tested by an added line in TestUnknownCommandIsTooOldNotUnreadable. - internal/ui/rail/legend.go and menu.go: TestRemoteLegendOffersDeleteOnAnAgentOnly covers agent versus terminal. The menu changes are covered in rail/hosts_test.go. Error paths are covered for the new behavior: the too-old host error, the error-style notice, and the group refusal. Generic transport errors in ApplyCall are pre-existing and shared with the other ops. Docs and the e2e README are excluded by the check. The check passes.

Full details: Breaking Change Disclosure

Explanation

The check covers breaking changes to the public CLI (flags, subcommands), stored Settings values, documented environment variables, and MCP tool names or schemas. I inspected the PR's changed-file list and the non-test, non-doc diff. No CLI flag, subcommand, Settings key, environment variable, or MCP tool name or schema changes. The new remote delete path calls the existing agent-manager delete --json -- &lt;id&gt; command on the host, and the PR does not alter that command. The removed lines are in UI rendering and routing (internal/ui/...), refusal text, and docs. Under this check's scope, those are not public-interface changes. One behavior change is worth noting but falls outside the check's listed categories. On a remote terminal, d now closes the terminal instead of refusing. That is a TUI key-behavior change, not a CLI, Settings, environment-variable, or MCP change, and internal/ identifiers are not public API under this check. No Breaking Changes section is required, so the check passes.

Full details: Visual Evidence

Explanation

The change can be shown visually. It changes TUI behavior: the footer, row menus, confirm dialog, and status lines. The PR description has a "Visual evidence" section. It gives a "Before" frame, from a build of main, showing d on a remote agent with the message "delete isn't available on SSH connections yet". It gives an "After" footer frame that names d delete. It also gives several after frames: the two-terminal confirm, the deleted-agent status, the kept-worktree notice, the row menu with Delete, and the group refusal. The author captured the frames as text with tmux capture-pane -p. Text captures of a terminal UI are an accepted form of visual evidence here. The before and after pair covers the core change. The section also says the evidence came from real runs on an isolated host over ssh localhost. The check passes. I did not run tools, because the check depends only on the description text.

Full details: Tool And Platform Coverage

Explanation

Overall: PASS. Tool coverage passes, and the platform/terminal portion passes on the documented-exclusion rule. Tool coverage (PASS). The PR adds OpDelete and a remote Delete call. It routes that call to the host's existing agent-manager delete. The path has no per-tool branch: - internal/sessioncmd/session_lifecycle.go Delete (approx. lines 62-99) selects the target and its child terminals, then calls DeleteForHuman. The shared lifecycle code calls Driver.Kill, the hooks removal, Store.Delete, and cleanupDeletedWorktree. - internal/hooks/hooks.go RemoveAgentFiles removes files by session ID. It does not read tool configuration. - The tools.* lookups in lifecycle.go belong to revive, relaunch, and launch. Delete does not reach them. The PR's claim that the call is the same for every CLI in builtinTools holds. Nothing in the changed code excludes a tool. Tool coverage is therefore not missing. The builtinTools source is internal/config/builtin.go, which the task's internal/config/config.go reference loads with toml.Decode. Platform and terminal (PASS under documented exclusions). - Build matrix: .goreleaser.yaml builds darwin, linux, and windows on amd64 and arm64. Because the changed Go code has no runtime.GOOS branch, no platform-specific code path is introduced. - Terminal features: the changed files do not reference TERM_PROGRAM, TERM, SSH_CONNECTION, or any tmux version feature. The delete reuses the existing kill and worktree removal paths. - Verification gap: the PR says only macOS was driven. It states that Linux, WSL2, and a Windows local machine were not driven. It does not name a tmux version. The PR states that it adds no platform or terminal branch and reuses the kill path. Under the check, a documented exclusion passes the platform portion. The maintainer decides whether to accept that gap. Caveat. The PR template ticks "Holds for every supported platform ... and terminal." The Scope section and the verification notes name what was not tested, so the documented exclusion governs. The maintainer should confirm that the exclusion is acceptable.

Full details: Input And Configuration Surface

Explanation

The check fails only on three conditions. Each is absent from this diff. 1. Keyboard-only or mouse-only actions. The one new action is delete on a remote agent. It has a keyboard path and a mouse path: - Keyboard: SessionCall maps uirail.Delete to OpDelete (internal/ui/connections/call.go). RemoteLegend adds k(keybind.Delete), "delete" for non-terminal rows (internal/ui/rail/legend.go). This is the footer that names the key d. - Mouse: remoteMenuItems adds a Delete menu item on live, dead and archived remote agents (internal/ui/rail/menu.go). The PR description also records a mouse click on that menu item. - The ? key map is updated in internal/ui/help/catalog.go. - d on a remote terminal reuses the existing close path (OpCloseTerminal, the same path as Kill). It is a keyboard alias for an action that already has a menu item. It is not a new mouse-less action. - The remote group refusal text changed. That is not a new action. 2. User-facing settings read from a hand-edited file or environment variable. The added lines contain no env, config-file, or settings reads. The only match for the search terms was the confirmRemote function signature. 3. Hard-coded lists of upstream-changeable values. No model, thinking-mode, capability, or prompt list was added. The delete call uses the host's own agent-manager delete --json command. It does not use a tool list. Only the listed files changed (docs, remote operations, UI connections, rail, help, and tests). None introduces a new setting or value list.

Full details: No Speculative Fallbacks

Explanation

The check fails only for a new fallback, nil-guard, or dual path that handles a shape this repository cannot produce. Reviewing the production changes against the base found no such branch: - internal/ui/connections/call.go: SessionCall routes Delete on a terminal row to OpCloseTerminal and on an agent row to OpDelete. Terminal rows exist, so both branches are reachable. - internal/ui/connections/link/call.go: ApplyCall branches on result.Notice != "". sessioncmd.Deletion.Notice is set on real host paths ("worktree kept (has work)" and "worktree kept (used by another session)" in internal/sessioncmd/lifecycle.go). The empty case is the normal successful delete, so both branches are reachable. - internal/ui/connections_adapter.go: confirmRemote branches on call.Op == OpDelete, a plain operation check. The zero-terminal case is handled by the existing uisession.FollowConfirmLabel, and the PR adds no guard for it. - internal/ui/connections/rows.go: the terminal count loop adds no nil or existence guard. Zero is a valid count. - internal/ui/rail/legend.go and menu.go: the new branches choose between real row kinds (terminal or agent; live, dead, archived). - internal/remote/operations.go: the body of Delete predates the PR. Only the doc comment changed. - The old-host "too old" path is existing behavior. The PR only adds a test line for it. Test-only additions and the e2e scenario contain no production fallback. No speculative fallback was found.

Full details: Scope Fidelity

Explanation

The Scope section (Required behavior and Why this approach) is present and specific, so this check applies. The diff adds user-visible behavior that the Scope section does not request. 1. Row menu for remote shell/terminal rows. In internal/ui/rail/menu.go, remoteMenuItems drops the if !row.sess.IsShell gate. Live remote rows now always list "Quick prompt mode" and "New terminal", including terminal rows, which previously hid them. Neither the Required behavior list nor Why this approach covers this, and the PR body does not mention it. 2. d on a remote terminal now closes it. In internal/ui/connections/call.go, SessionCall maps Delete on a terminal row to OpCloseTerminal. The Required behavior list does not include this. The PR body describes it, but the Scope section does not. Weaker items a strict reader could also flag: the footer and legend entries, the ? help-catalog text, and the e2e README correction (which the author marks as "Not strictly part of this change"). The footer, legend and help changes are plausible consequences of a new action, so they were not relied on. Changes that match the Scope section include the agent Delete op and confirm, the terminal-count confirm, the host notice line, the group refusal message, the too-old error test, and the connections.Row terminal count.

Resolution

Either: - Restore the if !row.sess.IsShell gate in remoteMenuItems (internal/ui/rail/menu.go) so remote terminal rows do not list "Quick prompt mode" or "New terminal". Or add that menu change to the Scope section with a reason. - Remove the terminal branch that maps d to OpCloseTerminal in SessionCall (internal/ui/connections/call.go), or add "d on a remote terminal closes it" to Required behavior with a reason. - Optionally split out the e2e README correction, as the author proposes, and add the footer, legend and help-catalog changes to Scope if they are intended.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit taps the delete key,
Then waits for hosts to answer back.
Clean worktrees leave with agents,
Dirty ones stay with a notice,
And terminals close on their own.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d8d389f and 53a6b53.

Files selected for processing: 19

  • docs/ssh-connections.md
  • docs/usage.md
  • internal/remote/operations.go
  • internal/remote/operations_test.go
  • internal/ui/connections/call.go
  • internal/ui/connections/call_test.go
  • internal/ui/connections/link/call.go
  • internal/ui/connections/link/call_test.go
  • internal/ui/connections/rows.go
  • internal/ui/connections/rows_test.go
  • internal/ui/connections_adapter.go
  • internal/ui/connections_adapter_test.go
  • internal/ui/help/catalog.go
  • internal/ui/rail/hosts_test.go
  • internal/ui/rail/legend.go
  • internal/ui/rail/legend_test.go
  • internal/ui/rail/menu.go
  • tools/e2e/README.md
  • tools/e2e/ssh_scenarios.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Recent review details

Context from checks skipped due to timeout: 8

  • GitHub Check: CodeRabbit
  • GitHub Check: test-macos
  • GitHub Check: test-windows (ui M-Z)
  • GitHub Check: cross-build
  • GitHub Check: test-windows (other packages)
  • GitHub Check: ssh-windows-client
  • GitHub Check: test-linux
  • GitHub Check: test-windows (ui A-L)
Additional context used

Code guidelines: 5

docs/architecture.md — auto-discovered
DESIGN.md — configured
AGENTS.md — auto-discovered
PRODUCT.md — configured
REVIEW.md — configured
Path-based instructions: 9

Bubble Tea: one Model, files grouped by feature.

CodeRabbit configuration file

Files:

  • internal/ui/connections/call.go
  • internal/ui/connections/call_test.go
  • internal/ui/connections/link/call.go
  • internal/ui/connections/link/call_test.go
  • internal/ui/connections/rows.go
  • internal/ui/connections/rows_test.go
  • internal/ui/connections_adapter.go
  • internal/ui/connections_adapter_test.go
  • internal/ui/help/catalog.go
  • internal/ui/rail/hosts_test.go
  • internal/ui/rail/legend.go
  • internal/ui/rail/legend_test.go
  • internal/ui/rail/menu.go
Tests live beside the file they cover (listview.go -> listview_test.go).

CodeRabbit configuration file

Files:

  • internal/remote/operations_test.go
  • internal/ui/connections/call_test.go
  • internal/ui/connections/link/call_test.go
  • internal/ui/connections/rows_test.go
  • internal/ui/connections_adapter_test.go
  • internal/ui/rail/hosts_test.go
  • internal/ui/rail/legend_test.go
Comments are rare and explain a non-obvious why, never what the code does.

CodeRabbit configuration file

Files:

  • internal/remote/operations.go
  • internal/remote/operations_test.go
  • internal/ui/connections/call.go
  • internal/ui/connections/call_test.go
  • internal/ui/connections/link/call.go
  • internal/ui/connections/link/call_test.go
  • internal/ui/connections/rows.go
  • internal/ui/connections/rows_test.go
  • internal/ui/connections_adapter.go
  • internal/ui/connections_adapter_test.go
  • internal/ui/help/catalog.go
  • internal/ui/rail/hosts_test.go
  • internal/ui/rail/legend.go
  • internal/ui/rail/legend_test.go
  • internal/ui/rail/menu.go
Applicability reference: AGENTS.md: # Agent notes `internal/ui` is the Bubble Tea program: one `Model` that routes messages and composes the frame.

CodeRabbit inference engine (docs/architecture.md)

Files:

  • internal/ui/connections/call.go
  • internal/ui/connections/call_test.go
  • internal/ui/connections/link/call.go
  • internal/ui/connections/link/call_test.go
  • internal/ui/connections/rows.go
  • internal/ui/connections/rows_test.go
  • internal/ui/connections_adapter.go
  • internal/ui/connections_adapter_test.go
  • internal/ui/help/catalog.go
  • internal/ui/rail/hosts_test.go
  • internal/ui/rail/legend.go
  • internal/ui/rail/legend_test.go
  • internal/ui/rail/menu.go
Tmux socket isolation: Fail if changed Go code introduces a tmux invocation that does not name a socket.

CodeRabbit inference engine (Custom checks)

Files:

  • internal/remote/operations.go
  • internal/remote/operations_test.go
  • internal/ui/connections/call.go
  • internal/ui/connections/call_test.go
  • internal/ui/connections/link/call.go
  • internal/ui/connections/link/call_test.go
  • internal/ui/connections/rows.go
  • internal/ui/connections/rows_test.go
  • internal/ui/connections_adapter.go
  • internal/ui/connections_adapter_test.go
  • internal/ui/help/catalog.go
  • internal/ui/rail/hosts_test.go
  • internal/ui/rail/legend.go
  • internal/ui/rail/legend_test.go
  • internal/ui/rail/menu.go
Source excerpt: Every theme implements the same semantic roles.

CodeRabbit inference engine (DESIGN.md)

Files:

  • internal/ui/connections/call.go
  • internal/ui/connections/call_test.go
  • internal/ui/connections/link/call.go
  • internal/ui/connections/link/call_test.go
  • internal/ui/connections/rows.go
  • internal/ui/connections/rows_test.go
  • internal/ui/connections_adapter.go
  • internal/ui/connections_adapter_test.go
  • internal/ui/help/catalog.go
  • internal/ui/rail/hosts_test.go
  • internal/ui/rail/legend.go
  • internal/ui/rail/legend_test.go
  • internal/ui/rail/menu.go
Source excerpt: A Go source file stays under 1,000 lines; `tools/architecture/check-file-sizes` fails on one that reaches it.

CodeRabbit inference engine (AGENTS.md)

Files:

  • internal/remote/operations.go
  • internal/remote/operations_test.go
  • internal/ui/connections/call.go
  • internal/ui/connections/call_test.go
  • internal/ui/connections/link/call.go
  • internal/ui/connections/link/call_test.go
  • internal/ui/connections/rows.go
  • internal/ui/connections/rows_test.go
  • internal/ui/connections_adapter.go
  • internal/ui/connections_adapter_test.go
  • internal/ui/help/catalog.go
  • internal/ui/rail/hosts_test.go
  • internal/ui/rail/legend.go
  • internal/ui/rail/legend_test.go
  • internal/ui/rail/menu.go
Applicability reference: AGENTS.md: # Agent notes Keep agent-manager a thin wrapper around the supported TUIs.

CodeRabbit inference engine (PRODUCT.md)

Files:

  • docs/ssh-connections.md
  • docs/usage.md
  • internal/remote/operations.go
  • internal/remote/operations_test.go
  • internal/ui/connections/call.go
  • internal/ui/connections/call_test.go
  • internal/ui/connections/link/call.go
  • internal/ui/connections/link/call_test.go
  • internal/ui/connections/rows.go
  • internal/ui/connections/rows_test.go
  • internal/ui/connections_adapter.go
  • internal/ui/connections_adapter_test.go
  • internal/ui/help/catalog.go
  • internal/ui/rail/hosts_test.go
  • internal/ui/rail/legend.go
  • internal/ui/rail/legend_test.go
  • internal/ui/rail/menu.go
  • tools/e2e/README.md
  • tools/e2e/ssh_scenarios.py
Applicability reference: AGENTS.md: # Agent notes Project context for coding agents.

CodeRabbit inference engine (REVIEW.md)

Files:

  • docs/ssh-connections.md
  • docs/usage.md
  • internal/remote/operations.go
  • internal/remote/operations_test.go
  • internal/ui/connections/call.go
  • internal/ui/connections/call_test.go
  • internal/ui/connections/link/call.go
  • internal/ui/connections/link/call_test.go
  • internal/ui/connections/rows.go
  • internal/ui/connections/rows_test.go
  • internal/ui/connections_adapter.go
  • internal/ui/connections_adapter_test.go
  • internal/ui/help/catalog.go
  • internal/ui/rail/hosts_test.go
  • internal/ui/rail/legend.go
  • internal/ui/rail/legend_test.go
  • internal/ui/rail/menu.go
  • tools/e2e/README.md
  • tools/e2e/ssh_scenarios.py
Learnings: 1

Common learnings

Learnt from: CR
Repo: wainmann/agent-manager PR: 0
File: REVIEW.md:0-0
Timestamp: 2026-11-07T23:23:34.517Z
Learning: Applicability reference:
AGENTS.md: # Agent notes
Project context for coding agents. Human setup and PR conventions live in
[.github/CONTRIBUTING.md](.github/CONTRIBUTING.md), and what a review looks
for in [REVIEW.md](REVIEW.md). Fill the Scope section of the pull request
template: a review reads it to tell the change you meant from the change you
made.

AGENTS.md: # Agent notes
## What every change covers
A feature, a tool, or a fix is done when it holds on the whole matrix. The
matrix is every CLI in `builtinTools` (`internal/config/config.go`), every
platform `.goreleaser.yaml` builds plus WSL2, every terminal that reaches
the manager, local or over SSH, and both input methods. A change that
covers a subset names what it leaves out in the PR description and what
covering the rest would take. Disclosure alone does not approve partial tool
coverage. [REVIEW.md](REVIEW.md#tool-coverage) defines the allowed exceptions.

Source excerpt:
# Review policy

## Other review requirements

The...
Learnt from: CR
Repo: wainmann/agent-manager PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-11-07T23:23:39.842Z
Learning: Source excerpt:
Input and configuration surface: Fail when the diff adds a UI action, row, panel, or handle that works by keyboard only or by mouse only; each new action has both, and the footer or key map names the key. Fail when the diff adds a user-facing setting that is read from a hand-edited file or an environment variable instead of a Settings row the manager stores. Fail when the diff adds a list of values an upstream release can change (model names, thinking modes, capabilities, prompts) instead of discovering them at runtime. Pass when the change touches none of these surfaces.
Ruff (0.17.4)

tools/e2e/ssh_scenarios.py

[error] 262-262: Possible SQL injection vector through string-based query construction

(S608)

Additional comments: 1

internal/ui/connections_adapter_test.go: 1

68-69: Functional Correctness

The new delete fixtures get a flat session response from the fake. That response decodes into sessioncmd.Deletion because Session is embedded with no JSON name, so encoding/json promotes its fields. The claimed decode failure does not occur.

@agent-manager-bot agent-manager-bot Bot added area:ui Layout and chrome needs-triage New. Nobody on the team has looked at it yet. size:s 50 to 149 changed lines type:feature New feature or request waiting-on-team Waiting for a team comment or review labels Nov 16, 2026

@YoanWai YoanWai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, merged! Ships in the next release.

@YoanWai
YoanWai merged commit 934c74b into wainmann:main Nov 16, 2026
18 checks passed
@pandysp
pandysp deleted the fix/ssh-delete branch November 16, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui Layout and chrome needs-triage New. Nobody on the team has looked at it yet. size:s 50 to 149 changed lines type:feature New feature or request waiting-on-team Waiting for a team comment or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants