session/delete method lets Clients remove sessions from an Agent’s session/list results, so users can clean up session history from any ACP Client.
Before deleting sessions, Clients MUST first complete the initialization phase and verify the Agent supports this capability.
Checking support
Before attempting to delete a session, Clients MUST verify that the Agent supports this capability by checking thesession.delete field in the initialize response:
session.delete is omitted or null, the Agent does not support deleting sessions and Clients MUST NOT attempt to call session/delete. Supplying {} means the Agent supports the method.
Deleting a session
Clients delete a session by callingsession/delete with the session ID to remove from session history:
Semantics
- Deleted sessions no longer appear in future
session/listresults. - Deleting an already-deleted session, or a session that never existed, SHOULD succeed silently.
- Clients SHOULD treat a
-32002response tosession/deleteas a successful delete. - Agents MAY implement soft delete or hard delete.
- Later requests for a deleted session, including
session/resume, fail with-32002, apart fromsession/deleteandsession/close. See Unknown Sessions. - The Agent MUST cancel the session’s ongoing work and free its resources before it deletes the session. If the session is active on any connection, it does so as if
session/closehad been called. - A child session cannot be deleted on its own. Agents SHOULD reject a
session/deletethat names one with-32602.