Skip to content

feat(console): full operator control — fix kill, add pause/resume, spawn/purge/status#200

Open
Lanzelot1 wants to merge 1 commit into
feat/console-viewsfrom
feat/console-control
Open

feat(console): full operator control — fix kill, add pause/resume, spawn/purge/status#200
Lanzelot1 wants to merge 1 commit into
feat/console-viewsfrom
feat/console-control

Conversation

@Lanzelot1

Copy link
Copy Markdown
Collaborator

What

Makes the console a real "lazygit for Cotal" operator surface. Stacked on #197 (feat/console-views) — retarget to main once #197 merges.

The bug this fixes

D-kill sent requestControl("manager", …) — the privileged tier, where the manager only stops your own spawned child — using the console's self-minted god-view admin cred, which has no ctl.* publish grant. So on any auth mesh, kill silently did nothing. Now every control action mints a per-action, tier-scoped caller cred from held trust material (open mesh: bare; --creds: as-is) and targets the right tier — the same pattern the CLI (askManager) and web (channel-purger) already use. Gated on a new canControl, distinct from chat-write.

New capability: pause/resume (new wire ops)

Freeze an agent in place — SIGSTOP/SIGCONT to the pty process group (POSIX only; tmux/cmux have no owned pid and win32 has no job-control signals, so both error loud, no fallback). Same authority as a named stop. Paused-ness lives in the manager's managed-state (ps/status), not presence — a stopped agent can't heartbeat, so its presence would TTL to "offline" and lie; the console merges ps by id and shows a ⏸ paused badge. A graceful stop of a paused agent resumes it first (SIGTERM isn't delivered to a stopped process).

Console affordances (graduated destructiveness)

  • p on a roster agent → pause/resume, no confirm (recoverable).
  • D → kill behind a confirm: y graceful stop, f force-kill.
  • : palette: spawn <persona> [name], status <agent>, ps, purge (type-the-name confirm).
  • Every action flashes its result; StatusBar/Help updated.

Verified

  • pnpm typecheck + pnpm test clean; view/connect/lifecycle-e2e smokes pass.
  • New pause-resume-live smoke (15 checks) against a real broker + manager + process: real OS freeze (state T), tier denial for a non-spawner (regression guard for the old kill bug), control-caller-admin cred scoped to ctl.admin only, unsupported-runtime error, and graceful-stop-of-paused (SIGCONT-first).
  • Live TUI: kill confirm renders the graceful/force choice; p and :ps reach the manager end-to-end (an old v0.10 manager on the running mesh returns unknown op: pause, confirming the console wire works — the new op is proven by the smoke).

Notes

  • No SPEC/schema change: control op vocabulary is implementation-defined (SPEC §5 defines only the envelope).
  • docs/architecture.md + docs/protocol-view.md updated in-change.

…awn/purge/status

The console was ~90% observer + chat; its one control (D-kill) was mis-tiered
(privileged, where the manager only stops your own child) and used the
read-only god-view cred, so it silently failed on auth meshes. Now every
control action mints a per-action, tier-scoped caller cred from held trust
material (open mesh: bare; --creds: as-is) and targets the right tier —
gated on a new canControl distinct from chat-write.

- core/manager: new pause/resume ops (SIGSTOP/SIGCONT the pty process group,
  POSIX-only; tmux/cmux + win32 error loud). Paused-ness lives in managed-
  state (ps/status), not presence — a stopped agent can't heartbeat; a
  graceful stop resumes before SIGTERM so it can't hang.
- console: D-kill fixed (admin tier + mint) with y=graceful / f=force; roster
  'p' pause/resume toggle with a ps-merged ⏸ badge; palette :spawn/:purge/
  :status/ps; every action flashes its result.
- pause-resume-live smoke (15 checks): real freeze (state T), tier denial for
  a non-spawner (the old kill bug), and control-caller-admin cred scoping.
@Lanzelot1 Lanzelot1 force-pushed the feat/console-views branch from 61a33a9 to 16e5570 Compare July 8, 2026 09:42
@Lanzelot1 Lanzelot1 force-pushed the feat/console-control branch from e29a877 to f4d3961 Compare July 8, 2026 09:42
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