Skip to content

fix(acp): list_sessions without cwd returns all sessions#1957

Open
victorhqc wants to merge 5 commits intoMoonshotAI:mainfrom
victorhqc:main
Open

fix(acp): list_sessions without cwd returns all sessions#1957
victorhqc wants to merge 5 commits intoMoonshotAI:mainfrom
victorhqc:main

Conversation

@victorhqc
Copy link
Copy Markdown

@victorhqc victorhqc commented Apr 20, 2026

Related Issue

#1956

Resolve #1956

Description

Problem

When an ACP client called list_sessions without a cwd argument, the server returned an empty list. This broke session history in editors like Zed.

The ACP protocol says cwd is optional. But kimi-cli treated it as required. When cwd was missing, the server gave up and returned [].

Fix

  • If cwd is provided, behavior is the same as before.
  • If cwd is missing, the server now returns all sessions across all work directories.

Also added a test to catch this in the future.

Before (in Zed)
Screenshot 2026-04-20 at 17 07 34

After (in Zed)
Screenshot 2026-04-20 at 17 07 48

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • No user-facing docs changes needed (pure behavior fix; no new config, flag, or UI surface).

Open in Devin Review

Add Session.list_all() support to ACPServer so list_sessions with no cwd
returns sessions from all work directories. Add test for this behavior.
Copilot AI review requested due to automatic review settings April 20, 2026 15:05
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

This comment was marked as resolved.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP integration: Session history is not replayed or available to clients (e.g., Zed, JetBrains, ...)

2 participants