M24: attention reasons and actions #38
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Depends on: #36 (classification only; the rest can start now)
Blocks: #40
Swarm track. Attention says what happened, not just "needs you", so the client can explain it, bundle it with others and act on it.
Today
Attentionisidle | working | needs_input | done, plus anAskfor question cards. Keep those states, and add a reason to every non-idle one.ask: an openAsk(agent blocks, and Claude Code through its hook), with its headline;failed: a command that ran longer than a few seconds ended with a non-zero exit (from shell integration'sCommandEnd);exited: a pane's program died with a non-zero code, mainly servers andRerun/Hookpolicies (fromExit), ormachine_gone;input: the pane waits on a prompt. That covers bell andNotify, plus prompt detection for[sudo] password,[y/N]and(y/n), and "Enter passphrase", when output stops on that line;done: a long command finished while nobody was looking (today'sdone), with its duration.since_ms, a one-lineheadline, the command and exit code where there is one, and a bundle key:failedandexitedbundle by machine;askbundles by project and agent;inputnever bundles.POST /api/attention/act) taking one pane or a list:allowanddeny: answer anask(wrapping/api/panes/{id}/ask);rerun: run the last command again (the "Run again" menu item);restart: restart the pane's program under its policy;send: type an answer (y, Enter), forinput;dismiss: today'sPaneOp::Attention.illogical attention --jsonlists the reasons;illogical eventsstreams changes;cargo test, a dyingnpm run dev, asudoprompt, a Claude Code question and a 10-minute build each show the right reason and headline inillogical attention;Part of the Swarm MVP (#44). The MVP cut of this ticket is listed there; anything not on that list is after the MVP.
Done 2026-10-02, cut to the MVP (#44). Merged in
4e34244.What landed:
PaneInfo.reason):since_ms, a headline, the command, exit and duration where there is one, a bundle key and its actions.failed:<machine>,exited:<machine>,ask:<project>:<agent>. done and input never bundle.POST /api/attention/acttakes one pane or a list: allow and deny for approvals, answer and deny for questions, and dismiss. Editor is checked on each pane, and each pane gets its own result.GET /api/attentionandillogical attention [--json]list the reasons.illogical eventscarries the reason on attention events.Tests:
crates/daemon/tests/attention.rs: a failing cargo test, a long build, Claude Code's question answered through act, three agent approvals allowed and denied as a list, the push's actions, and events.web/e2e/attention.spec.ts: dismissing on one client clears it on the other, and a pushed failure offers Dismiss.Not covered (after the MVP):
[sudo],[y/N]);What's left: Claude Code's terminal permission prompts come with M29 (#46). The ask bundle's project switches to M23's when #37 merges.
Done: merged to main in
4e34244(Merge M24), cut to the swarm MVP scope (#44).