Skip to content

Commit 2b5ccf7

Browse files
Merge upstream main 73931fe into fws/u9-task-history-delete
Four paths conflicted. The fork is real, not textual, so each one was resolved by deciding which behaviour survives rather than by picking a side wholesale. src/utils/safeWriteJson.ts and its test: main carries the Zoo-Code-Org#1309 replacement protocol inside this module - the interrupted-write recovery pass, the trace stage stream that persistenceTrace and taskMessages consume, createTempFilePath, the best-effort flush, the single-rename commit with its EPERM two-step fallback, and a rollback that keeps the backup so a later writer can recover. Our side replaced that body with a delegation to services/file-safety/safeWriteText, a module main does not have. Resolving to our side would have deleted behaviour main shipped and mains own tests assert, so the protocol stays and our path-safety layer is grafted onto it: resolvePublishTarget under the lock, resolveLockKey for the advisory lock key, and confineTo with ConfinedPathEscapeError checked before any mkdir side effect, again on the lock key, and again under the lock. Staging and all four rename sites - commit, fallback backup, fallback commit, rollback - name the same resolved publish target, so no half-graft can leave the staged file on one canonicalisation and the commit on another. Mains recovery, trace, flush and fallback tests are kept verbatim, and our confinement, publish-target and lock-key tests are kept alongside them. The mode-parity assertion our chain added is preserved by copying the targets mode onto the staged file before the rename, which is what the commit needs because the rename publishes the staged inode. Two of our test variants were dropped rather than ported, and the reason is that the mechanism they describe no longer exists: both assumed a backup copy taken before the commit, which the single-rename protocol never does. Their observable claims - target content intact, no leftovers, original error surfaced - are covered by the kept test "a failed commit keeps the previous content at the target and leaves no backup behind". TaskHistoryStore: our delete semantics (removeTaskFile reports whether the file is really gone, and delete and deleteMany throw TaskHistoryDeleteError otherwise) stay. Main's resurrection guarantee was then moved inside them rather than left beside them: the sweep of a task file's .bak_/.new_ siblings now runs under the same per-file lock as the unlink, before it, in the order jsonFileRecovery.deleteJsonFile already used, and a sibling this store cannot collect blocks the canonical unlink instead of leaving a backup next to a file the delete claimed to remove - a later reader's recovery pass would resurrect content this delete was meant to destroy. isReplacementLeftover is exported from jsonFileRecovery so the two callers share one naming rule instead of duplicating it. Main's shared helper still runs once more after our lock releases, to collect anything a peer created in that window. When the guard fires, the canonical file and the backup both survive, which is main's guarantee, and the delete is reported as failed, which is this branch's contract: an item whose file is still on disk stays in the cache rather than being contradicted by the next reconciliation. Main's two "preserves the canonical file if backup cleanup fails" cases therefore keep both file assertions unchanged and gain the rejection the merged contract requires; that is the only main case whose expectation moved, and it moved because this branch exists to make delete report per-file verdicts instead of swallowing the failure. DiffViewProvider.spec: mains makeTaskDouble helper stays and gains the two members our guarded save reads - task.cwd and a real in-memory observation registry - so the suites keep using the shared double instead of three divergent inline literals. Flagged for the maintainer thread: whichever of these branches lands first puts a fourth implementation of services/file-safety/safeWriteText.ts into main (main has none; Zoo-Code-Org#1408 carries 1de2e57, Zoo-Code-Org#1405 7a59e9a, Zoo-Code-Org#1911 3846158, this branch 0ed4a19). The naming and recovery contract between that module and jsonFileRecovery is open in Zoo-Code-Org#2350. safeWriteJson also gained two things the merged protocol needed to keep its own promises: the committed directory is fsynced best-effort after the commit rename (POSIX only, failures logged and never fatal), and the cleanup of a staging file that the failed commit already consumed no longer logs an ENOENT that says nothing. The post-commit durability spec was rewritten against the mechanism that survived - failure injected on the staged write stream, not on an open the merged protocol no longer performs - and the lock-key spec's expected call order was corrected to the six calls this module actually issues now that no writer is delegated to. One test mechanism moved for a reason that is worth recording: the injected cleanup failure in "preserves the canonical file if backup cleanup fails" is pinned to the leftover's basename rather than to the whole path, because the store re-derives the sibling path from its own resolved and realpath'd directory, and on a Windows runner that spelling need not be string-equal to the spelling the test created the file under. The basename of a leftover is unique to the task file, so the injection still lands on exactly one unlink. That is what the windows-latest leg needed: with the path-equality pin the injected EACCES never fired there, the sweep succeeded, and delete resolved instead of reporting the blocked verdict. The windows-latest leg failed a second time, in a different harness and for the same underlying reason: safeWriteJson.interruption.test.ts ran 12 failures, every one "expected WRITE_COMPLETED to contain EXIT_AT_REPLACEMENT_RENAME", because the child identifies the commit rename by comparing the rename destination to the target as text, and that comparison does not agree with this graft on Windows. Measured here on the pinned runtime: fs.realpath (the async call the writer uses) expands an NTFS 8.3 short name - C:\work\ZOO-CO~1\TMP-AL~1 resolves to C:\work\Zoo-Code-fork\.tmp-alias-repro, one inode 673102249:1125899919173473 - while fs.realpathSync leaves the alias alone, and only fs.realpathSync.native expands it in the synchronous family. On a runner whose temp directory is reported as an alias the writer publishes under the long spelling while the parent process still holds the alias spelling, so text equality misses the commit rename; on a developer box the two spellings agree and the suite passes. The hook now identifies the commit rename the way Zoo-Code-Org#1911 already identifies its interception point: equal dev+ino is the same file, and when the destination is not on disk yet (the commit of a first write) it falls back to the identity of the containing directory plus the basename. The claim is unchanged - kill the child at the commit rename, whatever protocol the writer uses - and the injection is no longer spelling-dependent. Reproduced rather than inferred: with TEMP pointed at the 8.3 alias the suite runs 12 failed before this change and 12 passed after it; with TEMP at the long spelling it runs 12 passed both times. Full misc shard after the change on pinned v22.23.4: 119 files passed and 1 skipped (120), 2184 passed | 17 skipped. tsc 0 errors, eslint 0 at --max-warnings=0, prettier clean, suppressions unchanged at 265 files / 2868 entries. The consequence is recorded rather than buried: a publish target whose spelling differs from the path the caller handed in is a contract question, not a test question. This is the third site in the series where spelling equality turned out to be the wrong comparison - TaskHistory Store backup cleanup, this hook, and the Zoo-Code-Org#1911 commit matcher - and Zoo-Code-Org#2356 carries the measurement and the routing. Co-Authored-By: Claude Opus 4.8 <[email protected]> Review-driven repairs landed on this round (threads at head e991674): - guardedWrite.createIfAbsent: create the directory that would hold the lock before acquiring it. proper-lockfile builds "<key>.lock" with a non-recursive mkdir, so a create into a directory that does not exist failed with ENOENT at lock acquisition, before the writer reached its own mkdir -p. Measured on the pinned runtime (22.23.4): acquireFileLock on <tmp>/missing-a/missing-b/target.json -> ENOENT; resolveLockKey of the same path returns a key inside the missing directory and fails the same way; after mkdir -p of that directory the identical call acquires and releases. - guardedWrite.replaceIfVersion: hoist the lock key and re-derive it from the bound target under the lock, as createIfAbsent already did. A key computed before the lock does not cover a target that was repointed while the call waited, so the version comparison could pass against the new target and the rename overwrite a writer that held the other lock. - guardedWrite: verify the target inside the enqueued FIFO link, so ordering between two writes to one path is submission order, not the order in which two verifications happened to complete. The publish helpers verify again under the lock, so only the timing of a refusal moves, never whether it is reported. - guardedWrite: the dangling-link refusal no longer embeds an absolute ancestor path in a model-visible message. - safeWriteJson: run the interrupted-replacement recovery pass against the resolved publish target instead of the lexical spelling. Leftover names are derived from the publish target, so for a symlink whose referent lives elsewhere the backup sat beside the referent while the scan searched the link directory, found nothing, and the write published over orphaned newer content. Best-effort: a link with no referent falls back to the named path (what was always scanned) and the strict resolution still decides. - safeWriteText._copyTargetMode: fail closed when the staged file cannot reproduce the target mode instead of logging and publishing a wider mode over a 0o600 file. A staged mode that already matches is still allowed, so filesystems that ignore POSIX modes do not lose the write. - jsonFileRecovery.deleteJsonFile / recoverMissingJsonFile: lock on resolveLockKey, the key safeWriteJson and TaskHistoryStore lock, while still operating on the named path. Three writers of one file were taking three different locks. Tests: three new cases in guardedWrite.spec.ts, each shown to fail without its implementation change (control run against the pre-edit blob: 3 failed, 68 pre-existing cases still green; with the changes 71 passed). Two resolution-order fixtures in safeWriteJson.lockKey.spec.ts record the extra in-lock resolution the recovery target now needs; their claims (lock key is the referent, the strict rejection happens inside the protected block so the lock is released) are unchanged, and both cases fail again when the recovery-target hunk is folded back. One alias containment case now pins the lock-key double to the canonical referent, the same line the other alias cases set. Gates at this commit: misc 2184 passed | 17 skipped (120 files, 0 failures), core 4411 passed | 9 skipped (200 files, 0 failures), interruption harness 12 passed with TEMP at the NTFS 8.3 alias and 12 passed with TEMP at the long spelling, tsc --noEmit 0 errors, eslint --max-warnings=0 clean, prettier --check clean, knip reports nothing but scratch files removed before this commit, eslint-suppressions.json unchanged at 265 files / 2868 entries (no count rose on any touched file). No Stryker directive added; no local Stryker preflight run for this push, and mutation-diff on this PR is advisory cap-class, not a new directive.
2 parents 620b755 + 73931fe commit 2b5ccf7

216 files changed

Lines changed: 13129 additions & 1957 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/code-qa.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ on:
99
merge_group:
1010
types: [checks_requested]
1111

12+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
13+
# unique groups, so main, merge-queue, and manual runs are never cancelled.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
16+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
17+
1218
# Least privilege: every job below escalates only where it needs to.
1319
permissions:
1420
contents: read

‎.github/workflows/codeql.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
schedule:
88
- cron: "24 19 * * 3"
99

10+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
11+
# unique groups, so main pushes and scheduled scans are never cancelled.
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1016
# Least privilege: the analyze job escalates to security-events: write via its
1117
# own job-level permissions block.
1218
permissions:

‎.github/workflows/e2e.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
merge_group:
88
types: [checks_requested]
99

10+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
11+
# unique groups, so merge-queue and manual runs are never cancelled.
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1016
permissions:
1117
contents: read
1218

@@ -156,6 +162,18 @@ jobs:
156162
if: github.event_name != 'pull_request' || steps.e2e-marker.outputs.cache-hit != 'true'
157163
run: TEST_FILE=restart-persistence.test USE_MOCK=true xvfb-run -a pnpm --filter @roo-code/vscode-e2e exec node ./out/runTest.js
158164

165+
- name: Upload restart-persistence failure artifacts
166+
# runTest.js preserves a failed scenario workspace (phase results,
167+
# VS Code logs, task files) under apps/vscode-e2e/test-failures/
168+
# instead of deleting it, so the interrupted-write state from
169+
# issue #2130-style failures stays inspectable.
170+
if: failure()
171+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
172+
with:
173+
name: restart-persistence-failure
174+
path: apps/vscode-e2e/test-failures/
175+
if-no-files-found: ignore
176+
159177
- name: Explain skipped mocked E2E pass marker
160178
if: steps.e2e-marker.outputs.cache-hit != 'true' && steps.run-e2e.outcome == 'success' && steps.vscode-fallback.outputs.used == 'true'
161179
run: echo "Skipping mocked E2E pass marker because tests ran against a stale cached VS Code binary (VS Code download endpoints unreachable)."

‎.github/workflows/mutation-pr-comment.yml‎

Lines changed: 428 additions & 0 deletions
Large diffs are not rendered by default.

‎.github/workflows/mutation-testing.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
if: github.event_name == 'pull_request'
5151
env:
5252
HEAD_SHA: ${{ github.sha }}
53+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
5354
run: |
5455
BASE_SHA="$(git rev-parse "$HEAD_SHA^1")"
5556
node scripts/stryker-diff.mjs ci --base "$BASE_SHA" --head "$HEAD_SHA"

‎.github/workflows/release-validation.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ on:
1616
- "releases/**"
1717
- ".github/workflows/release-validation.yml"
1818

19+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
20+
# unique groups, so manual runs are never cancelled.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
23+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
24+
1925
permissions:
2026
contents: read
2127

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ AGENTS.local.md
2828
apps/vscode-e2e/playwright-report-electron/
2929
apps/vscode-e2e/test-results-electron/
3030
apps/vscode-e2e/heap-results/
31+
apps/vscode-e2e/test-failures/
3132

3233
# Docs
3334
docs/_site/

‎CHANGELOG.md‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,79 @@
11
# Zoo Code Changelog
22

3+
## [3.96.0]
4+
5+
- ✨ **New chat settings and diagnostics:** Show message timestamps with configurable time and date formats, tune the prompt-cache TTL for Anthropic profiles, and generate privacy-safe diagnostics reports.
6+
- 💸 **More accurate provider costs and caching:** Keep Anthropic tool results intact, adopt cumulative output tokens in Anthropic and MiniMax costs, read DeepSeek prompt-cache counters, target the xAI Responses cache, and bill Mistral cache reads at 0.1x.
7+
- 🧭 **More reliable and faster chats:** Resume completed tasks after a restart, restore checkpoints when the saved commit is missing, auto-reload a dead webview renderer, throttle streaming updates, and load locales on demand.
8+
9+
### New Chat Settings and Diagnostics
10+
11+
- Add time and date format settings and message timestamps (#2221 by @KarthickMahalingam, PR #2223 by @KarthickMahalingam)
12+
- Add a user-facing prompt-cache TTL for Anthropic profiles (PR #2271 by @simurg79)
13+
- Add privacy-safe diagnostics reports (PR #2292 by @app/zoomote2)
14+
15+
### More Accurate Provider Costs and Caching
16+
17+
- Keep tool_result blocks contiguous in Anthropic requests by grouping image blocks separately (#1307 by @alaskanloosemoose-dotcom, PR #2243 by @myk1yt)
18+
- Adopt cumulative message_delta output tokens in Anthropic and MiniMax cost (#1727 by @myk1yt, PR #2242 by @myk1yt)
19+
- Read documented top-level prompt-cache counters for DeepSeek (PR #2252 by @myk1yt)
20+
- Send body prompt_cache_key for xAI Responses cache affinity (PR #2256 by @myk1yt)
21+
- Bill Mistral cache reads at 0.1x instead of the full input price (PR #2257 by @myk1yt)
22+
- Map xAI tool_choice to the Responses API shape with a typed request body (PR #2036 by @easonLiangWorldedtech)
23+
- Add MiMo V2.6 Flash and Pro model configurations for OpenCode Go (#1997 by @WebMad, PR #2246 by @myk1yt)
24+
25+
### More Reliable and Faster Chats
26+
27+
- Resume completed tasks after a restart when a message write is interrupted (#2130 by @edelauna, PR #2297 by @app/zoomote2)
28+
- Restore checkpoints when the saved commit is missing (PR #2269 by @simurg79)
29+
- Detect a dead webview renderer via heartbeat and auto-reload (PR #1715 by @myk1yt)
30+
- Report emergency condense like the automatic path (PR #1838 by @PierrunoYT)
31+
- Summarize only the API-visible history when condensing (#1342 by @RemainIndoors1, PR #2300 by @RytisLT)
32+
- Propagate beyond-EOF read-file errors instead of reporting the file as empty (PR #1734 by @myk1yt)
33+
- Throttle partial message updates while streaming (PR #2120 by @PierrunoYT)
34+
- Replace axios with fetch in key-info hooks (PR #2261 by @myk1yt)
35+
- Load locales on demand instead of eager-globbing all 18 (PR #2267 by @myk1yt)
36+
- Replace the debounce package with a local leading-edge helper (PR #2268 by @myk1yt)
37+
38+
### New Features and Integrations
39+
40+
- Add a dependency-free BM25 ranker tool (PR #1207 by @edelauna)
41+
- Add abort-signal wiring for lm-studio and qwen-code (PR #1309 by @easonLiangWorldedtech)
42+
- Add Keenable to the MCP marketplace (#2312 by @ilya-bogin-keenable, PR #2313 by @ilya-bogin-keenable)
43+
44+
### Testing, CI, and Repository Automation
45+
46+
- Cancel obsolete PR CI runs and remove duplicate builds (#2289 by @edelauna, PR #2294 by @app/zoomote2)
47+
- Post surviving mutants as a PR comment (#2287 by @edelauna, PR #2293 by @app/zoomote2)
48+
- Run webview CI tests with four workers (#2288 by @edelauna, PR #2308 by @app/zoomote2)
49+
- Use plugin-side related-test discovery for the extension package mutation gate (PR #2211 by @easonLiangWorldedtech)
50+
- Add test-utils guardrails and convert remaining stragglers (PR #2279 by @app/zoomote2)
51+
- Drop test-only tool-use interfaces from shared/tools (PR #2258 by @myk1yt)
52+
- Show the Zoo Code panel in the Solheim smoke video and bound the apt step (#2158 by @edelauna, PR #2195 by @app/zoomote2)
53+
54+
### Refactoring and Code Health
55+
56+
- Move default provider ID functionality into the provider definition (PR #2233 by @p12tic)
57+
- Resolve profile model IDs through provider definitions (PR #2239 by @p12tic)
58+
- Remove no-explicit-any suppressions in utils (PR #2281 by @app/zoomote2)
59+
- Remove no-explicit-any suppressions in small directories (PR #2286 by @app/zoomote2)
60+
- Close lint coverage and knip hygiene gaps (PR #2280 by @app/zoomote2)
61+
- Sweep dead locale keys behind an AST gate (PR #2263 by @myk1yt)
62+
- Remove dead CSS classes from the global stylesheet (PR #2251 by @myk1yt)
63+
64+
### Dependencies and Maintenance
65+
66+
- Update @tanstack/react-query to v5.105.0 (PR #2180 by @app/renovate)
67+
- Update ignore to v7.0.14 (PR #2181 by @app/renovate)
68+
- Update posthog-js to v1.440.0 (PR #2182 by @app/renovate)
69+
- Update posthog-node to v5.57.2 (PR #2183 by @app/renovate)
70+
- Update GitHub Actions (PR #2186 by @app/renovate)
71+
- Update qs to v6.16.1 [security] (PR #2214 by @app/renovate)
72+
73+
### Housekeeping
74+
75+
- Merge the **previous v3.94.0 release preparation** after its publication; this is prior-release housekeeping, not a v3.96.0 feature (PR #2272 by @app/zoomote2)
76+
377
## [3.94.0]
478

579
- ✨ **Broader model and provider support:** Use Claude Haiku 5.5 through Anthropic, send images to compatible VS Code LM models, tune temperature for OpenCode Go Responses models, and cancel requests cleanly across more providers.

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ Zoo Code builds on the foundation created by Roo Code and continues to expand it
4646
- **More dependable terminal and editing workflows** — fixes for premature terminal completion, task-state races, context management, diff editing, and provider-specific tool use.
4747
- **More control over your workspace** — rules management, per-mode MCP restrictions, multi-root path controls, model reasoning options, and completion change review actions.
4848

49-
## What's New in v3.94.0
49+
## What's New in v3.96.0
5050

51-
- ✨ **Broader model and provider support:** Use Claude Haiku 5.5 through Anthropic, send images to compatible VS Code LM models, tune temperature for OpenCode Go Responses models, and cancel requests cleanly across more providers.
52-
- 🔐 **More flexible MCP OAuth:** Configure static OAuth client settings, use custom callback paths, discover authentication details from `WWW-Authenticate`, and see callback failures before retrying.
53-
- 🧭 **Smoother chats and long sessions:** Rename tasks in history, drag files into chat without holding Shift, reduce memory retained during long sessions, and keep subtask links and replaced webviews stable.
51+
- ✨ **New chat settings and diagnostics:** Show message timestamps with configurable time and date formats, tune the prompt-cache TTL for Anthropic profiles, and generate privacy-safe diagnostics reports.
52+
- 💸 **More accurate provider costs and caching:** Keep Anthropic tool results intact, adopt cumulative output tokens in Anthropic and MiniMax costs, read DeepSeek prompt-cache counters, target the xAI Responses cache, and bill Mistral cache reads at 0.1x.
53+
- 🧭 **More reliable and faster chats:** Resume completed tasks after a restart, restore checkpoints when the saved commit is missing, auto-reload a dead webview renderer, throttle streaming updates, and load locales on demand.
5454

5555
<details>
5656
<summary>🌐 Available languages</summary>

‎apps/vscode-e2e/package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"lint": "eslint src --ext=ts --max-warnings=0",
66
"check-types": "tsc -p tsconfig.esm.json --noEmit",
77
"format": "prettier --write src",
8-
"test:ci": "pnpm -w bundle && pnpm --filter @roo-code/vscode-webview build && pnpm test:run",
9-
"test:ci:mock": "pnpm -w bundle && pnpm --filter @roo-code/vscode-webview build && USE_MOCK=true pnpm test:run",
8+
"test:ci": "pnpm -w bundle && pnpm test:run",
9+
"test:ci:mock": "pnpm -w bundle && USE_MOCK=true pnpm test:run",
1010
"test:record": "AIMOCK_RECORD=true pnpm test:ci",
1111
"test:run": "rimraf out && tsc -p tsconfig.json && dotenv -e .env.local -- node ./out/runTest.js",
12-
"themes:build": "pnpm -w bundle && pnpm --filter @roo-code/vscode-webview build && rimraf out && tsc -p tsconfig.json",
12+
"themes:build": "pnpm -w bundle && rimraf out && tsc -p tsconfig.json",
1313
"themes:update": "pnpm themes:build && node ./out/theme-fixtures/generate.js update",
1414
"themes:check": "pnpm themes:build && node ./out/theme-fixtures/generate.js check",
1515
"themes:test": "pnpm --filter @roo-code/types build && rimraf out && tsc -p tsconfig.json && node --test ./out/theme-fixtures/fixtures.test.js",

0 commit comments

Comments
 (0)