feat(dashboard): x stops a dashboard-owned bottle
#46
Reference in New Issue
Block a user
Delete Branch "chunk-4-explicit-stop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Final PRD 0020 chunk.
xon a focused agents-pane row tears down the selected bottle if the dashboard owns it (started via the chunk-2nflow):(cm, bottle, identity)from the main loop'sbottlesmap.capture_session_state(identity, 0)— best-effort transcript snapshot before teardown.cm.__exit__(None, None, None)— drives the existing compose-down + network-remove sequence.settle_state(identity)— honors any pre-existing preserve marker (capability-block sets one; if present, state stays and the resume hint prints).On a non-owned slug (discovered via
list_active_slugsbut not in the dashboard'sbottlesdict — i.e., previous-dashboard or external./cli.py startbottle),xis a no-op with a status hint pointing at./cli.py cleanup. Matches the PRD's cross-dashboard model: re-attach works either way, but explicit stop only works on what the dashboard started.Chunk 5 is satisfied
The PRD's chunk 5 ("quit-cleanup") is satisfied by the existing no-op behavior of
q— per the user's resolved-question answer, quit leaves bottles running unchanged. No code change needed for that, just the implicit documentation in the chunk-2bottlesdict comment.Status
cm.__exit__machinery via the test_supervise_sidecar smoke test[x] stopxstops a dashboard-owned bottle (PRD 0020 chunk 4)Final PRD 0020 chunk. `x` on a focused agents-pane row tears down the selected bottle if the dashboard owns it (started via the chunk-2 `n` flow): pops `(cm, bottle, identity)` from the main loop's bottles map, snapshots the transcript best-effort, calls `cm.__exit__(None, None, None)` to drive the existing compose-down + network-remove sequence, then `settle_state` to honor any pre-existing preserve marker. On a non-owned slug (discovered via `list_active_slugs` but not in the dashboard's bottles dict — i.e., previous-dashboard or external `./cli.py start` bottle), `x` is a no-op with a status hint pointing at `./cli.py cleanup`. Matches the PRD's cross-dashboard re-attach model: the dashboard can re-attach either kind, but can only tear down its own. The PRD's chunk 5 ("quit-cleanup") is satisfied by the existing no-op behavior of `q` — per the user's resolved-question answer, quit leaves bottles running unchanged. No code change needed for that. Footer surfaces `[x] stop`. 465 unit tests pass (1 new for the non-owned no-op path; the owned path is integration territory because it drives a real compose-down).didericis referenced this pull request2026-05-26 03:52:22 -04:00