Repository navigation
Description
Description
OpenCode's ACP session/list implementation currently does not conform to the ACP session-list behavior when the client omits cwd.
The ACP spec says session/list is for sessions known to the agent:
Lists existing sessions known to the agent.
The dedicated Session List page says:
All parameters are optional. A request with an empty
paramsobject returns the first page of sessions.
and defines cwd as an optional filter:
Filter sessions by working directory. Must be an absolute path. Only sessions with a matching
cwdare returned.
OpenCode currently routes ACP session/list through the project-scoped /session endpoint, so an empty {} request is implicitly scoped to the ACP process working directory/project instead of returning the first page of known sessions. This makes registry-launched ACP clients report stale or empty history.
This nonconformance caused or explains:
- ACP unstable_listSessions only returns sessions for the current project #18575 — ACP session listing only returns current-project sessions
- [BUG] Zed ACP registry mode shows stale Recent sessions (unscoped /session) #16137 — Zed ACP registry mode shows stale Recent sessions because unscoped
/sessionis tied to process cwd
Plugins
None
OpenCode version
Current dev branch; observed in ACP implementation
Steps to reproduce
- Create OpenCode sessions in multiple project directories.
- Start
opencode acpfrom a directory that is not one of those projects, or via an ACP registry launch. - Send ACP
session/listwithcwd: null:
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": 1, "clientCapabilities": {}}}
{"jsonrpc": "2.0", "id": 2, "method": "session/list", "params": {"cursor": null, "cwd": null}}' | opencode acp If your shell/process closes stdin before the second response is emitted, this equivalent delayed form keeps the pipe open long enough to observe the response:
{ printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{}}}'; sleep 1; printf '%s\n' '{"jsonrpc":"2.0","id":2,"method":"session/list","params":{"cursor":null,"cwd":null}}'; sleep 1; } | opencode acp- Observe OpenCode returns only sessions scoped to the process cwd/project, or an empty/stale list, instead of the first page of known sessions.
Screenshot and/or share link
N/A
Operating System
macOS; also reported by users on Linux
Terminal
N/A
Activity
github-actions commentedon Jun 19, 2026
This issue might be a duplicate of existing issues. Please check:
/sessionendpointThese issues appear to describe the same underlying bug. You may want to review those threads before proceeding.
Necmttn commentedon Jun 21, 2026
ACP
session/listshould preserve the distinction between "known sessions" and "sessions for this cwd." Empty params should return the first page of known sessions with project/cwd metadata;cwdshould be an optional filter.If the existing HTTP endpoint is project-scoped, the ACP adapter likely needs a separate unscoped query path. Tests should cover empty params, explicit cwd filter, registry-launched process cwd, pagination, and sessions with missing/unknown project ids.
Generated with ax.
nexxeln commentedon Jun 26, 2026
will fix in v2
vegerot commentedon Jun 26, 2026
@nexxeln already fixed in #33037
fix(acp): list sessions across projects
github-actions commentedon Aug 26, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
fix(acp): list sessions across projects