qwen-code/packages
tanzhenxin d3cbe7614e
fix(core): preserve read-before-write state across idle microcompaction (#4243)
* fix(core): preserve read-before-write state across idle microcompaction (#4239)

Idle microcompaction blanked old tool outputs and then wiped the entire
file-read tracking cache to keep the read_file "unchanged" fast path from
pointing at content no longer in history. That wipe also destroyed the
read-before-write record, so after any idle break the model was falsely
told a file it had already read "has not been read in this session" and
forced into a redundant re-read of an unchanged file before it could
edit it.

Replace the blanket wipe with per-file targeting: when microcompaction
blanks a read/edit/write result, only that file's fast-path eligibility
is disarmed; the on-disk fingerprint and "seen this session" markers are
preserved, so edits/overwrites of an unchanged file proceed without a
re-read while a file that actually changed on disk is still correctly
caught. If a blanked result's file path cannot be resolved back to its
cache entry, fall back to the old blanket wipe so a stale "unchanged"
placeholder can never be served.

* refactor(core): harden microcompaction fast-path eviction (PR #4243 review)

- buildCallIdToFilePath now accumulates paths per callId (Map<string,
  string[]>) so a reused/duplicate functionCall.id disarms ALL candidate
  files instead of silently dropping one — over-disarming costs at most a
  redundant re-read, whereas keeping the wrong file armed would resurrect
  the issue #4239 dangling-placeholder hazard.
- Add a guard-rail comment tying COMPACTABLE_TOOLS to FILE_PATH_TOOLS.
- Document why readResidentInHistory is intentionally not reset on the
  fingerprint-drift branch.
- Add tests: duplicate-id disarm, and a mixed on-disk/ghost evicted batch
  forcing the safe blanket wipe.
2026-05-18 10:05:44 +08:00
..
channels chore(release): v0.15.11 [skip ci] 2026-05-14 09:51:46 +08:00
cli feat(serve): preflight and env diagnostics routes (#4175 Wave 3 PR 13) (#4251) 2026-05-18 07:29:05 +08:00
core fix(core): preserve read-before-write state across idle microcompaction (#4243) 2026-05-18 10:05:44 +08:00
sdk-java fix(sdk-java): pass custom env to CLI process (#3543) 2026-04-24 10:37:52 +08:00
sdk-python doc[sdk-python] Expand Python SDK usage documentation (#3995) 2026-05-12 15:27:00 +08:00
sdk-typescript feat(serve): preflight and env diagnostics routes (#4175 Wave 3 PR 13) (#4251) 2026-05-18 07:29:05 +08:00
vscode-ide-companion feat(cli): add configurable plansDirectory for Plan Mode (#4062) 2026-05-17 19:43:24 +08:00
web-templates chore(release): v0.15.11 [skip ci] 2026-05-14 09:51:46 +08:00
webui chore(release): v0.15.11 [skip ci] 2026-05-14 09:51:46 +08:00
zed-extension chore(deps): upgrade ink 6.2.3 → 7.0.2 + bump Node engine to 22 (#3860) 2026-05-11 17:29:50 +08:00