@qmediat.io/gemini-code-context-mcp 1.12.2 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +174 -0
  2. package/dist/cache/cache-manager.d.ts +20 -0
  3. package/dist/cache/cache-manager.d.ts.map +1 -1
  4. package/dist/cache/cache-manager.js +120 -19
  5. package/dist/cache/cache-manager.js.map +1 -1
  6. package/dist/cache/files-uploader.d.ts.map +1 -1
  7. package/dist/cache/files-uploader.js +57 -30
  8. package/dist/cache/files-uploader.js.map +1 -1
  9. package/dist/config.d.ts +31 -0
  10. package/dist/config.d.ts.map +1 -1
  11. package/dist/config.js +42 -0
  12. package/dist/config.js.map +1 -1
  13. package/dist/indexer/workspace-scanner.d.ts +63 -0
  14. package/dist/indexer/workspace-scanner.d.ts.map +1 -1
  15. package/dist/indexer/workspace-scanner.js +66 -7
  16. package/dist/indexer/workspace-scanner.js.map +1 -1
  17. package/dist/manifest/db.d.ts +101 -0
  18. package/dist/manifest/db.d.ts.map +1 -1
  19. package/dist/manifest/db.js +231 -10
  20. package/dist/manifest/db.js.map +1 -1
  21. package/dist/tools/ask.tool.d.ts +10 -0
  22. package/dist/tools/ask.tool.d.ts.map +1 -1
  23. package/dist/tools/ask.tool.js +42 -1
  24. package/dist/tools/ask.tool.js.map +1 -1
  25. package/dist/tools/code.tool.d.ts +10 -0
  26. package/dist/tools/code.tool.d.ts.map +1 -1
  27. package/dist/tools/code.tool.js +40 -1
  28. package/dist/tools/code.tool.js.map +1 -1
  29. package/dist/tools/reindex.tool.d.ts.map +1 -1
  30. package/dist/tools/reindex.tool.js +4 -0
  31. package/dist/tools/reindex.tool.js.map +1 -1
  32. package/dist/tools/status.tool.d.ts.map +1 -1
  33. package/dist/tools/status.tool.js +46 -0
  34. package/dist/tools/status.tool.js.map +1 -1
  35. package/dist/types.d.ts +36 -0
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/utils/logger.js +0 -0
  38. package/dist/utils/logger.js.map +1 -1
  39. package/dist/utils/run-pool.d.ts +15 -0
  40. package/dist/utils/run-pool.d.ts.map +1 -0
  41. package/dist/utils/run-pool.js +36 -0
  42. package/dist/utils/run-pool.js.map +1 -0
  43. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,180 @@ All notable changes to `@qmediat.io/gemini-code-context-mcp` will be documented
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.14.0] - 2026-04-28
9
+
10
+ ### Changed — `cachingMode` default flipped to `'implicit'`
11
+
12
+ v1.13.0 shipped `cachingMode: 'explicit' | 'implicit'` as opt-in (default `'explicit'`) with a plan to flip the default in v1.14.0 pending dogfood telemetry. The dogfood gate is hereby resolved by direct user directive — implicit caching is the optimisation that closes the v1.6-v1.7 review→edit→review pain point, and the marginal cost of probabilistic vs guaranteed savings is acceptable for the latency win.
13
+
14
+ - **Default for `ask` / `code`'s `cachingMode` field:** now `'implicit'` (was `'explicit'` in v1.13.0). Per-call `input.cachingMode` always wins; setting `'explicit'` explicitly reverts to v1.13.0 behaviour for that call.
15
+ - **Operator-level override:** new env var `GEMINI_CODE_CONTEXT_CACHING_MODE` accepts `'explicit'` or `'implicit'` (case-insensitive). Unset → default `'implicit'`. Invalid value → falls back to `'implicit'` AND emits a stderr warning so operators see their mistype rather than silently shipping the wrong strategy.
16
+ - **Strict env-var validation:** the warn path uses `console.error` (visible in MCP host log pipelines) and surfaces the offending value through `safeForLog` — control characters (newlines, tabs, ANSI escapes) are escaped to printable form, length is capped at 2000 chars. Operators still see the printable prefix of their typo for triage (e.g. `EXPLICITT` produces a clear "not a recognised value" message), but multi-line / control-char forge attempts collapse to a single safe log line and cannot record-split the stderr stream. (Round-1 review fix for the F3+F4 log-injection finding.)
17
+
18
+ ### Behavioural impact
19
+
20
+ - **First call cold:** ~80–110 s (single round-trip; Gemini caches during the call). Was 120–240 s in v1.13.0 explicit-default (60–180 s `caches.create` + 60 s query).
21
+ - **Second call warm, same files:** ~14 s (implicit cache hits). Same as v1.13.0.
22
+ - **Third call after editing 3 files:** ~14 s. Was 60–180 s rebuild + 14 s in v1.13.0 explicit-default — **the eliminated wait is the user-perceived speedup the v1.13.0 architectural pivot was designed to enable.**
23
+ - **Cost trade-off:** Gemini's automatic implicit caching is documented as "no cost saving guarantee" (see ai.google.dev/gemini-api/docs/caching). When the implicit cache fires, savings are similar to explicit (~75 % discount); when it misses, the call pays full input rate. Operators who need predictable per-call billing can revert by setting `GEMINI_CODE_CONTEXT_CACHING_MODE=explicit` or per-call `cachingMode: 'explicit'`. Hit-rate observability remains available via `status.structuredContent.caching.implicitHitRate`.
24
+
25
+ ### Migration
26
+
27
+ Operators upgrading from v1.13.0 see the default behaviour change on their first `ask`/`code` call after installing v1.14.0. To preserve v1.13.0 explicit-default semantics:
28
+
29
+ ```sh
30
+ export GEMINI_CODE_CONTEXT_CACHING_MODE=explicit
31
+ ```
32
+
33
+ Or per-call: `ask({ cachingMode: 'explicit' })` / `code({ cachingMode: 'explicit' })`.
34
+
35
+ No schema migration required — the `caching_mode` column on `usage_metrics` already accepts both values (added in v1.13.0). Pre-1.14.0 rows that recorded `'explicit'` explicitly stay correct in aggregations.
36
+
37
+ ### Notes
38
+
39
+ - Minor-level release. New env var (additive); behaviour change on the per-call default. No SQL schema changes.
40
+ - `code({ codeExecution: true })` continues to force inline content regardless of `cachingMode` because Gemini rejects `cachedContent` + `tools` simultaneously. Telemetry tags those calls as `'inline'` (the v1.13.0 round-2 fix), distinguishing them from explicit-cache adoption.
41
+ - The original v1.14.0 plan also included an `ask_agentic` streaming migration. That has been split into a follow-up (T33) so this release can ship the speed-driver default flip in a focused PR. The streaming migration is pure reliability — it doesn't affect speed and the release-pacing trade-off favours getting implicit-default to users sooner.
42
+
43
+ ### Coverage
44
+
45
+ 9 new tests in `test/unit/preflight-guard.test.ts`:
46
+ - `cachingMode tool-level default flip (v1.14.0+)` — 4 tests covering `ask`/`code` with default + override + per-call override + ctx.config flow.
47
+ - `cachingMode env resolution (v1.14.0+)` — 5 tests: default when unset, explicit honoured, implicit honoured, invalid-value fallback + stderr warning, case-insensitive parsing.
48
+
49
+ Total suite: 709 passed | 9 skipped (was 700 | 9 in v1.13.0; +9 net new tests). Lint, typecheck, double-test, build all green.
50
+
51
+ ### Round-1 review fixes (4-way `/coderev` + Copilot)
52
+
53
+ Full `/coderev` chain (GPT + Gemini + Grok via 3-way + Copilot via `mcp__github__request_copilot_review`) on the v1.14.0 PR plus full `/6step` on every finding (verified empirically that all 13 findings have all 6 steps written, after the user caught a partial first pass and demanded a remediation pass) surfaced:
54
+
55
+ - **F1 — `prepareContext` in-flight coalescing key omits `cachingMode` (HIGH; Copilot 2× line comments + Grok P0).** `inFlightKey()` at `cache-manager.ts:264-273` did not include `opts.cachingMode` in the key array. Two concurrent `prepareContext` calls with different cachingModes (e.g. one with per-call `'explicit'` override + one defaulting to `'implicit'`) produced identical keys, collided into the same `Map<string, Promise>` slot, and shared one `PreparedContext` — whichever raced first determined the return shape, the loser got the wrong caching strategy (inline content under a request that asked for an explicit `cacheId`, or vice versa). Same shape as v1.13.0 round-3 stale-fileId bug — a missing dimension on an equality-keyed lookup. v1.14.0's default flip transformed this from a niche edge into the mainline collision shape because per-call `'explicit'` overrides routinely race the new `'implicit'` default. **Fix:** add `String(opts.cachingMode ?? '')` to the key array. Two new pin tests: `concurrent prepareContext with different cachingModes do NOT coalesce` (asserts each path receives the shape it asked for) + `concurrent same-mode calls STILL coalesce (mutex preserved)` (asserts the legitimate dedup behaviour was not over-keyed).
56
+ - **F3 + F4 — log injection via raw env interpolation (LOW; Copilot + GPT P1, deduped to one fix).** `readCachingModeEnv()` at `config.ts:148-150` warned on invalid values but interpolated the raw env value verbatim into the stderr line — a value containing newlines / control chars / ANSI escapes could forge separate log records in downstream pipelines. **Fix:** wrap `raw` in `safeForLog()` (existing helper from `utils/logger.ts` that escapes C0 control chars to printable form and caps length at 2000 chars). New pin test asserts a multi-line + ANSI-escape forge attempt collapses to a single safe log line while still preserving the printable prefix for operator triage.
57
+ - **F9 — whitespace-only env values fell into warn path (LOW; Grok P1).** Pre-fix, `if (raw === '')` happened BEFORE `.trim()`, so `" "` (whitespace-only) reached the warn path with a confusing "not a recognised value" message. **Fix:** trim before the empty-check; whitespace-only short-circuits to default silently, semantically equivalent to "unset". New pin test asserts no warn fires for whitespace-only input.
58
+
59
+ 7 false positives dismissed, all empirically refuted: 5 from Gemini (hallucinated non-existent `src/config/defaults.{ts,test.ts}`, claimed `ask_agentic` accepts `cachingMode`, claimed CHANGELOG duplicates) + 2 from Grok (claimed `v1.13.0+` schema string was outdated — the v1.13.0 reference there is for `forceRescan`'s scan memo, accurate; claimed `Config.cachingMode` mandatory leaks into untouched call sites — `grep -rn "ctx.config.cachingMode" src/` shows only the two known consumers).
60
+
61
+ 2 ACCEPTED (by design): GPT's fail-closed-on-invalid-env preference (current warn+fallback matches every other `read*Env` helper in `config.ts` and fails to the safe v1.14.0 default; fail-closed would refuse server startup over a typo, worse UX) + GPT's audit-trail wording concern (CHANGELOG already contains concrete before/after latency numbers; v1.13.0 entry preserves the original "default may flip in v1.14.0 pending dogfood telemetry" gate wording for cross-version triangulation).
62
+
63
+ **Process lesson reinforced:** the first `/6step` pass skipped step-3 (empirical verify) and step-4 (counter-case both leak directions) for 7 of 13 findings — caught by the user via a `grep -E "^### Step [123456]"` header check. Remediation pass + final consolidation pass re-derived all 13 findings with full methodology; verdicts were unchanged but uncertainty was reduced. Lesson recorded in [`docs/KNOWN-DEFICITS.md`](./docs/KNOWN-DEFICITS.md) "Process lesson: /6step step-4 must counter-case BOTH leak directions". The empirical-header check is now part of the auditing standard.
64
+
65
+ Total round-1 coverage: 713 passed | 9 skipped (was 709 | 9 pre-review fixes; +4 net new pin tests covering F1×2 + F3×1 + F9×1).
66
+
67
+ ### Round-2 review fixes (post-round-1 fix-delta review)
68
+
69
+ Second 4-way `/coderev` (GPT + Gemini + Grok + Copilot) on the round-1 fix delta verified all 4 round-1 TPs (F1, F3, F4, F9) RESOLVED with file:line evidence from every reviewer. Three new LOW findings closed:
70
+
71
+ - **G2-2 (Gemini P2):** test cleanup hygiene — `vi.unstubAllEnvs()` and `errSpy.mockRestore()` were inlined at the bottom of each test, leaking stubbed env / spy state into sibling tests on assertion failure (the inline calls only fired on the happy path). **Fix:** added `afterEach` to the `cachingMode env resolution` describe block; cleanup now runs in both pass-and-fail paths.
72
+ - **G2-3 (Copilot):** CHANGELOG entry above said the warning "includes the offending raw value verbatim", but the F3+F4 fix wraps the value through `safeForLog` (control chars escaped to printable form, length capped at 2000 chars). **Fix:** updated wording to match the implementation.
73
+ - **G2-4 (Copilot):** `test/unit/preflight-guard.test.ts:659` had a literal ESC byte (0x1b) in the malicious-input fixture — invisible in most editors, hard to grep, encoding-dependent. **Fix:** replaced with the explicit `\x1b` JS escape sequence; behaviour identical, source is now grep-able.
74
+
75
+ 1 PARTIAL deferred (G2-1, Grok P1): the headline claim "over-key counter-case not pinned" was technically wrong — the same-mode coalescing pin already exists at `cache-manager.test.ts:849-890` and asserts `caches.create` fires exactly once. Grok's sub-claim about an `undefined`-vs-concrete-string discrimination test gap is real but unreachable in current code (no callsite passes `cachingMode: undefined` post-v1.14.0; the type system narrows `requestedCachingMode` to `'explicit' | 'implicit'` at every callsite). Tracked as defer-followup; no current callsite triggers.
76
+
77
+ 1 ACCEPTED LOW (G2-5, Grok P2): `safeForLog` could be hardened to escape NBSP / smart quotes / BOM in addition to C0 control chars — defense-in-depth only, no current bug.
78
+
79
+ 1 FP (G2-6, Grok P2): "toLowerCase swallows original casing" — closed by the TypeScript literal union `'explicit' | 'implicit'` at `config.ts:68` and `db.ts:478` which narrows after the case-insensitive check.
80
+
81
+ Round-2 coverage stays at 713 tests (3 fixes were in-place: 1 SQL/code, 2 test-fixture hygiene + 1 docs); no new pin tests required because the round-2 issues were doc-staleness + test-cleanup-hygiene + invisible-byte ergonomics, not new bugs needing regression coverage.
82
+
83
+ ### Round-3 review fixes (post-round-2 fix-delta review)
84
+
85
+ Third 4-way `/coderev` (GPT + Gemini + Grok + Copilot via `mcp__github__request_copilot_review`). Gemini and Copilot cleared the PR (0 findings, "ship"). 2 TP-MED findings (per `/6step` severity calibration) closed in-place + 1 PARTIAL FP dismissed:
86
+
87
+ - **G3-1 (TP MED, GPT P2 → /6step elevated):** the round-2 fix replaced the literal ESC byte in the `malicious` *string* but left raw 0x1b ESC bytes in two adjacent COMMENTS at `test/unit/preflight-guard.test.ts:676,687`. Same class as G2-4 (round-2) — invisible bytes in source files break `rg`/`grep`/editor tooling and make `git diff` render unpredictably. **Fix:** replaced both with the literal ASCII string `ESC` (in comment context the human-readable name is clearer than `\x1b`). Empirical confirmation: `grep -n $'\033' test/unit/preflight-guard.test.ts` returns no hits.
88
+ - **G3-2 (TP MED, GPT P2 → /6step elevated):** `src/utils/logger.ts:71-72` had three raw control bytes (NUL 0x00, US 0x1f, DEL 0x7f) embedded inline as comment "examples". `file(1)` reported the source as `data` (binary), `rg` skipped the file by default. **Fix:** replaced with double-escaped `\\x00`-style notation that renders as the literal escape sequence in the comment (`\x00-\x1f`, `\x7f`) rather than raw bytes. Empirical confirmation via Python control-byte scan: 3 → 0 control bytes remaining.
89
+ - **G3-3 (FP, Grok P1 → /6step refuted):** Grok claimed `safeForLog` truncation was not rune-aware (could split surrogate pairs) and that an ANSI-flood DoS vector survived the length cap. Empirically verified via Node execution: codepoint-aware `for..of` truncation correctly excludes a 2-code-unit codepoint when including it would exceed the cap (output ends at the BMP char before the surrogate, not a lone high surrogate). Length cap is enforced post-escape (newline-flood 3000→6000-escaped→2013-final, NUL-flood 1000→4000-escaped→2013-final). Grok also misidentified the file location (`config.ts` vs `utils/logger.ts`).
90
+ - **G3-4 (ACCEPTED LOW, Grok P2):** doc gap on the `safeForLog(raw)` vs `safeForLog(v)` choice in `readCachingModeEnv` (intentional — preserves diagnostic case + whitespace for typo-spotting). Tracked but not blocking.
91
+
92
+ Round-3 coverage stays at 713 tests (G3-1 + G3-2 were doc/comment ergonomics fixes — invisible-byte sanitisation, no behaviour change). Lint, typecheck, double-test, build all green.
93
+
94
+ ## [1.13.0] - 2026-04-27
95
+
96
+ ### Added — implicit-cache opt-in (per-call `cachingMode` field on `ask` / `code`)
97
+
98
+ Gemini 2.5+ and Gemini 3 Pro have automatic implicit caching enabled by default (per [ai.google.dev/gemini-api/docs/caching](https://ai.google.dev/gemini-api/docs/caching), 4 096-token minimum prefix). v1.13.0 lets callers opt into a cache strategy that skips the explicit `caches.create` build entirely and relies on Gemini's automatic implicit cache for the workspace prefix.
99
+
100
+ - New optional schema field on `ask` / `code`: `cachingMode: 'explicit' | 'implicit'`. Default `'explicit'` — pre-1.13 behaviour preserved.
101
+ - **`'explicit'`** (default): builds a Gemini Context Cache via `caches.create` — guaranteed ~75 % discount on cached input tokens, but pays a 60–180 s rebuild cost whenever any file changes.
102
+ - **`'implicit'`**: skips the explicit cache; file content is sent inline every call. Gemini 2.5+/3 Pro applies its automatic implicit caching when prefix matches across calls. Best fit for review→edit→review workflows (no rebuild wait when files change between queries) at the cost of probabilistic rather than guaranteed savings — Gemini's docs note "no cost saving guarantee" for implicit caching.
103
+ - Hit rate is observable per workspace via `status.structuredContent.caching.implicitHitRate` (see telemetry below).
104
+ - The default may flip to `'implicit'` in v1.14.0 pending dogfood telemetry.
105
+
106
+ ### Added — caching telemetry on `usage_metrics` + `status` tool
107
+
108
+ Two additive nullable columns land on `usage_metrics` so operators can see how the new caching mode is performing in production:
109
+
110
+ - `caching_mode` (TEXT, nullable): `'explicit'` / `'implicit'` per call. NULL on rows written before v1.13.0 (treated as `'explicit'` for aggregations) or on `ask_agentic` calls (which don't fit the explicit/implicit model — they use agentic file-access, no workspace cache).
111
+ - `cached_content_token_count` (INTEGER, nullable): mirrors `usage_metadata.cachedContentTokenCount` from the Gemini response. Used to compute the implicit cache hit rate.
112
+
113
+ New aggregation method on `ManifestDb`: `cacheStatsLast24h(nowMs)` — returns `{mode, callCount, implicitCallsTotal, implicitCallsWithHit, implicitCachedTokens, implicitUncachedTokens, implicitHitRate, explicitRebuildCount}`. The `status` tool surfaces this under `structuredContent.caching` and renders a human-readable "caching (24h)" block when there's something to report. Implicit hit rate < 50 % gets a gentle inline warning (no error) so operators on implicit mode can revisit the trade-off.
114
+
115
+ ### Added — scan memo (warm rescans skip ~95 % of file hashing)
116
+
117
+ Two additive nullable columns land on `files`: `mtime_ms` (INTEGER) and `size` (INTEGER). The scanner now consults these on subsequent rescans — when the file's stat-reported mtime AND size match the previously-stored values, the scanner reuses the stored content hash and skips the read+SHA256 step entirely. Both columns must match for the memo to fire (size guards the rare same-mtime-different-content case caused by sub-second writes within a 1-second resolution window).
118
+
119
+ - New per-call schema field: `forceRescan: boolean` (default `false`) — bypasses the memo and re-hashes every file. Use when you suspect the manifest is stale (filesystem mutated outside the dev workflow, NTP clock-skew, etc.).
120
+ - New env var: `GEMINI_CODE_CONTEXT_FORCE_RESCAN` — operator-level override that's ORed with the per-call flag.
121
+ - The `reindex` tool always passes `forceRescan: true` (consistent with its "blow away the memo" semantics).
122
+ - New helper: `buildScanMemo(rows)` builds the memo lookup map from the manifest's stored `FileRow[]`. Pre-1.13 rows lacking `mtimeMs`/`size` are dropped — they always re-hash on the next scan.
123
+ - `ScannedFile` now exposes `mtimeMs: number` and `memoHit: boolean`. `ScanResult` exposes `memoHitCount: number` so operators can see how often the warm path is exercised.
124
+
125
+ ### Changed — parallel scan/hash + throttled progress notifications
126
+
127
+ - **Parallel scan/hash.** The per-file `stat`+`hashFile` loop in `workspace-scanner.ts` now runs as a bounded-concurrency pool (default `hashConcurrency: 20`), measured ~6× faster than the prior serial loop on a 670k-token workspace. Memo hits drain the pool nearly instantly.
128
+ - **Throttled progress emits.** `files-uploader.ts`'s per-file progress notifications now throttle to ≥ 250 ms apart OR ≥ 25 files of progress, whichever comes first. The final completion always emits so progress UIs don't hang at e.g. 475/500.
129
+ - **Shared `runPool` utility.** Extracted from `cache/files-uploader.ts` to `utils/run-pool.ts` so the scanner and uploader share the same primitive.
130
+
131
+ ### Changed — `caches.delete` on stale-cache rebuild now async (saves 5–15 s per rebuild)
132
+
133
+ When the explicit cache path detects a stale cache id and triggers `caches.create`, the previous `caches.delete` call ran SYNCHRONOUSLY before the rebuild — adding 5–15 s of round-trip time to every cache rebuild for users on `cachingMode: 'explicit'`. v1.13.0 swaps this for an async post-create delete: the manifest's `cacheId` pointer is updated to the new cache as soon as `caches.create` returns, then the stale-cache delete fires in the background with 3× retry (1 s, 3 s, 9 s back-off). On permanent failure the orphan auto-expires at Google's TTL — bounded storage cost only.
134
+
135
+ ### Migration
136
+
137
+ Both schema additions are additive ALTER TABLE migrations on existing v1.12.x databases — `mtime_ms`, `size` (on `files`); `caching_mode`, `cached_content_token_count` (on `usage_metrics`). Migration is idempotent: opening the same DB twice swallows "duplicate column name" errors. No data conversion required; pre-1.13 rows lacking the new columns are read as NULL.
138
+
139
+ ### Round-2 review fixes (post-`/coderev` cumulative chain)
140
+
141
+ 3-way `/coderev` (gpt + gemini + grok) + `/6step` deep analysis on the v1.13.0 PR surfaced 4 true-positive findings. All fixed before publish — no deferrals.
142
+
143
+ - **FN1 — Scan memo never refreshed on inline / implicit / small-workspace paths (HIGH; gpt P1 + gemini P0 consensus).** The implicit-mode and below-`cacheMinTokens` branches in `prepareContext` skipped the uploader entirely (the only writer of `mtime_ms` / `size`), so `buildScanMemo` returned an empty Map every call and the v1.13.0 perf headline silently degraded to cold-every-call for the workflow it was built for. **Fix:** new `manifest.refreshFileFingerprints(...)` method (UPDATE-only on conflict — preserves any prior `file_id` / `uploaded_at` / `expires_at` so a switch back to explicit mode can still hit Files-API dedup) called from both inline-return branches via a `seedScanMemo` helper.
144
+ - **FN2 — Telemetry recorded requested `cachingMode`, not actual (MEDIUM; gpt P1).** When `code({ codeExecution: true })` forced inline mode (Gemini rejects `cachedContent` + `tools` simultaneously), the column tagged the call as `'explicit'` even though no `caches.create` ever fired. Inflated explicit-adoption count, biasing the v1.14.0 default-flip telemetry. **Fix:** widened the column union with a third value `'inline'`; `effectiveCachingMode` now derives from `activePrep.inlineOnly` (forced-inline → `'inline'`, explicit → `'explicit'`, implicit-requested + inline → `'implicit'`). New `inlineCallCount` field on `cacheStatsLast24h` so operators can see codeExecution traffic separately from explicit adoption.
145
+ - **FN3 — Mid-pool abort triggered per-task warn-log spam (MEDIUM; gemini P1).** A `timeoutMs` abort on a 400-file workspace at completed=12 fired the per-task abort guard for ~388 not-yet-started tasks; each rejection landed in `failures` and produced a `logger.warn('upload failed for X')` line, polluting stderr with N misleading warns before the post-pool guard re-threw the canonical `signal.reason`. **Fix:** discriminate abort-induced rejections in the failure-collection block (`reason === signal.reason || reason.name === 'AbortError'` → continue, no warn, no failures push). Genuine non-abort upload errors continue to surface as warns.
146
+ - **FN8 — Missing tests for memo-hit growth + telemetry mode-vs-actual (MEDIUM; gpt+gemini META-PR C).** Three new pin tests in `cache-manager.test.ts` and `manifest-db.test.ts` cover: (1) implicit-mode call seeds `mtime_ms`/`size` on file rows, (2) small-workspace inline path also seeds, (3) `refreshFileFingerprints` preserves prior dedup metadata across explicit→implicit switches, (4) `cachingMode='inline'` distinct from `'explicit'` in aggregation, (5) `mode='mixed'` when 3 modes appear. Plus two new pin tests in `files-uploader.test.ts` covering FN3's discrimination logic (zero abort-induced warns; genuine non-abort errors still surface).
147
+ - **FN6 — `(mtime_ms, size)` collision on atomic file replace (LOW PARTIAL; grok P1).** Documented as a tracked deficit in [`docs/KNOWN-DEFICITS.md`](./docs/KNOWN-DEFICITS.md) with the trigger conditions and `forceRescan` workaround. Future inode/3-tuple gate tracked as T29 in [`docs/FOLLOW-UP-PRS.md`](./docs/FOLLOW-UP-PRS.md) — pre-emptive fix is speculative cost given the exotic trigger.
148
+ - **FN4 — Additive ALTER TABLE without `SCHEMA_VERSION` bump (LOW ACCEPTED; gemini P2).** Reviewer themselves rated as housekeeping. Tracked as T30 in [`docs/FOLLOW-UP-PRS.md`](./docs/FOLLOW-UP-PRS.md) for the next destructive migration.
149
+
150
+ 3 false positives dismissed (all from Grok, all citing code elements that don't exist in this codebase per empirical grep — Grok's own caveat declared its citations unverified due to MCP shell-substitution failure during the review).
151
+
152
+ ### Round-3 review fixes (post-`/coderev round2` + Copilot)
153
+
154
+ A second `/coderev` pass on the round-2 fix delta (HEAD~2..HEAD), plus Copilot's PR-level review, surfaced **one HIGH that the round-2 self-audit missed** plus 2 LOWs. Critical lesson — the round-2 self-audit's R2-1 finding examined `refreshFileFingerprints` for "could a NULL fileId leak into the dedup query?" and confirmed the `file_id IS NOT NULL` filter rejects NULLs. But it failed to counter-case the *opposite* leak direction: "could a non-NULL but stale fileId leak in?" The dedup query happily returns rows where `content_hash = NEW_HASH` AND `file_id = OLD_FILEID` (uploaded for OLD content). Step 4 of /6step requires challenging both leak directions; missing the harder direction is the failure mode this round corrects.
155
+
156
+ - **R3-FN1 — `refreshFileFingerprints` preserves stale `file_id` across `content_hash` change → silent context corruption (HIGH; gemini P0 + gpt P1 + copilot, missed by grok).** When a file's content changes between an explicit run (which uploaded the OLD bytes to Files API at `fileId='files/foo'`) and an implicit run (which calls `seedScanMemo`), the round-2 SQL preserved `file_id` unconditionally on conflict. Result: the row stored `(NEW_HASH, OLD_FILEID)` — and a subsequent explicit run's `findFileRowByHash(workspace, NEW_HASH, now)` returned that row, routing NEW content through the OLD upload. **Fix:** ON CONFLICT SET clause now uses `CASE WHEN files.content_hash <> excluded.content_hash THEN NULL ELSE files.file_id END` (and same for `uploaded_at` / `expires_at`). Content unchanged → preserve dedup metadata (the legitimate cross-mode reuse). Content changed → null out, forcing the next explicit run to re-upload. Replaces the round-2 test that locked in the buggy behavior with three new pin tests: hash-changed clears, hash-unchanged preserves, and `findFileRowByHash` regression covering the end-to-end corruption path.
157
+ - **R3-FN2 — `files-uploader.test.ts:508` discrimination test never aborts the signal (LOW; gpt P2).** The "FN3 discrimination: genuine non-abort upload errors still surface as warns" test created an `AbortController` but never called `controller.abort(...)` — leaving the load-bearing `aborted=true && reason !== signal.reason && reason.name !== 'AbortError'` branch untested. **Fix:** new `'FN3 discrimination (truly): aborted + concurrent 5xx in same task still surfaces a warn'` test that aborts the controller AND throws a real 503 in the same task; asserts the 5xx warn surfaces while the abort-induced rejection on the second file IS suppressed.
158
+ - **R3-FN3 — `emitProgress` "final emit always fires" comment falsified when tail tasks fail → UI hangs at 490/500 (LOW; copilot).** `completed` only increments on task SUCCESS, so a tail of failed uploads (rejection inside the per-file uploader) leaves `completed < files.length`, the throttle's `isFinal` predicate never triggers, and the last successful indexed-file message stays buffered indefinitely. **Fix:** trailing flush after the failure-collection `.then()` block — `if (completed > lastEmitCompleted) emit(\`indexed ${completed}/${files.length}\`)`. New test mocks 3 files with the last one failing; asserts emitter received a final emit with `completed=2, total=3` rather than lagging behind.
159
+
160
+ 2 ACCEPTED LOW findings tracked as follow-ups in [`docs/FOLLOW-UP-PRS.md`](./docs/FOLLOW-UP-PRS.md): T31 (skip memo-hit rows in `refreshFileFingerprints` to avoid WAL churn on monorepos) + T32 (`isAbortLike(reason, signal)` helper for future wrapped-error rejection paths).
161
+
162
+ ### Round-3 verification polish (post-adversarial /6step)
163
+
164
+ After landing the round-3 HIGH fix, an adversarial /6step verification pass (workspace `/tmp/coderev/20260428-140123-51773/round3-verify-sixstep.md`) explicitly counter-cased BOTH leak directions on 13 plausible gaps in the round-3 fix. All 12 correctness gaps verified clean by an empirical `better-sqlite3` probe — confirming SQLite CASE-clause OLD/NEW semantics, end-to-end Scenario B closure (cross-file leak via shared content_hash), WAL snapshot isolation across concurrent connections, and `findFileRowByHash`'s correctness under the post-fix manifest state. The fix is empirically complete.
165
+
166
+ Three defense-in-depth polish items applied:
167
+
168
+ - **CASE hardening with `COALESCE(files.content_hash, '')`** — closes a latent regression footprint where a future migration that relaxes `content_hash`'s NOT NULL constraint would silently re-introduce the corruption (because SQL `NULL <> 'x'` is NULL/falsy → CASE falls through to ELSE → stale fileId preserved). With the COALESCE guard, a NULL existing hash compares as `'' <> 'new-hash'` → TRUE → fileId cleared. Schema-infeasible today; pure forward-defense at zero runtime cost.
169
+ - **Explicit Scenario B regression test** in `cache-manager.test.ts` — before this commit, only Scenario A (same-relpath self-corruption) had a dedicated test; Scenario B (cross-file leak via shared content_hash — file2.ts new content hashes to the same value as file1.ts's new content, attempting dedup against file1.ts's stale fileId) was closed by the same SQL invariant but undocumented in tests. The new pin asserts `findFileRowByHash(ws, H_BAR, now) === null` after a hash-change refresh, plus that a fresh upload of file2.ts gets its OWN distinct fileId.
170
+ - **Clarifying comment** on the "PRESERVES" test's mtime assertion noting that `mtime_ms` is OUTSIDE the round-3 conditional CASE (refreshes unconditionally) — pre-empts future-reader confusion where a regression that wraps every column in CASE would surface here rather than silently freezing mtime updates.
171
+
172
+ The CHANGELOG's prior round-3 block stated the lesson learned in passing; [`docs/KNOWN-DEFICITS.md`](./docs/KNOWN-DEFICITS.md) now also carries it as a process record under "Process lesson: /6step step-4 must counter-case BOTH leak directions" — for future contributors auditing discriminator-filter / cache-key / dedup-query designs.
173
+
174
+ Final coverage: 700 passed | 9 skipped (was 699 | 9 after round-3; +1 net new Scenario B regression pin). Lint, typecheck, double-test, build all green.
175
+
176
+ ### Notes
177
+
178
+ - Minor-level release. New schema field (`cachingMode`); new structured-content metadata fields on `status`; new SQLite columns (additive, nullable). Default behaviour unchanged.
179
+ - The implicit-caching pivot is the architectural answer to the v1.6-v1.7 streaming refactor's "review→edit→review" pain point: no more 60–180 s rebuild wait when files change between queries on Gemini 2.5+/3.
180
+ - Coverage additions: 28 cache-manager tests (was 21 → 23 + 2 round-2 FN1 pins + 1 round-2 dedup-preserve [later flipped] + 2 round-3 hash-changed/unchanged pins + 1 round-3 dedup-regression test + 1 round-3-verify Scenario B pin), 34 manifest-db tests (was 23 → 32 + 2 round-2 FN2 pins), 19 workspace-scanner tests (was 14 + 5 v1.13 scan-memo tests), 4-test `status-tool.test.ts`, 4 round-2/3 pins on `files-uploader.test.ts` (2 FN3 + 1 round-3 truly-aborted-discrimination + 1 round-3 trailing-flush). Total suite: 700 passed | 9 skipped (was 663 | 9 in v1.12.2; +37 net new tests).
181
+
8
182
  ## [1.12.2] - 2026-04-28
9
183
 
10
184
  ### Added — observability for the `ask` → `ask_agentic` fallback timeout selection
@@ -79,6 +79,26 @@ export interface BuildOptions {
79
79
  * upload duration" instead of "total file count × max upload duration".
80
80
  */
81
81
  signal?: AbortSignal;
82
+ /**
83
+ * Caching mode (v1.13.0+). Controls whether `prepareContext` builds
84
+ * an explicit Gemini Context Cache (`caches.create`) or falls through
85
+ * to the inline path and relies on Gemini's automatic implicit
86
+ * caching for Gemini 2.5+/3 models.
87
+ *
88
+ * - `'explicit'` (today's behaviour): build + reuse a Context Cache
89
+ * for the workspace. Hard ~75 % discount on cached input. Pays
90
+ * 60–180 s `caches.create` cost on file change.
91
+ * - `'implicit'` (v1.13.0+ opt-in): skip `caches.create` entirely;
92
+ * send file content inline every call. Gemini's automatic implicit
93
+ * caching applies a discount when the prefix matches across calls
94
+ * (4 096-token minimum, no guarantee). No rebuild wait on file
95
+ * change. **Best fit for review→edit→review workflows** where
96
+ * files change between queries.
97
+ * - `undefined`: caller doesn't care; behave as `'explicit'` (the
98
+ * v1.12.x default; flip planned for v1.14.0 pending dogfood
99
+ * telemetry).
100
+ */
101
+ cachingMode?: 'explicit' | 'implicit';
82
102
  }
83
103
  export declare function prepareContext(opts: BuildOptions): Promise<PreparedContext>;
84
104
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"cache-manager.d.ts","sourceRoot":"","sources":["../../src/cache/cache-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAQ,MAAM,eAAe,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,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AAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CACvC;AA6LD,wBAAsB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAajF;AAyRD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE;IACnD,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,UAAU,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDhB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,QAAQ,EAAE,UAAU,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,IAAI,CASP;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAMvD"}
@@ -106,6 +106,32 @@ function buildContentFromUploaded(files) {
106
106
  * `[SKIPPED: inline size cap]` marker so the model knows they were omitted.
107
107
  */
108
108
  const MAX_INLINE_TOTAL_BYTES = 20 * 1024 * 1024; // 20 MB aggregate inline content
109
+ /**
110
+ * v1.13.0 post-review fix: seed the scan memo from a ScanResult on the
111
+ * inline-return paths (`!allowCaching`, `cachingMode: 'implicit'`,
112
+ * small-workspace). The uploader is the only OTHER writer of the memo
113
+ * columns; on these paths the uploader is skipped, so without this seed
114
+ * the memo Map next call comes back empty and every file re-hashes.
115
+ *
116
+ * Defensive vs `manifest.upsertFile`: this calls the dedicated
117
+ * `refreshFileFingerprints` method which preserves any existing
118
+ * `file_id` / `uploaded_at` / `expires_at` from a prior explicit-cache
119
+ * run. Switching back from `cachingMode: 'implicit'` to `'explicit'` on
120
+ * a workspace that previously uploaded files should still hit the
121
+ * Files-API dedup; orphaning that capability would silently force
122
+ * re-uploads on every mode flip.
123
+ */
124
+ function seedScanMemo(manifest, scan) {
125
+ if (scan.files.length === 0)
126
+ return;
127
+ manifest.refreshFileFingerprints(scan.files.map((f) => ({
128
+ workspaceRoot: scan.workspaceRoot,
129
+ relpath: f.relpath,
130
+ contentHash: f.contentHash,
131
+ mtimeMs: f.mtimeMs,
132
+ size: f.size,
133
+ })));
134
+ }
109
135
  async function buildInlineContentFromDisk(scan) {
110
136
  const parts = [];
111
137
  let total = 0;
@@ -133,15 +159,23 @@ async function buildInlineContentFromDisk(scan) {
133
159
  }
134
160
  /**
135
161
  * In-process mutex. Concurrent `prepareContext` calls for the SAME
136
- * `(workspaceRoot, filesHash, model, systemPromptHash, allowCaching, cacheMinTokens)`
137
- * fingerprint coalesce onto a single in-flight promise, avoiding duplicate
138
- * cache creation (which would leak orphaned Gemini caches at $$$/M-token-hour).
162
+ * `(workspaceRoot, filesHash, model, systemPromptHash, allowCaching,
163
+ * cacheMinTokens, cachingMode)` fingerprint coalesce onto a single
164
+ * in-flight promise, avoiding duplicate cache creation (which would leak
165
+ * orphaned Gemini caches at $$$/M-token-hour).
139
166
  *
140
167
  * Keying on the full fingerprint is critical: `ask` and `code` tools use
141
168
  * different system instructions, so their `systemPromptHash` differs. Coalescing
142
169
  * on workspaceRoot alone would serve one tool's PreparedContext to the other —
143
170
  * wrong cache / system-instruction mismatch. This bug was flagged by GPT + Copilot.
144
171
  *
172
+ * v1.14.0 round-1 added `cachingMode` to the fingerprint after Copilot
173
+ * caught a HIGH concurrency race (`/6step` F1): pre-fix, two concurrent
174
+ * calls with different `cachingMode` values produced identical keys, sharing
175
+ * one PreparedContext between them. v1.14.0's default flip transformed this
176
+ * from a niche edge case into the mainline collision shape — see the F1
177
+ * comment inside `inFlightKey()` below for the full failure scenario.
178
+ *
145
179
  * Scope: single Node process. Cross-process races (two MCP servers sharing the
146
180
  * same manifest DB) are not covered — documented in docs/KNOWN-DEFICITS.md.
147
181
  */
@@ -154,6 +188,19 @@ function inFlightKey(opts) {
154
188
  opts.systemPromptHash,
155
189
  String(opts.allowCaching),
156
190
  String(opts.cacheMinTokens ?? ''),
191
+ // v1.14.0 round-1 fix (F1, Copilot HIGH): `cachingMode` MUST be in the
192
+ // key. Pre-fix, two concurrent calls — one with `'explicit'` (per-call
193
+ // override), one with `'implicit'` (the v1.14.0 default) — produced
194
+ // identical keys and shared the SAME PreparedContext via the coalescing
195
+ // map below. Whichever raced first determined the return shape; the
196
+ // loser got the wrong caching strategy. Same shape as the v1.13.0
197
+ // round-3 stale-fileId bug — a missing dimension on an equality-keyed
198
+ // lookup. v1.14.0's default flip turned this from a niche edge case
199
+ // into the mainline collision shape because per-call `'explicit'`
200
+ // overrides routinely race the new default. `?? ''` keeps `undefined`
201
+ // distinct from `'explicit'` so a future third caching mode can't
202
+ // silently coalesce with undefined-legacy callers.
203
+ String(opts.cachingMode ?? ''),
157
204
  ].join('\u241E'); // record-separator sentinel unlikely to appear in any field
158
205
  }
159
206
  export async function prepareContext(opts) {
@@ -192,10 +239,17 @@ async function doPrepareContext(opts) {
192
239
  updatedAt: now,
193
240
  });
194
241
  }
195
- // 2) If caching is disabled upfront, skip the Files API entirely and embed
196
- // file text inline. No upload round-trip, no 48 h housekeeping.
197
- if (!allowCaching) {
198
- logger.debug('caching disabled — embedding files inline from disk.');
242
+ // 2) Inline path — taken when caching is disabled OR the caller opted into
243
+ // implicit caching (v1.13.0+). In both cases we skip `caches.create`,
244
+ // embed file text inline from disk, and let Gemini handle whatever
245
+ // caching it can: zero for `noCache` callers; automatic implicit
246
+ // caching on Gemini 2.5+/3 Pro for `cachingMode: 'implicit'` callers.
247
+ // No upload round-trip, no 48 h housekeeping.
248
+ const implicitMode = opts.cachingMode === 'implicit';
249
+ if (!allowCaching || implicitMode) {
250
+ logger.debug(implicitMode
251
+ ? 'caching mode = implicit — embedding files inline from disk; Gemini 2.5+/3 will auto-cache prefix.'
252
+ : 'caching disabled — embedding files inline from disk.');
199
253
  const inlineContents = await buildInlineContentFromDisk(scan);
200
254
  manifest.upsertWorkspace({
201
255
  workspaceRoot: scan.workspaceRoot,
@@ -208,6 +262,13 @@ async function doPrepareContext(opts) {
208
262
  createdAt: existing?.createdAt ?? now,
209
263
  updatedAt: now,
210
264
  });
265
+ // v1.13.0 memo-seed (post-review fix): the inline path skips
266
+ // `uploadWorkspaceFiles`, which is the only other site that calls
267
+ // `upsertFile`. Without this seed, `mtime_ms` / `size` columns stay
268
+ // NULL on every file row, `buildScanMemo` filters them out next call,
269
+ // and the v1.13.0 scan memo silently degrades to cold-every-call —
270
+ // exactly defeating the perf headline for implicit-mode users.
271
+ seedScanMemo(manifest, scan);
211
272
  return {
212
273
  cacheId: null,
213
274
  cacheExpiresAt: null,
@@ -256,6 +317,9 @@ async function doPrepareContext(opts) {
256
317
  createdAt: existing?.createdAt ?? now,
257
318
  updatedAt: now,
258
319
  });
320
+ // v1.13.0 memo-seed (post-review fix): see the same call upstream in
321
+ // the inline / implicit branch for full rationale.
322
+ seedScanMemo(manifest, scan);
259
323
  return {
260
324
  cacheId: null,
261
325
  cacheExpiresAt: null,
@@ -294,18 +358,16 @@ async function doPrepareContext(opts) {
294
358
  .join(' | ');
295
359
  throw new Error(`Upload failed for ${uploaded.failedCount}/${scan.files.length} files (threshold ${failureThreshold}). First errors: ${preview}`);
296
360
  }
297
- // 6) Delete any stale cache BEFORE attempting to build the new one.
298
- // If the new build fails, the catch block can null-out cacheId in the
299
- // manifest without leaking a reference on Google's side.
300
- if (existing?.cacheId) {
301
- try {
302
- await client.caches.delete({ name: existing.cacheId });
303
- logger.debug(`deleted stale cache ${safeForLog(existing.cacheId)} before rebuild`);
304
- }
305
- catch (err) {
306
- logger.debug(`pre-rebuild cache delete (${safeForLog(existing.cacheId)}) failed: ${safeForLog(err)}`);
307
- }
308
- }
361
+ // 6) Capture the stale cacheId for async post-create deletion.
362
+ // v1.13.0 — pre-fix the delete ran synchronously before the build,
363
+ // adding 5–15 s to the user's critical path on every cache rebuild.
364
+ // Post-fix we build the new cache first, swap the manifest pointer,
365
+ // return to the caller, and delete the old cache async (best-effort,
366
+ // retried) — the user's wait drops by the delete's full duration.
367
+ // Worst case on persistent delete failure: an orphaned cache lingers
368
+ // on Google's side until its TTL expires (~hours-to-day). Storage
369
+ // cost is bounded by `cacheTtlSeconds`. Documented in CHANGELOG.
370
+ const staleCacheIdForAsyncDelete = existing?.cacheId ?? null;
309
371
  // 7) Build a new cache.
310
372
  emitter.emit('building context cache…');
311
373
  const fileContents = buildContentFromUploaded(uploaded.files);
@@ -338,6 +400,13 @@ async function doPrepareContext(opts) {
338
400
  createdAt: existing?.createdAt ?? now,
339
401
  updatedAt: afterCreateMs,
340
402
  });
403
+ // v1.13.0 — fire-and-forget delete of the stale cache. Manifest already
404
+ // points at the new cacheId, so a delete failure is purely a Google-side
405
+ // orphan (auto-expires at TTL). 3× retry handles transient errors;
406
+ // permanent failure is logged at warn but doesn't surface to the caller.
407
+ if (staleCacheIdForAsyncDelete !== null) {
408
+ void bestEffortDeleteCache(client, staleCacheIdForAsyncDelete);
409
+ }
341
410
  return {
342
411
  cacheId,
343
412
  cacheExpiresAt,
@@ -372,6 +441,38 @@ async function doPrepareContext(opts) {
372
441
  };
373
442
  }
374
443
  }
444
+ /**
445
+ * Best-effort async delete of a stale cache after a successful rebuild
446
+ * (v1.13.0+). Retries 3× with exponential back-off (1 s, 3 s, 9 s) for
447
+ * transient errors. Logs at warn on permanent failure — orphaned caches
448
+ * auto-expire at Google's TTL so the worst case is bounded storage cost.
449
+ *
450
+ * Called as `void bestEffortDeleteCache(...)` so callers don't have to
451
+ * await; the manifest's `cacheId` pointer was already swapped to the new
452
+ * cache before this fires.
453
+ */
454
+ async function bestEffortDeleteCache(client, cacheId) {
455
+ const delays = [1000, 3000, 9000];
456
+ for (let attempt = 0; attempt < delays.length; attempt += 1) {
457
+ try {
458
+ await client.caches.delete({ name: cacheId });
459
+ logger.debug(`async-deleted stale cache ${safeForLog(cacheId)} (attempt ${attempt + 1})`);
460
+ return;
461
+ }
462
+ catch (err) {
463
+ // Retry transient errors; give up quickly on 4xx (cache already gone, perms, etc.)
464
+ const msg = err instanceof Error ? err.message : String(err);
465
+ const isTransient = !msg.includes('NOT_FOUND') && !msg.includes('PERMISSION_DENIED');
466
+ if (!isTransient || attempt === delays.length - 1) {
467
+ logger.warn(`async-delete of stale cache ${safeForLog(cacheId)} permanently failed (attempt ${attempt + 1}): ${safeForLog(msg)}. Orphan will auto-expire at TTL.`);
468
+ return;
469
+ }
470
+ const nextDelay = delays[attempt];
471
+ if (nextDelay !== undefined)
472
+ await new Promise((r) => setTimeout(r, nextDelay));
473
+ }
474
+ }
475
+ }
375
476
  /**
376
477
  * Hard-purge a workspace: delete the Gemini Context Cache, release every
377
478
  * Files API upload we uploaded for this workspace, and drop the manifest rows.
@@ -1 +1 @@
1
- {"version":3,"file":"cache-manager.js","sourceRoot":"","sources":["../../src/cache/cache-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK5C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAqB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AA6D9E,SAAS,SAAS,CAAC,OAAe;IAChC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC;AACjD,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,k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AAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"files-uploader.d.ts","sourceRoot":"","sources":["../../src/cache/files-uploader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AA2B5D,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAmCD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,UAAU,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,OAAO,EAAE,eAAe,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,YAAY,CAAC,CA2JxB"}
1
+ {"version":3,"file":"files-uploader.d.ts","sourceRoot":"","sources":["../../src/cache/files-uploader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CA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