Slice 4: graceful project handoff (pending switch + ack)
Add pending-switch coordination to internal/activity (RequestSwitch/PendingSwitch/AckSwitch/CancelSwitch); AckSwitch atomically sets the active project and records switch-completed with Claude's summary. New MCP tools get_pending_switch and ack_switch (request is user-only via HTTP). HTTP GET/POST/DELETE /api/switch. New <handoff-bar> component (ask/waiting/cancel/completed) over SSE; activity-feed reflects switch-completed. Test covers request->ack->clear. Verified live: request/waiting/cancel over SSE. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# handoff-bar
|
||||
|
||||
## Intent
|
||||
The user-facing control for the **graceful project handoff** (AGENT.md §8.3). It
|
||||
lets the user ask Claude to switch to the active project, shows the "waiting for a
|
||||
good stopping point" state while the request is pending, and announces completion
|
||||
(with Claude's summary of where it left off) when Claude calls `ack_switch`. The
|
||||
switch is Claude-completed at a checkpoint, never app-forced (§1.4-class rule).
|
||||
|
||||
## Public surface
|
||||
- **Tag:** `<handoff-bar>`
|
||||
- **Attributes/properties:** none.
|
||||
- **Fetches (initial):** `GET /api/switch` (pending request), `GET /api/active-project`.
|
||||
- **Writes:** `POST /api/switch {target}` to request a handoff to the active
|
||||
project (actor=user); `DELETE /api/switch` to cancel.
|
||||
- **Subscribes:** `EventSource('/events')` — reacts to `switch-requested`,
|
||||
`switch-completed` (shows Claude's summary), `switch-cancelled`, and
|
||||
`active-project-changed`. Closed on disconnect.
|
||||
|
||||
## History
|
||||
- 2026-09-20: created — slice 4; request/pending/completed UI over the
|
||||
`/api/switch` endpoints and SSE.
|
||||
|
||||
## Notes / gotchas
|
||||
- All server-derived text is escaped before insertion (targets, summaries).
|
||||
- The request targets the current **active project**; select a repo first (that
|
||||
sets the active project via `<repo-list>`).
|
||||
- The completion message persists until the next request; it is informational.
|
||||
Reference in New Issue
Block a user