#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

tuifix
78
+111 files

Score breakdown

Impact

8.0

Clarity

10.0

Urgency

7.0

Ease Of Review

10.0

Guidelines

9.0

Readiness

10.0

Size

10.0

Trust

10.0

Traction

0.0

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.

Open in GitHub

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.sessionthis.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

+11
@@ -671,7 +671,7 @@ export namespace ACP {
const cursor = params.cursor ? Number(params.cursor) : undefined
const limit = 100
const sessions = await this.sdk.session
const sessions = await this.sdk.experimental.session
.list(
{
directory: params.cwd ?? undefined,