M29: team answers (approvals, questions and follow-ups from anyone on the team) #46
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: #45, #38 (its MVP cut)
Blocks: #40
Part of: #44
Swarm MVP. When any agent on any of the team's machines asks something, anyone on the team who may answer can: from the rail, the pane or their phone. They can also send the agent its next instruction. Everyone sees who did it.
editoron the pane's session (M12): the owner, people it was shared with as editors, and team editors on team daemons (Acl::set_team_roles). Viewers see the card, its question and who answered, but get no buttons.approve,answeranddeclinerecord the principal from the request, in the block's log, the transcript,history,searchand the audit log;illogicalhooks set as M6c's.promptmethod, attributed.needs-inputgoes to every editor of the session who opted in. That already holds through control (M21); do the same for the daemon's own push and for M14's trust requests.cargo test; Sam, a team editor on another network, allows it from the phone;illogical log %N --whoandhistoryshow both, attributed to Sam;From S18:
Done 2026-10-02, apart from real phones. Merged in
a35f4a6.What landed:
Every answer has an author. Approvals, answers and skips record who made the request, whether they came from a card,
call,/api/attention/actor a notification. It shows in:illogical history,illogical log %N --who);Every client's card closes saying "Allowed by Sam, 14:02", and the first answer wins.
Permission prompts in terminals. Claude Code's tool permission prompts become approval cards through
illogical hookon thePermissionRequesthook. Each card is matched to thePreToolUsejust before it. It shows the tool and its input (command, file, diff), with Claude's own suggestions: Allow, Always (keeps that rule), Deny, and Deny with a message. AskUserQuestion stays withillogical ask.Cards close when the terminal answers first: on
PostToolUseorPostToolUseFailure, on the session's nextPreToolUse,Stop,UserPromptSubmitorSessionStart, or on SIGTERM after "No" or Esc.Follow-ups. After an answer, the card offers "Send a follow-up" (
POST /api/panes/N/followup).illogical inbox, a background (asyncRewake) hook on Stop and SessionStart. There's one waiter per pane, and follow-ups queue until one is waiting. Nothing is typed into the prompt, and the follow-up is recorded as the sender's input.Who's looking: the card shows the avatars of teammates who have the pane open.
Push to the team. needs-input goes to the owner and to editors who opted in, per session or for everything they may edit (
/api/notify). This covers the daemon's own push, whose subscriptions now belong to a person, and pushes through control.Answering from a notification.
sw.jsis now built fromsrc/sw.ts.Viewers see the card and who answered, with no buttons, and the API returns 403.
Tests:
crates/daemon/tests/team_answers.rs, on S18's fixtures.web/e2e/team-answers.spec.tsfor the done-when: Jake's machine and a team box, both reached through control's relay, and Sam in a phone-sized context. It covers the viewer's 403 and an Allow from the service worker.agents_real.rsteam, opt-in, with real Claude Code on haiku: a tool allowed from the card ran, and a follow-up through the inbox woke the idle agent.Not covered:
Changes from before: notifying editors through control is now opt-in, where M21 sent to every editor.
Done: merged to main in
a35f4a6(Merge M29). Not yet checked on real phones.