Skip to content

fix: preserve config symlink writes#754

Draft
ktwu01 wants to merge 1 commit into
MoonshotAI:mainfrom
ktwu01:codex/preserve-config-symlinks
Draft

fix: preserve config symlink writes#754
ktwu01 wants to merge 1 commit into
MoonshotAI:mainfrom
ktwu01:codex/preserve-config-symlinks

Conversation

@ktwu01

@ktwu01 ktwu01 commented Jun 14, 2026

Copy link
Copy Markdown

Related Issue

Resolve #751

Problem

When ~/.kimi-code/config.toml is a symlink, saving config updates replaces the symlink itself with a regular file. That breaks user workflows that sync the real config file through another location.

What changed

Config writes now detect a symlinked config path and atomically write to the resolved target file instead of replacing the symlink entry. The generic atomic write helper keeps its existing replacement semantics for other stores, and the new test covers preserving the symlink while updating the target file content.

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.

@changeset-bot

changeset-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6509e7e

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

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/agent-core Patch
@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

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.

Bug: atomicWrite replaces symlink with regular file, breaking config.toml sync

1 participant