Skip to content

fix(acp): read workspace local config via local fs at session start - #992

Merged
liruifengv merged 1 commit into
mainfrom
fix/acp-local-toml-bootstrap
Jun 23, 2026
Merged

fix(acp): read workspace local config via local fs at session start#992
liruifengv merged 1 commit into
mainfrom
fix/acp-local-toml-bootstrap

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Related Issue

Resolve #988

Problem

In ACP editors such as Zed, starting a new thread fails with an internal error. During session/new, the kernel reads the workspace local config (.kimi-code/local.toml) through the ACP reverse-RPC file bridge. The client has not registered the session yet because the session/new response has not returned, so the reverse fs/read_text_file call fails with "unknown session" and aborts session creation. This regressed when the workspace local config was introduced for the add-dir feature.

What changed

Read the workspace local config through the persistence (local) kaos instead of the ACP tool kaos in both createSessionWithOverrides and resumeSessionWithOverrides. This matches the existing design where session-internal system files (AGENTS.md, cwd listing, metadata) are read through the persistence sink so a transient ACP-side failure never blocks bootstrap. The caller-supplied additionalDirs are still resolved through the tool kaos, so their semantics are unchanged.

Added a regression test that simulates the ACP "unknown session" failure on the tool kaos and verifies session creation still succeeds by reading the local config through the persistence kaos.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Read `.kimi-code/local.toml` through the persistence (local) kaos instead of
the ACP tool kaos during session bootstrap. The ACP reverse-RPC bridge needs
the session registered on the client, which is not true until `session/new`
returns, so reading through it failed with "unknown session" and blocked new
threads in ACP editors such as Zed.

Fixes #988
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a86d78c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 23, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@a86d78c
npx https://pkg.pr.new/@moonshot-ai/kimi-code@a86d78c

commit: a86d78c

@liruifengv
liruifengv merged commit 7341fb4 into main Jun 23, 2026
9 checks passed
@liruifengv
liruifengv deleted the fix/acp-local-toml-bootstrap branch June 23, 2026 03:19
@github-actions github-actions Bot mentioned this pull request Jun 23, 2026
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.

Cannot create new thread in Zed

1 participant