Skip to content

feat: turn filesystem watch back on by default - #4015

Merged
sailist merged 1 commit into
MoonshotAI:mainfrom
sailist:feat-269-09-24-watch-default-on
Sep 24, 2026
Merged

sailist merged 1 commit into
MoonshotAI:mainfrom
sailist:feat-269-09-24-watch-default-on

Conversation

@sailist

@sailist sailist commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Requirement or Bug

Turn filesystem watch back on by default, reverting the default-off behavior from #3931.

Bug Reproduction Steps

N/A (behavior-change PR).

Root Cause

N/A (not a bug fix). #3931 flipped filesystem watch to default off five days ago; this PR restores the previous default-on behavior per product decision.

Code Changes

  • Flip the two default-value sites back to on: the module-level watchEnabledFromConfig in packages/agent-core-v2/src/human/utils/watch.ts, and the ?? true fallback in applyWatchEnabled() in packages/agent-core-v2/src/app/config/configService.ts. The KIMI_CODE_WATCH environment variable keeps its higher priority over the config file.
  • Restore the watch-dependent test suites to their pre-feat: turn off filesystem watch by default #3931 shape: drop the explicit-enable scaffolding (file-level hooks in watch.test.ts, setWatchEnabled calls in agentProfileLoader.test.ts / workspaceAliasesService.test.ts, KIMI_CODE_WATCH=1 env setup in kap-server workspaces.test.ts / modelCatalogCatalog.test.ts). Test count unchanged.
  • Flip the user-facing docs (docs/{zh,en}/configuration/config-files.md, env-vars.md) back to default on / true.
  • Add a patch changeset.

Impact Scope

  • Every watch consumer (local.toml, AGENTS.md, skills, MCP config, and config.toml hot-reload) attaches watchers by default again; KIMI_CODE_WATCH=0 or [watch] enabled = false opts out.
  • Covered by the restored existing suites: the 5 files pass locally (98 passed / 1 win32-only skipped); tsc --noEmit clean for agent-core-v2 and kap-server; full remote suite 16688/16751 with the only 2 failures reproduced as passes in isolated re-runs (load flakes unrelated to this change).

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve). — related PR: feat: turn off filesystem watch by default #3931 (the change this reverts)
  • I have added tests that prove my feature works. — behavior covered by the restored existing watch suites
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update. — docs updated in this PR (zh/en config-files + env-vars)

@changeset-bot

changeset-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b75e16a

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 Sep 24, 2026

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

commit: b75e16a

@sailist

sailist commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator Author

@codex Review

@sailist
sailist marked this pull request as draft September 24, 2026 06:35
@sailist
sailist marked this pull request as ready for review September 24, 2026 06:35
@7Hanrui

7Hanrui commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@codex review

@sailist
sailist merged commit c7dd841 into MoonshotAI:main Sep 24, 2026
17 checks passed
7723qqq added a commit to 7723qqq/kimi-code that referenced this pull request Sep 24, 2026
…tch docs

Follows upstream 929403b (MoonshotAI#4013, revert of MoonshotAI#3964): background git
invocations no longer override repo-local git config (utils/git/git-args.ts
deleted), the codebase scanner and git-status cache drop the config-args
wiring, and the hardening-assertion tests are removed. The fail-closed
trust prompt and lazy footer git detection stay, matching upstream.

The Rust-side half was never committed (the MoonshotAI#3964 port lived only in the
working tree), so nothing to revert there; the local.toml feature itself
stays ungated. Residual divergence (resolve_for_write realpath vs lexical)
is recorded in ROADMAP §6.8.1.

Docs for the watch-default-on flip (MoonshotAI#4015) are taken byte-identical from
be7d5f5 (2.1.1 final): [watch] enabled defaults to on, KIMI_CODE_WATCH
override documented — the code half remains unported (tracked, ROADMAP
§6.8.2); the fork has no watcher subsystem and /reload stays explicit.

ROADMAP §6.8 records the full 2.1.0..2.1.1 triage; check-upstream-v2-delta
reports all deltas triaged.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Oct 5, 2026
Step 10 of the incremental sync to 2.1.1: 4 upstream commits over 59
files. The step rolls back the 2.1.0 trust-boundary hardening and turns
the filesystem watchers back on by default.

Upstream's changes in this step, all absorbed:
- roll back the workspace trust-boundary hardening (MoonshotAI#4013): background
  git invocations no longer override repo-local git config, agent file
  tools no longer re-resolve paths through symlinks, and project-local
  local.toml applies without trust gating again
- turn filesystem watch back on by default (MoonshotAI#4015)
- sync the 2.1.0 changelog into the release notes (MoonshotAI#4006)
- release packages (MoonshotAI#4016)

Fork behaviour that had to survive:
- the fork's node-local → host rename: the test files the revert touches
  keep importing `#/os/backends/host/...`
- the fork's inline media reading: the ReadTool-based symlink-escape test
  goes away with the guard it covered, and the retired ReadMediaFileTool
  stays retired
- the fork's i18n: the revert restores no user-facing strings, so no new
  locale keys are needed
- the fork's Windows-safe test cleanup and its own workspace and alias
  test additions stay in place

Verified: typecheck clean across every package and app; full suite
17764 passed / 0 failed / 81 skipped / 1 todo, plus kimi-inspect's own
115 tests; lint 0 errors.
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.

3 participants