@qmediat.io/gemini-code-context-mcp 1.12.1 → 1.13.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.
- package/CHANGELOG.md +114 -0
- package/dist/cache/cache-manager.d.ts +20 -0
- package/dist/cache/cache-manager.d.ts.map +1 -1
- package/dist/cache/cache-manager.js +96 -16
- package/dist/cache/cache-manager.js.map +1 -1
- package/dist/cache/files-uploader.d.ts.map +1 -1
- package/dist/cache/files-uploader.js +57 -30
- package/dist/cache/files-uploader.js.map +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/indexer/workspace-scanner.d.ts +63 -0
- package/dist/indexer/workspace-scanner.d.ts.map +1 -1
- package/dist/indexer/workspace-scanner.js +66 -7
- package/dist/indexer/workspace-scanner.js.map +1 -1
- package/dist/manifest/db.d.ts +101 -0
- package/dist/manifest/db.d.ts.map +1 -1
- package/dist/manifest/db.js +231 -10
- package/dist/manifest/db.js.map +1 -1
- package/dist/tools/ask.tool.d.ts +10 -0
- package/dist/tools/ask.tool.d.ts.map +1 -1
- package/dist/tools/ask.tool.js +68 -9
- package/dist/tools/ask.tool.js.map +1 -1
- package/dist/tools/code.tool.d.ts +10 -0
- package/dist/tools/code.tool.d.ts.map +1 -1
- package/dist/tools/code.tool.js +39 -1
- package/dist/tools/code.tool.js.map +1 -1
- package/dist/tools/reindex.tool.d.ts.map +1 -1
- package/dist/tools/reindex.tool.js +4 -0
- package/dist/tools/reindex.tool.js.map +1 -1
- package/dist/tools/status.tool.d.ts.map +1 -1
- package/dist/tools/status.tool.js +46 -0
- package/dist/tools/status.tool.js.map +1 -1
- package/dist/types.d.ts +36 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/run-pool.d.ts +15 -0
- package/dist/utils/run-pool.d.ts.map +1 -0
- package/dist/utils/run-pool.js +36 -0
- package/dist/utils/run-pool.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,120 @@ 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.13.0] - 2026-04-27
|
|
9
|
+
|
|
10
|
+
### Added — implicit-cache opt-in (per-call `cachingMode` field on `ask` / `code`)
|
|
11
|
+
|
|
12
|
+
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.
|
|
13
|
+
|
|
14
|
+
- New optional schema field on `ask` / `code`: `cachingMode: 'explicit' | 'implicit'`. Default `'explicit'` — pre-1.13 behaviour preserved.
|
|
15
|
+
- **`'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.
|
|
16
|
+
- **`'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.
|
|
17
|
+
- Hit rate is observable per workspace via `status.structuredContent.caching.implicitHitRate` (see telemetry below).
|
|
18
|
+
- The default may flip to `'implicit'` in v1.14.0 pending dogfood telemetry.
|
|
19
|
+
|
|
20
|
+
### Added — caching telemetry on `usage_metrics` + `status` tool
|
|
21
|
+
|
|
22
|
+
Two additive nullable columns land on `usage_metrics` so operators can see how the new caching mode is performing in production:
|
|
23
|
+
|
|
24
|
+
- `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).
|
|
25
|
+
- `cached_content_token_count` (INTEGER, nullable): mirrors `usage_metadata.cachedContentTokenCount` from the Gemini response. Used to compute the implicit cache hit rate.
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
29
|
+
### Added — scan memo (warm rescans skip ~95 % of file hashing)
|
|
30
|
+
|
|
31
|
+
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).
|
|
32
|
+
|
|
33
|
+
- 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.).
|
|
34
|
+
- New env var: `GEMINI_CODE_CONTEXT_FORCE_RESCAN` — operator-level override that's ORed with the per-call flag.
|
|
35
|
+
- The `reindex` tool always passes `forceRescan: true` (consistent with its "blow away the memo" semantics).
|
|
36
|
+
- 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.
|
|
37
|
+
- `ScannedFile` now exposes `mtimeMs: number` and `memoHit: boolean`. `ScanResult` exposes `memoHitCount: number` so operators can see how often the warm path is exercised.
|
|
38
|
+
|
|
39
|
+
### Changed — parallel scan/hash + throttled progress notifications
|
|
40
|
+
|
|
41
|
+
- **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.
|
|
42
|
+
- **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.
|
|
43
|
+
- **Shared `runPool` utility.** Extracted from `cache/files-uploader.ts` to `utils/run-pool.ts` so the scanner and uploader share the same primitive.
|
|
44
|
+
|
|
45
|
+
### Changed — `caches.delete` on stale-cache rebuild now async (saves 5–15 s per rebuild)
|
|
46
|
+
|
|
47
|
+
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.
|
|
48
|
+
|
|
49
|
+
### Migration
|
|
50
|
+
|
|
51
|
+
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.
|
|
52
|
+
|
|
53
|
+
### Round-2 review fixes (post-`/coderev` cumulative chain)
|
|
54
|
+
|
|
55
|
+
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.
|
|
56
|
+
|
|
57
|
+
- **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.
|
|
58
|
+
- **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.
|
|
59
|
+
- **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.
|
|
60
|
+
- **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).
|
|
61
|
+
- **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.
|
|
62
|
+
- **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.
|
|
63
|
+
|
|
64
|
+
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).
|
|
65
|
+
|
|
66
|
+
### Round-3 review fixes (post-`/coderev round2` + Copilot)
|
|
67
|
+
|
|
68
|
+
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.
|
|
69
|
+
|
|
70
|
+
- **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.
|
|
71
|
+
- **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.
|
|
72
|
+
- **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.
|
|
73
|
+
|
|
74
|
+
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).
|
|
75
|
+
|
|
76
|
+
### Round-3 verification polish (post-adversarial /6step)
|
|
77
|
+
|
|
78
|
+
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.
|
|
79
|
+
|
|
80
|
+
Three defense-in-depth polish items applied:
|
|
81
|
+
|
|
82
|
+
- **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.
|
|
83
|
+
- **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.
|
|
84
|
+
- **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.
|
|
85
|
+
|
|
86
|
+
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.
|
|
87
|
+
|
|
88
|
+
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.
|
|
89
|
+
|
|
90
|
+
### Notes
|
|
91
|
+
|
|
92
|
+
- Minor-level release. New schema field (`cachingMode`); new structured-content metadata fields on `status`; new SQLite columns (additive, nullable). Default behaviour unchanged.
|
|
93
|
+
- 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.
|
|
94
|
+
- 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).
|
|
95
|
+
|
|
96
|
+
## [1.12.2] - 2026-04-28
|
|
97
|
+
|
|
98
|
+
### Added — observability for the `ask` → `ask_agentic` fallback timeout selection
|
|
99
|
+
|
|
100
|
+
When `ask` falls back to `ask_agentic` on `WORKSPACE_TOO_LARGE`, both `timeoutMs` and `stallMs` collapse onto the agentic per-iteration cap (`iterationTimeoutMs`) using the tighter of the two. v1.12.2 makes this selection visible to operators and orchestrators:
|
|
101
|
+
|
|
102
|
+
- A warn-level log line now fires whenever fallback applies a per-iteration cap, identifying the chosen value AND the source (one of `'timeoutMs'`, `'stallMs'`, or `'min(timeoutMs,stallMs)'`). Pre-v1.12.2 the log fired only when `stallMs` alone was set — the both-set case was silent.
|
|
103
|
+
- The wrapped `structuredContent` on a fallback-served response now includes two new fields:
|
|
104
|
+
- `iterTimeoutMs: number` — the effective per-iteration cap used by the agentic call.
|
|
105
|
+
- `iterTimeoutSource: 'timeoutMs' | 'stallMs' | 'min(timeoutMs,stallMs)'` — which knob the cap came from.
|
|
106
|
+
|
|
107
|
+
Both fields are omitted when the user passed neither `timeoutMs` nor `stallMs` (no per-iteration cap was set). No schema changes; metadata is additive on the existing `structuredContent` envelope.
|
|
108
|
+
|
|
109
|
+
### Fixed — test coverage for the v1.12.1 abort-propagation hardening
|
|
110
|
+
|
|
111
|
+
The v1.12.1 patch added pre-flight, mid-pool, and post-pool abort checks in `uploadWorkspaceFiles` (closing the Copilot COP-2 finding where `runPool`'s settled-results pattern silently swallowed per-task abort throws). The fix shipped without unit tests covering those code paths; v1.12.2 adds three pin tests so future regressions are caught:
|
|
112
|
+
|
|
113
|
+
- **Pre-flight short-circuit**: when `signal` is already aborted before `uploadWorkspaceFiles` is invoked, the function rejects with `signal.reason` and never calls `client.files.upload`.
|
|
114
|
+
- **Post-`runPool` abort propagation**: when abort fires mid-pool (during a per-task upload), the post-pool abort check re-throws the canonical `signal.reason` (e.g. a `TimeoutError` `DOMException` carrying `timeoutKind: 'total'`) so the outer tool layer maps it to `errorCode: 'TIMEOUT'`. Previously this case bypassed the test suite entirely.
|
|
115
|
+
- **Defensive non-Error reason fallback**: when `controller.abort('string-reason')` is used, the post-pool block falls back to a synthetic `DOMException('Operation aborted during file upload', 'AbortError')` instead of throwing a bare string.
|
|
116
|
+
|
|
117
|
+
### Notes
|
|
118
|
+
|
|
119
|
+
- Patch-level release. No breaking changes. No schema changes. The new metadata fields on the fallback `structuredContent` are additive.
|
|
120
|
+
- The three new test pins bring `test/unit/files-uploader.test.ts` to 11 tests.
|
|
121
|
+
|
|
8
122
|
## [1.12.1] - 2026-04-28
|
|
9
123
|
|
|
10
124
|
### Fixed — cumulative-review hardening across Phase 2+3+4
|
|
@@ -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,mB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sB,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;
|
|
@@ -192,10 +218,17 @@ async function doPrepareContext(opts) {
|
|
|
192
218
|
updatedAt: now,
|
|
193
219
|
});
|
|
194
220
|
}
|
|
195
|
-
// 2)
|
|
196
|
-
//
|
|
197
|
-
|
|
198
|
-
|
|
221
|
+
// 2) Inline path — taken when caching is disabled OR the caller opted into
|
|
222
|
+
// implicit caching (v1.13.0+). In both cases we skip `caches.create`,
|
|
223
|
+
// embed file text inline from disk, and let Gemini handle whatever
|
|
224
|
+
// caching it can: zero for `noCache` callers; automatic implicit
|
|
225
|
+
// caching on Gemini 2.5+/3 Pro for `cachingMode: 'implicit'` callers.
|
|
226
|
+
// No upload round-trip, no 48 h housekeeping.
|
|
227
|
+
const implicitMode = opts.cachingMode === 'implicit';
|
|
228
|
+
if (!allowCaching || implicitMode) {
|
|
229
|
+
logger.debug(implicitMode
|
|
230
|
+
? 'caching mode = implicit — embedding files inline from disk; Gemini 2.5+/3 will auto-cache prefix.'
|
|
231
|
+
: 'caching disabled — embedding files inline from disk.');
|
|
199
232
|
const inlineContents = await buildInlineContentFromDisk(scan);
|
|
200
233
|
manifest.upsertWorkspace({
|
|
201
234
|
workspaceRoot: scan.workspaceRoot,
|
|
@@ -208,6 +241,13 @@ async function doPrepareContext(opts) {
|
|
|
208
241
|
createdAt: existing?.createdAt ?? now,
|
|
209
242
|
updatedAt: now,
|
|
210
243
|
});
|
|
244
|
+
// v1.13.0 memo-seed (post-review fix): the inline path skips
|
|
245
|
+
// `uploadWorkspaceFiles`, which is the only other site that calls
|
|
246
|
+
// `upsertFile`. Without this seed, `mtime_ms` / `size` columns stay
|
|
247
|
+
// NULL on every file row, `buildScanMemo` filters them out next call,
|
|
248
|
+
// and the v1.13.0 scan memo silently degrades to cold-every-call —
|
|
249
|
+
// exactly defeating the perf headline for implicit-mode users.
|
|
250
|
+
seedScanMemo(manifest, scan);
|
|
211
251
|
return {
|
|
212
252
|
cacheId: null,
|
|
213
253
|
cacheExpiresAt: null,
|
|
@@ -256,6 +296,9 @@ async function doPrepareContext(opts) {
|
|
|
256
296
|
createdAt: existing?.createdAt ?? now,
|
|
257
297
|
updatedAt: now,
|
|
258
298
|
});
|
|
299
|
+
// v1.13.0 memo-seed (post-review fix): see the same call upstream in
|
|
300
|
+
// the inline / implicit branch for full rationale.
|
|
301
|
+
seedScanMemo(manifest, scan);
|
|
259
302
|
return {
|
|
260
303
|
cacheId: null,
|
|
261
304
|
cacheExpiresAt: null,
|
|
@@ -294,18 +337,16 @@ async function doPrepareContext(opts) {
|
|
|
294
337
|
.join(' | ');
|
|
295
338
|
throw new Error(`Upload failed for ${uploaded.failedCount}/${scan.files.length} files (threshold ${failureThreshold}). First errors: ${preview}`);
|
|
296
339
|
}
|
|
297
|
-
// 6)
|
|
298
|
-
//
|
|
299
|
-
//
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
}
|
|
340
|
+
// 6) Capture the stale cacheId for async post-create deletion.
|
|
341
|
+
// v1.13.0 — pre-fix the delete ran synchronously before the build,
|
|
342
|
+
// adding 5–15 s to the user's critical path on every cache rebuild.
|
|
343
|
+
// Post-fix we build the new cache first, swap the manifest pointer,
|
|
344
|
+
// return to the caller, and delete the old cache async (best-effort,
|
|
345
|
+
// retried) — the user's wait drops by the delete's full duration.
|
|
346
|
+
// Worst case on persistent delete failure: an orphaned cache lingers
|
|
347
|
+
// on Google's side until its TTL expires (~hours-to-day). Storage
|
|
348
|
+
// cost is bounded by `cacheTtlSeconds`. Documented in CHANGELOG.
|
|
349
|
+
const staleCacheIdForAsyncDelete = existing?.cacheId ?? null;
|
|
309
350
|
// 7) Build a new cache.
|
|
310
351
|
emitter.emit('building context cache…');
|
|
311
352
|
const fileContents = buildContentFromUploaded(uploaded.files);
|
|
@@ -338,6 +379,13 @@ async function doPrepareContext(opts) {
|
|
|
338
379
|
createdAt: existing?.createdAt ?? now,
|
|
339
380
|
updatedAt: afterCreateMs,
|
|
340
381
|
});
|
|
382
|
+
// v1.13.0 — fire-and-forget delete of the stale cache. Manifest already
|
|
383
|
+
// points at the new cacheId, so a delete failure is purely a Google-side
|
|
384
|
+
// orphan (auto-expires at TTL). 3× retry handles transient errors;
|
|
385
|
+
// permanent failure is logged at warn but doesn't surface to the caller.
|
|
386
|
+
if (staleCacheIdForAsyncDelete !== null) {
|
|
387
|
+
void bestEffortDeleteCache(client, staleCacheIdForAsyncDelete);
|
|
388
|
+
}
|
|
341
389
|
return {
|
|
342
390
|
cacheId,
|
|
343
391
|
cacheExpiresAt,
|
|
@@ -372,6 +420,38 @@ async function doPrepareContext(opts) {
|
|
|
372
420
|
};
|
|
373
421
|
}
|
|
374
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* Best-effort async delete of a stale cache after a successful rebuild
|
|
425
|
+
* (v1.13.0+). Retries 3× with exponential back-off (1 s, 3 s, 9 s) for
|
|
426
|
+
* transient errors. Logs at warn on permanent failure — orphaned caches
|
|
427
|
+
* auto-expire at Google's TTL so the worst case is bounded storage cost.
|
|
428
|
+
*
|
|
429
|
+
* Called as `void bestEffortDeleteCache(...)` so callers don't have to
|
|
430
|
+
* await; the manifest's `cacheId` pointer was already swapped to the new
|
|
431
|
+
* cache before this fires.
|
|
432
|
+
*/
|
|
433
|
+
async function bestEffortDeleteCache(client, cacheId) {
|
|
434
|
+
const delays = [1000, 3000, 9000];
|
|
435
|
+
for (let attempt = 0; attempt < delays.length; attempt += 1) {
|
|
436
|
+
try {
|
|
437
|
+
await client.caches.delete({ name: cacheId });
|
|
438
|
+
logger.debug(`async-deleted stale cache ${safeForLog(cacheId)} (attempt ${attempt + 1})`);
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
catch (err) {
|
|
442
|
+
// Retry transient errors; give up quickly on 4xx (cache already gone, perms, etc.)
|
|
443
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
444
|
+
const isTransient = !msg.includes('NOT_FOUND') && !msg.includes('PERMISSION_DENIED');
|
|
445
|
+
if (!isTransient || attempt === delays.length - 1) {
|
|
446
|
+
logger.warn(`async-delete of stale cache ${safeForLog(cacheId)} permanently failed (attempt ${attempt + 1}): ${safeForLog(msg)}. Orphan will auto-expire at TTL.`);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
const nextDelay = delays[attempt];
|
|
450
|
+
if (nextDelay !== undefined)
|
|
451
|
+
await new Promise((r) => setTimeout(r, nextDelay));
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
375
455
|
/**
|
|
376
456
|
* Hard-purge a workspace: delete the Gemini Context Cache, release every
|
|
377
457
|
* 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,kBAAkB,CAAC,UAAkB;IAC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@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { basename } from 'node:path';
|
|
17
17
|
import { logger, safeForLog } from '../utils/logger.js';
|
|
18
|
+
import { runPool } from '../utils/run-pool.js';
|
|
18
19
|
const FILES_API_TTL_MS = 47 * 3600 * 1000; // 1 h safety margin before 48 h auto-delete
|
|
19
20
|
/**
|
|
20
21
|
* Files are unsafe to reuse when Google is about to delete them. A cache build
|
|
@@ -38,33 +39,6 @@ const DEFAULT_UPLOAD_CONCURRENCY = 10;
|
|
|
38
39
|
function uploadMimeType(_relpath) {
|
|
39
40
|
return 'text/plain';
|
|
40
41
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Run `task` over `items` with up to `concurrency` in flight. Order of
|
|
43
|
-
* results matches order of items. Never throws — every failure is captured
|
|
44
|
-
* as a rejected `PromiseSettledResult` in the returned array.
|
|
45
|
-
*/
|
|
46
|
-
async function runPool(items, concurrency, task) {
|
|
47
|
-
const results = new Array(items.length);
|
|
48
|
-
let next = 0;
|
|
49
|
-
const workers = Array.from({ length: Math.max(1, Math.min(concurrency, items.length || 1)) }, async () => {
|
|
50
|
-
while (next < items.length) {
|
|
51
|
-
const i = next;
|
|
52
|
-
next += 1;
|
|
53
|
-
const item = items[i];
|
|
54
|
-
if (item === undefined)
|
|
55
|
-
continue;
|
|
56
|
-
try {
|
|
57
|
-
const value = await task(item, i);
|
|
58
|
-
results[i] = { status: 'fulfilled', value };
|
|
59
|
-
}
|
|
60
|
-
catch (err) {
|
|
61
|
-
results[i] = { status: 'rejected', reason: err };
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
await Promise.all(workers);
|
|
66
|
-
return results;
|
|
67
|
-
}
|
|
68
42
|
export async function uploadWorkspaceFiles(args) {
|
|
69
43
|
const { client, manifest, workspaceRoot, files, emitter } = args;
|
|
70
44
|
const concurrency = args.concurrency ?? DEFAULT_UPLOAD_CONCURRENCY;
|
|
@@ -75,6 +49,28 @@ export async function uploadWorkspaceFiles(args) {
|
|
|
75
49
|
let reusedCount = 0;
|
|
76
50
|
let completed = 0;
|
|
77
51
|
const failures = [];
|
|
52
|
+
// v1.13.0 progress-emit throttle. On a 500-file workspace, the previous
|
|
53
|
+
// per-file emit dispatched 500 MCP notifications inside ~3 s — most of
|
|
54
|
+
// them serialised over stdio for the same effective UI state ("X/500
|
|
55
|
+
// indexed"). Cap the emit cadence at ≥250 ms apart OR ≥25 files of
|
|
56
|
+
// progress, whichever comes first; ALWAYS emit the final completion so
|
|
57
|
+
// the progress UI doesn't hang at e.g. 475/500. Only the index
|
|
58
|
+
// notifications are throttled — abort/error events stay immediate.
|
|
59
|
+
const PROGRESS_EMIT_INTERVAL_MS = 250;
|
|
60
|
+
const PROGRESS_EMIT_FILE_STEP = 25;
|
|
61
|
+
let lastEmitTimeMs = 0;
|
|
62
|
+
let lastEmitCompleted = 0;
|
|
63
|
+
const emitProgress = (relpath) => {
|
|
64
|
+
const isFinal = completed === files.length;
|
|
65
|
+
const tNow = Date.now();
|
|
66
|
+
const stepReached = completed - lastEmitCompleted >= PROGRESS_EMIT_FILE_STEP;
|
|
67
|
+
const intervalReached = tNow - lastEmitTimeMs >= PROGRESS_EMIT_INTERVAL_MS;
|
|
68
|
+
if (!(isFinal || stepReached || intervalReached))
|
|
69
|
+
return;
|
|
70
|
+
lastEmitTimeMs = tNow;
|
|
71
|
+
lastEmitCompleted = completed;
|
|
72
|
+
emitter.emit(`indexed ${completed}/${files.length}: ${relpath}`, completed, files.length);
|
|
73
|
+
};
|
|
78
74
|
// Pre-flight: don't start the pool at all if abort already fired.
|
|
79
75
|
if (signal?.aborted) {
|
|
80
76
|
throw signal.reason instanceof Error
|
|
@@ -114,11 +110,13 @@ export async function uploadWorkspaceFiles(args) {
|
|
|
114
110
|
fileId: entry.existing.fileId,
|
|
115
111
|
uploadedAt: entry.existing.uploadedAt,
|
|
116
112
|
expiresAt: entry.existing.expiresAt,
|
|
113
|
+
mtimeMs: entry.file.mtimeMs,
|
|
114
|
+
size: entry.file.size,
|
|
117
115
|
};
|
|
118
116
|
manifest.upsertFile(row);
|
|
119
117
|
out[i] = row;
|
|
120
118
|
completed += 1;
|
|
121
|
-
|
|
119
|
+
emitProgress(entry.file.relpath);
|
|
122
120
|
return;
|
|
123
121
|
}
|
|
124
122
|
// Same-batch dedup: if another worker is already uploading this content hash,
|
|
@@ -158,25 +156,54 @@ export async function uploadWorkspaceFiles(args) {
|
|
|
158
156
|
fileId,
|
|
159
157
|
uploadedAt: now,
|
|
160
158
|
expiresAt: now + FILES_API_TTL_MS,
|
|
159
|
+
mtimeMs: entry.file.mtimeMs,
|
|
160
|
+
size: entry.file.size,
|
|
161
161
|
};
|
|
162
162
|
manifest.upsertFile(row);
|
|
163
163
|
out[i] = row;
|
|
164
164
|
if (isDuplicate)
|
|
165
165
|
reusedCount += 1;
|
|
166
166
|
completed += 1;
|
|
167
|
-
|
|
167
|
+
emitProgress(entry.file.relpath);
|
|
168
168
|
}).then((settled) => {
|
|
169
169
|
// Collect failures after the pool finishes — don't lose the mapping to files.
|
|
170
|
+
//
|
|
171
|
+
// v1.13.0 post-review (FN3, gemini P1): abort-induced rejections are NOT
|
|
172
|
+
// genuine upload failures — they're cooperative bail-outs from the per-task
|
|
173
|
+
// abort guard at the top of the worker. Treating them as "failed" pollutes
|
|
174
|
+
// stderr with N-completed warns AND inflates `failures`, both of which
|
|
175
|
+
// mislead the user before the post-pool re-throw at line ~246 surfaces the
|
|
176
|
+
// real `signal.reason` (typically a TimeoutError that maps to
|
|
177
|
+
// `errorCode: 'TIMEOUT'`). On a 400-file repo with concurrency 10 and an
|
|
178
|
+
// abort fired at completed=12, this could spew ~388 warn lines.
|
|
179
|
+
const aborted = signal?.aborted === true;
|
|
170
180
|
for (let i = 0; i < settled.length; i += 1) {
|
|
171
181
|
const r = settled[i];
|
|
172
182
|
const file = files[i];
|
|
173
183
|
if (r?.status === 'rejected' && file) {
|
|
174
|
-
const
|
|
184
|
+
const reason = r.reason;
|
|
185
|
+
if (aborted &&
|
|
186
|
+
(reason === signal?.reason || (reason instanceof Error && reason.name === 'AbortError'))) {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
const message = reason instanceof Error ? reason.message : String(reason);
|
|
175
190
|
logger.warn(`upload failed for ${safeForLog(file.relpath)}: ${safeForLog(message)}`);
|
|
176
191
|
failures.push({ relpath: file.relpath, error: message });
|
|
177
192
|
}
|
|
178
193
|
}
|
|
179
194
|
});
|
|
195
|
+
// v1.13.0 round-3 fix (Copilot finding): `emitProgress` only force-emits
|
|
196
|
+
// when `completed === files.length`, but `completed` only increments on
|
|
197
|
+
// task SUCCESS — a tail of failed uploads (rejections) leaves `completed
|
|
198
|
+
// < files.length`, the throttle's `isFinal` predicate never trips, and
|
|
199
|
+
// the last successful indexed-file message can stay buffered behind the
|
|
200
|
+
// 250 ms / 25-file gates indefinitely. UI hangs at e.g. 490/500 even
|
|
201
|
+
// though the operation is fully finished. Trailing flush guarantees the
|
|
202
|
+
// emitter sees the final true `completed` value.
|
|
203
|
+
if (completed > lastEmitCompleted) {
|
|
204
|
+
emitter.emit(`indexed ${completed}/${files.length}`, completed, files.length);
|
|
205
|
+
lastEmitCompleted = completed;
|
|
206
|
+
}
|
|
180
207
|
// Post-pool abort propagation (v1.12.1). `runPool` catches per-task
|
|
181
208
|
// errors and returns a settled-results array, so the in-task abort
|
|
182
209
|
// throw above just becomes "Upload failed for X" in `failures`. To
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files-uploader.js","sourceRoot":"","sources":["../../src/cache/files-uploader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKrC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"files-uploader.js","sourceRoot":"","sources":["../../src/cache/files-uploader.ts"],"names":[],"mappings":"AAAA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G;QAAE,IAAI,GAAG;YAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEpD,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,aAAa;QACb,WAAW;QACX,WAAW,EAAE,QAAQ,CAAC,MAAM;QAC5B,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -32,6 +32,17 @@ export interface Config {
|
|
|
32
32
|
* Controlled by `GEMINI_CODE_CONTEXT_FORCE_MAX_OUTPUT` env var.
|
|
33
33
|
*/
|
|
34
34
|
forceMaxOutputTokens: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* v1.13.0+: when `true`, every `ask` / `code` call bypasses the scan memo
|
|
37
|
+
* and re-hashes every file in the workspace. The scan memo (default
|
|
38
|
+
* behaviour) skips per-file SHA256 when `mtime_ms` and `size` match the
|
|
39
|
+
* previously-stored values — typically ~95% of files on a warm rescan.
|
|
40
|
+
* Per-call `input.forceRescan` is ORed with this flag; either one being
|
|
41
|
+
* `true` forces a fresh hash. Default `false`. Controlled by env var
|
|
42
|
+
* `GEMINI_CODE_CONTEXT_FORCE_RESCAN`. Use this if you've observed scan
|
|
43
|
+
* results going stale after filesystem mutations outside the dev workflow.
|
|
44
|
+
*/
|
|
45
|
+
forceRescan: boolean;
|
|
35
46
|
/**
|
|
36
47
|
* Client-side TPM (tokens-per-minute) throttle ceiling, per resolved model.
|
|
37
48
|
* `0` disables the throttle entirely; positive integer caps how many input
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,0BAA0B,CAAC;AAE1E,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,YAAY,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EA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