#18553 · @remorses · opened Mar 21, 2026 at 9:37 PM UTC · last updated Mar 21, 2026 at 10:01 PM UTC
fix(acp): listSessions returns sessions from all projects, not just current
Score breakdown
Impact
Clarity
Urgency
Ease Of Review
Guidelines
Readiness
Size
Trust
Traction
Summary
This PR fixes a bug in the ACP agent where unstable_listSessions incorrectly filtered sessions by the current project instead of returning all available sessions. It switches to the global session API to ensure all project sessions are listed as expected.
Description
Issue for this PR
N/A — discovered while building openplexer (ACP client that syncs sessions to Notion).
Type of change
- [x] Bug fix
- [ ] New feature
- [ ] Refactor / code improvement
- [ ] Documentation
What does this PR do?
unstable_listSessions in the ACP agent calls this.sdk.session.list() which hits GET /session — the per-project route. That route's handler calls Session.list() which always filters by Instance.project, so ACP clients only ever see sessions from the single project where opencode acp was started.
Switched to this.sdk.experimental.session.list() which hits GET /experimental/session. That route calls Session.listGlobal() with no project filter, returning sessions across all projects.
One-line change: this.sdk.session → this.sdk.experimental.session. Parameters stay the same.
How did you verify your code works?
- CI passes (typecheck, unit tests, e2e)
- Ran ACP smoke test gist locally — ACP protocol flow (initialize → listSessions) completes without errors
Screenshots / recordings
N/A — no UI change.
Checklist
- [x] I have tested my changes locally
- [x] I have not included unrelated changes in this PR
Linked Issues
None.
Comments
No comments.
Changed Files
packages/opencode/src/acp/agent.ts
+1−1