You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]:add session/delete method to ACP for programmatic session cleanup #54478
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Description
OpenCode’s ACP protocol already supports session-related methods such as session/new, session/load, session/list, session/fork, session/prompt, and session/cancel. The CLI also supports deleting sessions, for example opencode session delete <id>.
However, ACP currently does not expose a session/delete method. This makes it impossible for IDE clients, editor plugins, or automation tools to delete a session purely through the ACP protocol. Clients that want to clean up sessions must fall back to CLI commands or other APIs, which breaks the consistency of ACP as a unified session management protocol.
Adding session/delete would complete the ACP session lifecycle and allow clients to create, load, list, fork, cancel, and delete sessions through the same interface.
Motivation
Make the ACP session lifecycle complete and symmetric.
Allow IDE/editor clients to delete sessions without shelling out to the CLI.
Improve automation scenarios such as tests, CI workflows, and multi-session orchestration.
Keep ACP consistent with existing OpenCode session capabilities.
Good news: OpenCode v2 (@opencode/cli, 2.x) already supports session/delete over ACP. It has been in every release tag I checked, back to v2.0.7, and initialize advertises it under agentCapabilities.sessionCapabilities.delete. How it works now:
Request params: { "sessionId": "ses_..." }.
If the session has a turn running, that turn is cancelled first, then the session is deleted. After that it no longer shows up in session/list.
The response is an empty object {}, not { "deleted": true }.
An invalid or unknown sessionId is treated as a no-op and does not return an error.
If you're on a 1.x version (opencode-ai), please upgrade to v2 to get this. v1 only receives critical fixes.
The parts that v2 doesn't have yet are an all: true bulk delete, errors for invalid or missing IDs, and documentation of this behaviour. Maintainers will consider those. Related: #53359 recently changed how ACP handles cancel and delete.
Activity
opencode-agent commentedon Oct 11, 2026
Thanks for the detailed request!
Good news: OpenCode v2 (
@opencode/cli, 2.x) already supportssession/deleteover ACP. It has been in every release tag I checked, back to v2.0.7, andinitializeadvertises it underagentCapabilities.sessionCapabilities.delete. How it works now:{ "sessionId": "ses_..." }.session/list.{}, not{ "deleted": true }.sessionIdis treated as a no-op and does not return an error.If you're on a 1.x version (
opencode-ai), please upgrade to v2 to get this. v1 only receives critical fixes.The parts that v2 doesn't have yet are an
all: truebulk delete, errors for invalid or missing IDs, and documentation of this behaviour. Maintainers will consider those. Related: #53359 recently changed how ACP handles cancel and delete.