Part 1 - UI Bug Fix:
- ApplyDiffTool: Add finalizePartialToolAskIfNeeded to close partial ask
messages on error paths, preventing stuck spinners
- ApplyDiffTool: Always show diff_error on first failure (was >= 2)
- ApplyDiffTool: Set didToolFailInCurrentTurn on diff apply failure
- EditFileTool: Always show diff_error on first failure (was >= 2)
Part 2 - Re-anchor Before Edit Experiment:
- Add reAnchorBeforeEdit experiment type to packages/types
- Add RE_ANCHOR_BEFORE_EDIT to shared experiments config (default off)
- When enabled, adds system prompt guideline instructing the model to
re-read a file before every edit to reduce hallucination-based failures
- Add English localization keys for settings UI
- Settings UI auto-renders via existing ExperimentalSettings component
* feat: show aggregated +/− line counts in FileChangesPanel header
* feat(FileChangesPanel): show merged diff relative to final file state
* fix(webview): restrict readFileContent to paths inside the workspace
* fix: add workspace-boundary validation to readFileContent to prevent path traversal
* fix(tests): mock isPathOutsideWorkspace in readFileContent spec
* fix(tests): mock isPathOutsideWorkspace in readFileContent spec
* fix: use path.resolve/path.sep in readFileContent test mock for cross-platform compatibility
The isPathOutsideWorkspace mock used hardcoded Unix-style path comparisons
(/mock/workspace with forward slashes), which fails on Windows where
path.resolve() produces paths with drive letters (C:\mock\workspace\...).
Replace manual string normalization with path.resolve() and path.sep so the
mock behaves correctly on both Windows and Unix.
---------
Co-authored-by: Roo Code <roomote@roocode.com>