feat(cli): notify and chat commands for hybrid sessions (5/6) #342
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 626 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.385
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #342"
general
weight: 0.35
mzdluo123
Part 5 of
add-agent-shell-control(stacked on #341). Covers tasks §3 (attention API andnotify) and §4 (chat commands). The workspace commands (§5) were split out into a sixth PR because of their size; tasks §0 is updated.Changes
Attention from scripts
POST /api/sessions/{id}/attentionwith body{kind, message?}.kindis notify, done, error or question.- The attention source is the new
cli. It replaces whatever attention is latched, regardless of source layering.- After that, the usual rules clear it: user input, the program's next status report, or DELETE.
- On a hybrid session's chat side, it lasts until the agent reports a new state.
-
messageis at most 200 characters and lives only in memory.DELETE /api/sessions/{id}/attentionclears attention from any source, the same way user input does, and syncs to every device.include_titlelike the title. The in-page toast shows the message as its detail line.webmux notify [--kind] [--session] [MESSAGE...]andnotify --clear.Chat commands
chat send(--attach,--mode steer,--wait,--auto-wait-requests,--timeout),chat watch,chat status,chat cancel,chat answer,chat switch,chat ls,chat resume,chat forget,chat set,chat permission, andchat queue ls|rm|edit|send-now|clear|resume.-
ChatPromptResultnow carriesturnIdandpromptId.-
turn.startnow carriesqueueItemIdfor the queued prompt it sends.send --waitnow ends with exit 1 when its queued prompt is removed before it is sent.chat switchanswers a pending choice:-
--forceforces the switch;- otherwise it cancels the switch and exits 1, so the switch is never left waiting for a choice.
-
chat answeruses--content JSONand--declineinstead of--json BODY, because--jsonis the output switch on every command.- Queue subcommands put the verb before the session:
chat queue ls SESSION.Env.Interactivedrives confirmations.chat forgetasks first on a terminal and needs--yesotherwise.Fixes merged forward from #341
rmnow ends a running session before removing it. The server answers 409 for a running session.send --keynow waits for each key to be acknowledged.Docs
/llms/chat.md;sessions.md,launch.mdand recipes updated; the generated command reference regenerated.http-sessions,http-hybrid,http-push) and spec deltas updated.User stories
Screenshots
The toast while browsing, using isolated demo data:
webmux notify --kind done "…".Both captures come from this branch's binary; the OSC 9 rendering is unchanged.
| | Before | After |
|---|---|---|
| Desktop light |  |  |
| Desktop dark |  |  |
| Mobile light |  |  |
Verification
make checkpasses: format, docs guard, Oxlint, archtest,go vet, and golangci-lint with 0 issues.go test -raceon session, push, hybrid, sessioncmd, agentguide, archtest, wire, contract andcmd/webmux.- The
cmd/webmuxend-to-end tests use a real server and the fake ACP agent, and cover notify, every chat command, switching both ways, and resume/forget.go test ./internal/apipasses exceptrepository-commits, which differs only on the local git 2.43 date format and is green in CI.check:arch, andattention.spec.tsE2E including the new notify toast test.chat switch(reviewed only) and macOS.---
_Generated by Claude Code_