qwen-code/packages/core
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
..
scripts Fix: Improve ripgrep binary detection and cross-platform compatibility (#1060) 2025-11-18 19:38:30 +08:00
src fix(core): preserve read-before-write state across idle microcompaction (#4243) 2026-05-18 10:05:44 +08:00
vendor feat test tool permissions 2026-03-10 16:30:22 +08:00
index.ts fix: Remove remaining ClearcutLogger export from packages/core/index.ts 2026-02-01 14:52:14 +08:00
package.json chore(release): v0.15.11 [skip ci] 2026-05-14 09:51:46 +08:00
test-setup.ts feat(memory): managed auto-memory and auto-dream system (#3087) 2026-04-16 20:05:45 +08:00
tsconfig.json fix: upgrade @lydell/node-pty to 1.2.0-beta.10 to fix PTY FD leak 2026-04-01 07:55:56 +08:00
vitest.config.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00