fix(tasks): close stale terminal acp sessions

This commit is contained in:
Peter Steinberger
2026-04-28 21:03:47 +01:00
parent 3cad579c4e
commit 5dfc14d49b
6 changed files with 369 additions and 4 deletions

View File

@@ -143,6 +143,7 @@ Quick `/acp` flow from chat:
<Accordion title="Lifecycle details">
- Spawn creates or resumes an ACP runtime session, records ACP metadata in the OpenClaw session store, and may create a background task when the run is parent-owned.
- Parent-owned ACP sessions are treated as background work even when the runtime session is persistent; completion and cross-surface delivery go through the parent task notifier rather than acting like a normal user-facing chat session.
- Task maintenance closes terminal parent-owned one-shot ACP sessions. Persistent ACP sessions are preserved while an active conversation binding remains; stale persistent sessions without an active binding are closed so they cannot be silently resumed after the owning task is done.
- Bound follow-up messages go directly to the ACP session until the binding is closed, unfocused, reset, or expired.
- Gateway commands stay local. `/acp ...`, `/status`, and `/unfocus` are never sent as normal prompt text to a bound ACP harness.
- `cancel` aborts the active turn when the backend supports cancellation; it does not delete the binding or session metadata.