@qmediat.io/gemini-code-context-mcp 1.7.0 → 1.7.3
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 +54 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,60 @@ 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.7.3] - 2026-04-26
|
|
9
|
+
|
|
10
|
+
### Fixed — /6step adversarial follow-ups on the v1.7.2 fakes-timer cascade fix
|
|
11
|
+
|
|
12
|
+
A post-merge `/6step` audit on the v1.7.2 changes surfaced two MEDIUM and four LOW residual issues. None gated v1.7.2's empirical validation (release.yml ran end-to-end in 49 s on the post-fix tag), but each represented a latent regression risk. v1.7.3 closes them as a single hardening patch.
|
|
13
|
+
|
|
14
|
+
- **`test/unit/abort-timeout.test.ts` — file-level `afterEach` hoisted (Finding #1, MEDIUM).** The first describe (`createTimeoutController`) had `afterEach(() => { vi.unstubAllEnvs(); vi.useRealTimers(); })` scoped inside it; the third describe (`abortableSleep`) called `vi.useFakeTimers()` in three tests with NO matching cleanup hook. Today this was masked because `abortableSleep` is the last describe in the file (no downstream tests to cascade into), but a future contributor appending a real-timer describe BELOW it would have re-introduced the same v1.7.2 deadlock pattern in a different file. The hook is now at file top level, applies to every test in the file, and includes `vi.clearAllTimers()` for queue hygiene.
|
|
15
|
+
- **`test/unit/ask-agentic.test.ts` — `vi.clearAllTimers()` added to the file-level `afterEach` (Finding #2, LOW defense-in-depth).** v1.7.2's hook called only `vi.useRealTimers()`, which reverts the global swap but does not drop pending fake-timer queue entries. A future test calling `vi.useFakeTimers()` after a leaky earlier test could have inherited stale entries (vitest's behaviour around lingering fake-timer state is implementation-defined). Order matters: `clearAllTimers` first (against the still-fake global), then `useRealTimers` swap.
|
|
16
|
+
- **`test/unit/ask-agentic.test.ts` — top-of-file fake-timer hazard comment block (Finding #6, MEDIUM).** The v1.7.2 root-cause documentation lived inline in `:592`'s body, easy to miss. New contributors adding tests have no obvious signal that mixing `vi.useFakeTimers()` with `await askAgenticTool.execute(...)` is structurally broken. v1.7.3 hoists the warning to the file's module docstring with the full race timeline (1-5) and a positive guidance section (where fake timers ARE appropriate: `gemini-retry.test.ts`, `abort-timeout.test.ts` — i.e. tests that don't sit downstream of the `realpath` I/O).
|
|
17
|
+
- **`test/unit/ask-agentic.test.ts` — `mkdtempSync` cleanup added to `afterEach` (Finding #7, LOW housekeeping).** 23 tests in this file create `gcctx-askagent-*` directories under `tmpdir()` and never clean them. CI runners are ephemeral so production impact is zero, but developer machines accumulate the dirs forever. v1.7.3 adds a scan-and-cleanup pass in `afterEach` that sweeps the prefix. The pattern is single-file scope: the other 14 test files using `mkdtempSync` (74 call sites total across the repo) retain the existing behaviour — same justification (ephemeral runners), but lower-priority for now.
|
|
18
|
+
- **Inline coupling note next to `expect(generateContent).toHaveBeenCalledTimes(3)` (Finding #8, LOW).** The assertion is implicitly tied to `withNetworkRetry`'s default `attempts: 3` in `src/gemini/retry.ts:112`. v1.7.3 adds a one-line comment near the assertion citing the source file:line so a future change to the retry default surfaces a clear test-update path instead of a confusing failure.
|
|
19
|
+
- **CHANGELOG `[1.7.2]` disk-queue hypothesis flagged as inferential (Finding #9, LOW).** The v1.7.2 narrative attributed the run #2 failure to "the post-build hot disk-write queue slowed `realpath`" — a plausible model consistent with all observations (3-tool consult convergence + 121.65 s ≈ 4 × 30 s + post-fix 49 s success), but never directly measured. v1.7.3 adds a one-line caveat in `[1.7.2]` Notes acknowledging the hypothesis was inferential, not benchmarked. The fix itself stands; only the explanatory model is hedged.
|
|
20
|
+
|
|
21
|
+
### Defense-in-depth NOT taken (deliberate)
|
|
22
|
+
|
|
23
|
+
- **No regression test that fails if the `afterEach` hook is removed.** Such a test would amount to "test that vitest's afterEach hooks fire" — borderline tautological, and vitest itself tests its own lifecycle. The strengthened comment block above (citing this CHANGELOG entry directly) is the chosen guard. (/6step Finding #4)
|
|
24
|
+
- **`>= 950 ms` lower bound retained.** 5 % slack is empirically sufficient (50 ms > Windows's 15.6 ms timer precision worst case) and semantically meaningful (rejects "instant resolve from misfired guard" while tolerating real timer noise). Dropping to `>= 900` for additional headroom has marginal value. (/6step Finding #3)
|
|
25
|
+
|
|
26
|
+
### Notes
|
|
27
|
+
|
|
28
|
+
- Zero production-code change. `src/` is byte-identical to v1.7.2 modulo the version bump in `package.json` + `server.json`.
|
|
29
|
+
- Empirical validation on the same path that v1.7.2's release.yml exercised: local double-`npm test` clean, lint clean, typecheck clean, build clean, `release.yml` will fire on the v1.7.3 tag and exercise the prior-deadlock-prone double-test scenario again.
|
|
30
|
+
|
|
31
|
+
## [1.7.2] - 2026-04-26
|
|
32
|
+
|
|
33
|
+
### Fixed — release pipeline reliability (true root cause)
|
|
34
|
+
|
|
35
|
+
- **`test/unit/ask-agentic.test.ts:592` rewritten to use real timers.** The pre-existing fake-timer implementation (added in v1.5.1, `bdd2b3f`) had a latent race condition that finally triggered intermittent CI deadlocks on second-run-in-same-job invocations:
|
|
36
|
+
- The test called `vi.useFakeTimers()` then `await askAgenticTool.execute(…)`. Inside `execute`, `await resolveWorkspaceRoot(…)` calls `fs.promises.realpath` (`src/tools/agentic/sandbox.ts:155`) — libuv thread-pool I/O that is **not** observable by `vi.advanceTimersByTimeAsync` (which only drains the microtask queue).
|
|
37
|
+
- Sequence on a slow disk: `advanceTimersByTimeAsync(1_000)` and `(3_000)` returned BEFORE realpath resolved. When realpath finally resolved, `withNetworkRetry` (`src/gemini/retry.ts:141`) registered `setTimeout(1000)` for backoff — but this timer was queued AFTER the fake clock already advanced past it. With fake timers active, that setTimeout never fired again. The test hung to the 30 s ceiling. Its `finally { vi.useRealTimers() }` block never ran (because the awaited promise never settled), so **fake timers stayed active globally for the worker**.
|
|
38
|
+
- Cascade: vitest runs all tests of one file in the same worker. The next three tests in this file (`:748`, `:794`, `:853` — the F2 / F3 / end-to-end real-timer assertions added in v1.6.0 + v1.7.0) all rely on a real `setTimeout` firing inside `createTimeoutController` (`src/tools/shared/abort-timeout.ts:82`). With the global hijacked, their timers never fired either. Each ate the full 30 s timeout — observed total in CI: 121.65 s, exactly `4 × 30 s + ~1.65 s overhead`.
|
|
39
|
+
- Trigger of the race in CI run #2 specifically: the explicit `Unit tests` step ran first cleanly. Then `npm run build` wrote ~160 files to `dist/`. Then `npm publish` triggered `prepublishOnly` which re-ran the full test suite. The post-build hot disk-write queue slowed `realpath` on the test's `tmpdir`-fresh directory, widening the race window enough to lose. Run #1 had a cold queue and won the race. Local macOS APFS is fast enough to win every time. `ci.yml` runs the suite once so never sees the second-run path.
|
|
40
|
+
- **Why v1.5.x didn't surface this:** the v1.6.0 + v1.7.0 fixes did not introduce the race — they introduced the *witnesses* (real-timer tests that get cascade-killed once the fake-timer global leaks). Before those, fake-timer leakage from `:592` was invisible because no later test in the same file depended on a real `setTimeout` firing.
|
|
41
|
+
- **Defense-in-depth: file-level `afterEach(() => vi.useRealTimers())` added** to `ask-agentic.test.ts`. Future tests that call `vi.useFakeTimers()` and fail to clean up cannot poison subsequent tests in the file. The cascade pattern (one failing fake-timer test deadlocks the next N real-timer tests) is now structurally impossible.
|
|
42
|
+
- **Timer-precision lower bounds in `:748` / `:794` / `:853` relaxed by ~5 %.** Once the cascade was fixed and these three tests actually ran (vs deadlocking), a second latent flake surfaced on Node 22 / Linux: `expect(elapsedMs).toBeGreaterThanOrEqual(1_000)` failed at `999ms`. Node's `setTimeout(fn, 1_000)` is documented as "approximately 1000ms" and can fire 1-2 ms early due to clock-source quantisation between `Date.now()` and the timer's internal monotonic clock. Lower bounds raised to `>= 950` (and `>= 1_450` for the F2 1500ms case) — generous enough to absorb timer imprecision, tight enough to still catch a misfired guard that returns instantly. Same intent, more portable.
|
|
43
|
+
|
|
44
|
+
### Why this is the root cause, not a band-aid
|
|
45
|
+
|
|
46
|
+
- An earlier alternative considered passing `--ignore-scripts` to `npm publish` in `release.yml` to skip the `prepublishOnly` re-run. That would have masked the test bug while leaving local `npm publish` invocations exposed to the same deadlock. The current fix removes the underlying race; `release.yml` runs the test suite twice cleanly without any flag changes.
|
|
47
|
+
- v1.7.1 (`testTimeout` 10 s → 30 s) was a partial fix that addressed run #1 only — the timeout was correctly raised so the first invocation no longer flaked, but the second-run race was unaffected. v1.7.2 closes the remaining gap.
|
|
48
|
+
|
|
49
|
+
### Notes
|
|
50
|
+
|
|
51
|
+
- Zero runtime change vs v1.7.1 / v1.7.0. Production code (`src/`) is byte-identical except for the version-string bumps in `package.json` + `server.json`.
|
|
52
|
+
- v1.7.1 was never published to npm — its `release.yml` run failed at `Publish to npm` because of the cascade described above. Users see latest = 1.7.0 (no provenance) before this release; latest = 1.7.2 (provenance-signed) after.
|
|
53
|
+
- The "post-build hot disk-write queue slows `realpath`" model in the trigger paragraph above is the best explanation consistent with all available evidence (3-way consult convergence, 121.65 s ≈ 4 × 30 s timing signature, post-fix 49 s release.yml success), but it was NOT directly benchmarked. If a future incident challenges the model, the FIX still holds (race removed, defense-in-depth in place); only the explanatory narrative would need revising. Flagged in v1.7.3 `/6step` Finding #9.
|
|
54
|
+
|
|
55
|
+
## [1.7.1] - 2026-04-26 (NEVER PUBLISHED — same root cause it was meant to address; superseded by v1.7.2)
|
|
56
|
+
|
|
57
|
+
### Fixed — release pipeline reliability (partial — completed in v1.7.2)
|
|
58
|
+
|
|
59
|
+
- **`vitest.config.ts` `testTimeout` raised from 10 s to 30 s.** Fixed run #1 of the test suite in `release.yml` (the explicit `Unit tests` step). Did not address the run #2 (`prepublishOnly`) deadlock — which v1.7.2 traced to a fake-timer race in `ask-agentic.test.ts:592` rather than an undersized timeout. Kept in 1.7.2 for headroom on slower runners.
|
|
60
|
+
- **Removed three redundant per-test `}, 10_000)` overrides** in `ask-agentic.test.ts` so the affected tests inherit the new 30 s global.
|
|
61
|
+
|
|
8
62
|
## [1.7.0] - 2026-04-25
|
|
9
63
|
|
|
10
64
|
### Added — T20 streaming heartbeat for `ask` / `code`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qmediat.io/gemini-code-context-mcp",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"mcpName": "io.github.qmediat/gemini-code-context-mcp",
|
|
5
5
|
"description": "MCP server that gives Claude Code persistent memory of your codebase, backed by Gemini's 2M-token context. Includes eager `ask`/`code` for cached repo Q&A and `ask_agentic` for agentic file access on repos that exceed the model's input-token limit.",
|
|
6
6
|
"keywords": [
|