Skip to content

fix(acp): list known sessions across projects on empty cwd - #33789

Closed
Haohao-end wants to merge 1 commit into
anomalyco:devfrom
Haohao-end:acp-global-list
Closed

fix(acp): list known sessions across projects on empty cwd#33789
Haohao-end wants to merge 1 commit into
anomalyco:devfrom
Haohao-end:acp-global-list

Conversation

@Haohao-end

Copy link
Copy Markdown

Issue for this PR

Closes #33036

Type of change

  • Bug fix

What does this PR do?

ACP session/list was routed through the project-scoped /session endpoint (sdk.session.list), so a request with no cwd only returned sessions for the ACP process's own project instead of every known session. Per the ACP spec, empty params must return the first page of known sessions, and cwd is an optional filter.

This switches listSessions to the cross-project listing (sdk.experimental.session.list, backed by Session.listGlobal). When cwd is omitted it returns all known sessions; when cwd is supplied it filters by that directory. The existing live/in-memory ACP entries are still merged on top.

How did you verify your code works?

  • bun typecheck in packages/opencode (and bun turbo typecheck --filter=opencode) — clean.
  • bun test test/acp — 121 pass (updated the service-session mock to expose experimental.session.list).
  • bun test test/server/session-list.test.ts test/server/global-session-list.test.ts — 14 pass.
  • bun test test/cli/acp — 15 pass.
  • prettier --check and oxlint on the changed files — clean.

Screenshots / recordings

N/A (logic change, no UI).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found:

This PR appears to be directly related. Both PRs address the same issue of listing sessions across projects in the ACP. PR #33037 has a nearly identical title and appears to be working on the same problem. You should check whether #33037 is already merged or if it's the same fix being resubmitted.

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP session/list without cwd is scoped to process project

1 participant