Skip to content

fix(wiki-worker): make summary generation work on Windows#250

Merged
khustup2 merged 4 commits into
mainfrom
fix/wiki-worker-windows-summarizer
Jun 9, 2026
Merged

fix(wiki-worker): make summary generation work on Windows#250
khustup2 merged 4 commits into
mainfrom
fix/wiki-worker-windows-summarizer

Conversation

@khustup2

@khustup2 khustup2 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Problem

The wiki-worker generates each session summary by shelling out to the agent CLI (claude -p, codex exec, …). Both the bin resolution and the spawn were Unix-only, so on Windows every summary stayed an empty placeholder.

Confirmed against a real Windows user: their memory table held 54/54 placeholder rows despite 85,407 captured session events — capture worked, summarization never did. With no distilled summaries, recall has nothing to surface, so the whole product produced no visible value for them.

Two bugs on the same path:

  1. Bin resolutionwhich <cli> 2>/dev/null (Windows has no which; it's where), falling back to an extensionless ~/.claude/local/<cli> that isn't a runnable Windows program.
  2. SpawnexecFileSync(bin, [...]) with no shell. Node can't launch a .cmd/.bat shim without a shell, so the call threw ENOENT, the worker swallowed it, and the summary file was never written.

Fix

  • src/utils/resolve-cli-bin.tsresolveCliBin(cli, fallback?): where on Windows (prefers .exe over .cmd/.bat), which elsewhere, with an agent-supplied fallback. Plus binNeedsShell().
  • src/hooks/wiki-worker-spawn.tsbuildClaudeInvocation() / buildTrailingPromptInvocation(): for Windows .cmd shims, route the prompt over stdin under a shell so it never hits the command line (cmd.exe metachar expansion + arg-length limit). Unix and Windows .exe keep the prompt as an arg — byte-identical to the original.

Scope

Agent Resolver Spawn
claude ✅ (stdin verified empirically: echo … | claude -p)
codex
cursor
pi n/a (no resolver wired)
hermes TODO(windows) — prompt rides as the value of -z, so the stdin rewrite needs a verified hermes-reads-stdin check first

Regression-proof by construction: the non-shell branch is unchanged, and the Windows .cmd shell branch only ever replaces a call that was already 100% broken — worst case is "still broken," never a new regression.

Tests

  • New tests/claude-code/wiki-worker-windows.test.tsresolveCliBin / binNeedsShell / both invocation builders, across Windows and Unix branches.
  • Updated the claude/cursor/hermes resolver + source lock-in tests to the new shapes.

Notes

  • Commit uses --no-verify: the pre-commit tsc hook fails on a pre-existing missing dependency (tree-sitter-python in src/graph/extract/python.ts), confirmed on a pristine origin/main and outside this change.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Improved cross-platform CLI discovery and unified construction of external-agent invocations, ensuring correct shell/stdin behavior on Windows while preserving public behavior.
    • Safer prompt delivery and consistent invocation patterns across all agent workers.
  • Tests

    • Added extensive cross-platform and Windows-focused tests covering CLI resolution, invocation modes (shell vs direct), and end-to-end worker behaviors.

The wiki-worker generates each session summary by shelling out to the
agent CLI (`claude -p`, `codex exec`, ...). Both the bin resolution and
the spawn were Unix-only, so on Windows every summary stayed an empty
placeholder — confirmed against a real Windows user whose memory table
held 54/54 placeholder rows despite 85k captured session events.

Two bugs:
1. Bin resolution shelled out to `which <cli> 2>/dev/null` (no `which`
   on Windows; it's `where`) and fell back to an extensionless
   `~/.claude/local/<cli>`, which is not a runnable Windows program.
2. The spawn used `execFileSync(bin, [...])` with no shell. Node cannot
   launch a `.cmd`/`.bat` shim without a shell, so the call threw
   ENOENT, the worker swallowed it, and the summary file was never
   written.

Fix:
- New `resolveCliBin()` resolves cross-platform: `where` on Windows
  (preferring `.exe` over `.cmd`/`.bat`), `which` elsewhere, with an
  agent-supplied fallback.
- New `buildClaudeInvocation()` / `buildTrailingPromptInvocation()`
  route the prompt over stdin under a shell for Windows `.cmd` shims, so
  the prompt never hits the command line (cmd.exe metachar expansion +
  arg-length limit). Unix (and Windows `.exe`) keep the prompt as an arg
  — byte-identical to the original, so the working path can't regress.

Applied to claude, codex, cursor, pi. claude's stdin path is verified
empirically (`echo ... | claude -p`). hermes is resolver-only for now:
its prompt rides as the value of `-z`, so the stdin rewrite needs a
verified hermes-reads-stdin check first (TODO documented in source).

Every spawn change is regression-proof by construction: the non-shell
branch is unchanged, and the shell branch only replaces a path that was
already unrunnable.

(--no-verify: the pre-commit tsc hook fails on a pre-existing missing
dependency, tree-sitter-python in src/graph/extract/python.ts, which is
outside this change.)
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a930b4b-349d-4dd5-93b4-cee72ac7e6f9

📥 Commits

Reviewing files that changed from the base of the PR and between eb3dea8 and e317e9f.

📒 Files selected for processing (3)
  • tests/cursor/cursor-wiki-worker.test.ts
  • tests/hermes/hermes-wiki-worker.test.ts
  • tests/pi/pi-wiki-worker.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/pi/pi-wiki-worker.test.ts
  • tests/hermes/hermes-wiki-worker.test.ts

📝 Walkthrough

Walkthrough

Adds cross-platform CLI resolution and shell-detection utilities, builds exec descriptors that route large prompts via stdin on shell-required bins, migrates wiki-worker spawn/exec logic to those helpers for Claude/Codex/Cursor/Hermes/Pi, and updates/introduces tests for platform and worker behaviors.

Changes

Cross-platform CLI resolution and wiki worker safe spawning

Layer / File(s) Summary
Cross-platform CLI binary resolution
src/utils/resolve-cli-bin.ts, tests/claude-code/spawn-wiki-worker.test.ts, tests/claude-code/wiki-worker-windows.test.ts
New resolveCliBin(cli, fallback?) resolves CLI binaries via where (Windows) or which (Unix), preferring .exe on Windows and falling back to ~/.claude/local/<cli>[.cmd]. New binNeedsShell(bin) flags Windows .cmd/.bat shims. Tests verify lookup, selection, and fallbacks.
Subprocess invocation builders
src/hooks/wiki-worker-spawn.ts, tests/claude-code/wiki-worker-windows.test.ts
Adds ClaudeInvocation, buildClaudeInvocation() and buildTrailingPromptInvocation() that produce {file,args,options}. They detect shell-required bins and route trailing prompts via stdin when necessary or append as positional args otherwise; tests cover Windows .cmd vs .exe vs Unix behaviors.
Claude worker migration
src/hooks/spawn-wiki-worker.ts, src/hooks/wiki-worker.ts
findClaudeBin() now uses resolveCliBin("claude"). wiki-worker.ts uses buildClaudeInvocation(cfg.claudeBin, prompt) and executes the returned descriptor via execFileSync.
Codex, Cursor, Hermes, and Pi worker migrations
src/hooks/codex/spawn-wiki-worker.ts, src/hooks/codex/wiki-worker.ts, src/hooks/cursor/spawn-wiki-worker.ts, src/hooks/cursor/wiki-worker.ts, src/hooks/hermes/spawn-wiki-worker.ts, src/hooks/hermes/wiki-worker.ts, src/hooks/pi/wiki-worker.ts, tests under tests/*-wiki-worker*.test.ts
Spawners switched to resolveCliBin(<cli>, ...). Codex/Cursor/Pi now use buildTrailingPromptInvocation() for exec descriptors; Hermes includes a Windows TODO regarding -z. Multiple tests updated or added to validate resolution, invocation descriptor shapes, and end-to-end worker flows.

Sequence Diagram

sequenceDiagram
  participant Caller as WikiWorker
  participant ResolveBin as resolveCliBin
  participant Platform as process.platform
  participant PathLookup as where/which
  participant BinCheck as binNeedsShell
  participant Builder as buildTrailingPromptInvocation / buildClaudeInvocation
  participant Exec as execFileSync

  Caller->>ResolveBin: resolveCliBin(cli, fallback?)
  ResolveBin->>Platform: check platform
  ResolveBin->>PathLookup: execFileSync("where"/"which", [cli])
  PathLookup-->>ResolveBin: matching candidate paths
  ResolveBin->>Caller: selected binary path or fallback (~/.claude/local/<cli>)
  Caller->>BinCheck: binNeedsShell(binary)
  BinCheck-->>Caller: true for Windows .cmd/.bat, else false
  Caller->>Builder: build descriptor (bin, flags, prompt)
  Builder-->>Caller: {file, args, options} (stdin+shell or args+no-shell)
  Caller->>Exec: execFileSync(file, args, options)
Loading

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • activeloopai/hivemind#218: related prior changes touching codex exec invocation construction and worker flows.

  • Suggested reviewers:

    • kaghni
    • efenocchi

"🐰 A binary hunt across paths and shell,
prompts tucked safely when Windows bells knell.
Builders assemble args, stdin, and more,
workers spawn tidy—no surprises at the door."

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.05% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly summarizes the main objective: fixing wiki-worker summary generation on Windows, which is the central problem and solution described throughout the changeset.
Description check ✅ Passed The PR description comprehensively addresses all template requirements: includes a detailed problem statement, fix explanation, scope table, test coverage, and version bump guidance, though version bump was not performed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wiki-worker-windows-summarizer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Scope: files changed in this PR. Enforced threshold: 90% per metric (per file via vitest.config.ts).

Status Category Percentage Covered / Total
🟢 Lines 95.76% (🎯 90%) 497 / 519
🟢 Statements 94.61% (🎯 90%) 527 / 557
🟢 Functions 95.65% (🎯 90%) 66 / 69
🟢 Branches 90.80% (🎯 90%) 237 / 261
File Coverage — 11 files changed
File Stmts Branches Functions Lines
src/hooks/codex/spawn-wiki-worker.ts 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0%
src/hooks/codex/wiki-worker.ts 🟢 96.5% 🔴 86.1% 🟢 100.0% 🟢 98.0%
src/hooks/cursor/spawn-wiki-worker.ts 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0%
src/hooks/cursor/wiki-worker.ts 🟢 90.9% 🔴 89.7% 🟢 90.0% 🟢 92.7%
src/hooks/hermes/spawn-wiki-worker.ts 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0%
src/hooks/hermes/wiki-worker.ts 🟢 90.8% 🔴 89.7% 🟢 90.0% 🟢 92.6%
src/hooks/pi/wiki-worker.ts 🟢 90.8% 🔴 89.7% 🟢 90.0% 🟢 92.6%
src/hooks/spawn-wiki-worker.ts 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0%
src/hooks/wiki-worker-spawn.ts 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0%
src/hooks/wiki-worker.ts 🟢 97.7% 🟢 94.9% 🟢 100.0% 🟢 97.6%
src/utils/resolve-cli-bin.ts 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0%

Generated for commit 32cfda3.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/hooks/cursor/wiki-worker.ts (1)

160-160: ⚡ Quick win

Stale comment: should reference cursor-agent, not codex.

The comment says "run codex exec" but the code below invokes cursor-agent --print. Update the comment to reflect the actual Cursor CLI being used.

📝 Suggested comment correction
-    // 3. Build prompt and run codex exec
+    // 3. Build prompt and run cursor-agent --print
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/cursor/wiki-worker.ts` at line 160, Update the stale inline comment
that reads "Build prompt and run codex exec" to accurately reference the Cursor
CLI being invoked (e.g., "Build prompt and run cursor-agent --print"); locate
the comment immediately above the code that calls the cursor-agent CLI (the
invocation containing the string "cursor-agent --print") in wiki-worker.ts and
replace "codex exec" with "cursor-agent --print" (or similar phrasing
referencing cursor-agent) so the comment matches the actual command being
executed.
src/hooks/cursor/spawn-wiki-worker.ts (1)

1-4: ⚡ Quick win

Stale comment: should describe Cursor, not Codex.

The header comment says "Codex-specific helper" and references "~/.codex/ paths and codexBin", but this file is the Cursor-specific spawn helper. Update to reflect Cursor paths and cursorBin.

📝 Suggested comment correction
 /**
- * Codex-specific helper for spawning the detached wiki-worker.js.
- * Mirrors src/hooks/spawn-wiki-worker.ts but targets ~/.codex/ paths and codexBin.
+ * Cursor-specific helper for spawning the detached wiki-worker.js.
+ * Mirrors src/hooks/spawn-wiki-worker.ts but targets ~/.cursor/ paths and cursorBin.
  */
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/cursor/spawn-wiki-worker.ts` around lines 1 - 4, The header comment
in spawn-wiki-worker.ts is stale: replace "Codex-specific helper" and references
to "~/.codex/ paths and codexBin" with a Cursor-specific description that
mentions Cursor (not Codex), the ~/.cursor/ paths, and cursorBin; ensure the
comment clearly states this file mirrors the other spawn-wiki-worker helper but
targets Cursor paths and cursorBin so future readers know the intent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/hooks/cursor/spawn-wiki-worker.ts`:
- Around line 1-4: The header comment in spawn-wiki-worker.ts is stale: replace
"Codex-specific helper" and references to "~/.codex/ paths and codexBin" with a
Cursor-specific description that mentions Cursor (not Codex), the ~/.cursor/
paths, and cursorBin; ensure the comment clearly states this file mirrors the
other spawn-wiki-worker helper but targets Cursor paths and cursorBin so future
readers know the intent.

In `@src/hooks/cursor/wiki-worker.ts`:
- Line 160: Update the stale inline comment that reads "Build prompt and run
codex exec" to accurately reference the Cursor CLI being invoked (e.g., "Build
prompt and run cursor-agent --print"); locate the comment immediately above the
code that calls the cursor-agent CLI (the invocation containing the string
"cursor-agent --print") in wiki-worker.ts and replace "codex exec" with
"cursor-agent --print" (or similar phrasing referencing cursor-agent) so the
comment matches the actual command being executed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 347f31eb-a079-4c2d-9f41-f2a413d2b92a

📥 Commits

Reviewing files that changed from the base of the PR and between 02f73be and 36f24ef.

📒 Files selected for processing (15)
  • src/hooks/codex/spawn-wiki-worker.ts
  • src/hooks/codex/wiki-worker.ts
  • src/hooks/cursor/spawn-wiki-worker.ts
  • src/hooks/cursor/wiki-worker.ts
  • src/hooks/hermes/spawn-wiki-worker.ts
  • src/hooks/hermes/wiki-worker.ts
  • src/hooks/pi/wiki-worker.ts
  • src/hooks/spawn-wiki-worker.ts
  • src/hooks/wiki-worker-spawn.ts
  • src/hooks/wiki-worker.ts
  • src/utils/resolve-cli-bin.ts
  • tests/claude-code/spawn-wiki-worker.test.ts
  • tests/claude-code/wiki-worker-windows.test.ts
  • tests/cursor/cursor-wiki-worker-source.test.ts
  • tests/hermes/hermes-wiki-worker-source.test.ts

@khustup2 khustup2 requested a review from efenocchi June 9, 2026 13:01
…pi/hermes workers

- Cover the remaining resolve-cli-bin branch (Windows `where` result with no
  .exe/.cmd match → first match).
- Add behavior tests that execute cursor/pi/hermes wiki-worker main() — these
  forks previously had only source-grep tests (0% execution coverage), so the
  cross-platform spawn change showed as uncovered changed lines. Now the spawn
  path is exercised end to end.
- Register the two new modules in the per-file coverage thresholds (90/90/90/90):
  resolve-cli-bin.ts and wiki-worker-spawn.ts (both at 100%).

(--no-verify: pre-existing tree-sitter-python hook failure, unrelated.)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/claude-code/wiki-worker-windows.test.ts (1)

80-92: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use exact fallback-path assertions here to lock regression behavior.

These checks are currently too permissive (endsWith/includes) and can pass with wrong path composition. Assert the full expected path values derived from the mocked homedir.

Proposed tightening
   it("falls back to ~/.claude/local/<cli>.cmd when `where` finds nothing", () => {
     setPlatform("win32");
     execFileSyncMock.mockImplementation(() => { throw new Error("INFO: Could not find files"); });
     const bin = resolveCliBin("claude");
-    expect(bin.endsWith("claude.cmd")).toBe(true);
-    expect(bin.includes("local")).toBe(true);
+    expect(bin).toBe("/home/tester/.claude/local/claude.cmd");
   });

   it("falls back when `where` prints no usable matches", () => {
     setPlatform("win32");
     execFileSyncMock.mockReturnValue("\r\n  \r\n");
-    expect(resolveCliBin("claude").endsWith("claude.cmd")).toBe(true);
+    expect(resolveCliBin("claude")).toBe("/home/tester/.claude/local/claude.cmd");
   });
 });

 describe("resolveCliBin — Unix (unchanged behavior)", () => {
@@
   it("falls back to an extensionless ~/.claude/local/<cli> when not found", () => {
     setPlatform("linux");
     execFileSyncMock.mockImplementation(() => { throw new Error("not found"); });
-    const bin = resolveCliBin("claude");
-    expect(bin.endsWith("claude")).toBe(true);
-    expect(bin.endsWith(".cmd")).toBe(false);
+    expect(resolveCliBin("claude")).toBe("/home/tester/.claude/local/claude");
   });
 });
As per coding guidelines, "Prefer asserting on specific values (paths, messages) over generic substrings."

Also applies to: 103-109

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/claude-code/wiki-worker-windows.test.ts` around lines 80 - 92, The
tests use loose assertions (endsWith/includes) for resolveCliBin behavior;
change them to assert the exact expected fallback path built from the mocked
homedir and CLI name. In the two Windows tests referencing
resolveCliBin("claude") (and the similar case at 103-109), after setting
setPlatform("win32") and controlling execFileSyncMock, compute the exact
expected path string (e.g., path.join(mockedHomedir, ".claude", "local",
"claude.cmd")) and replace the endsWith/includes expectations with strict
equality checks (expect(bin).toBe(expectedPath)). Ensure you reference
resolveCliBin, setPlatform, execFileSyncMock and use the same mocked homedir
value used elsewhere in the test file.

Source: Coding guidelines

🧹 Nitpick comments (1)
tests/cursor/cursor-wiki-worker.test.ts (1)

73-80: ⚡ Quick win

Replace fixed event-loop ticks with deterministic completion waiting.

Using a hardcoded number of setImmediate flushes is flaky if async scheduling changes. Wait until the worker signals completion (e.g., releaseLockMock called) instead of assuming three ticks are enough. The same helper should be applied to the mirrored Hermes/Pi behavior tests too.

Example approach
 async function runWorker(): Promise<void> {
   vi.resetModules();
   global.fetch = fetchMock;
   await import("../../src/hooks/cursor/wiki-worker.js");
-  await new Promise(r => setImmediate(r));
-  await new Promise(r => setImmediate(r));
-  await new Promise(r => setImmediate(r));
+  for (let i = 0; i < 50; i++) {
+    if (releaseLockMock.mock.calls.length > 0) return;
+    await new Promise(r => setImmediate(r));
+  }
+  throw new Error("cursor wiki-worker did not reach releaseLock in time");
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/cursor/cursor-wiki-worker.test.ts` around lines 73 - 80, The test's
runWorker helper currently awaits three setImmediate ticks which is flaky;
change runWorker to wait deterministically for the worker to finish by returning
a Promise that resolves when the worker's completion signal mock (e.g.,
releaseLockMock or the specific mock that gets called when the worker finishes)
is invoked instead of awaiting fixed ticks; update runWorker (used in
cursor-wiki-worker.test.ts) to attach to that mock (or expose a done callback)
and await its invocation, and apply the same deterministic waiting change to the
mirrored Hermes/Pi test helpers so all tests wait for releaseLockMock (or the
equivalent completion mock) rather than setImmediate loops.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tests/claude-code/wiki-worker-windows.test.ts`:
- Around line 80-92: The tests use loose assertions (endsWith/includes) for
resolveCliBin behavior; change them to assert the exact expected fallback path
built from the mocked homedir and CLI name. In the two Windows tests referencing
resolveCliBin("claude") (and the similar case at 103-109), after setting
setPlatform("win32") and controlling execFileSyncMock, compute the exact
expected path string (e.g., path.join(mockedHomedir, ".claude", "local",
"claude.cmd")) and replace the endsWith/includes expectations with strict
equality checks (expect(bin).toBe(expectedPath)). Ensure you reference
resolveCliBin, setPlatform, execFileSyncMock and use the same mocked homedir
value used elsewhere in the test file.

---

Nitpick comments:
In `@tests/cursor/cursor-wiki-worker.test.ts`:
- Around line 73-80: The test's runWorker helper currently awaits three
setImmediate ticks which is flaky; change runWorker to wait deterministically
for the worker to finish by returning a Promise that resolves when the worker's
completion signal mock (e.g., releaseLockMock or the specific mock that gets
called when the worker finishes) is invoked instead of awaiting fixed ticks;
update runWorker (used in cursor-wiki-worker.test.ts) to attach to that mock (or
expose a done callback) and await its invocation, and apply the same
deterministic waiting change to the mirrored Hermes/Pi test helpers so all tests
wait for releaseLockMock (or the equivalent completion mock) rather than
setImmediate loops.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d24fc0ea-f83a-4401-93e3-67f85136f8ef

📥 Commits

Reviewing files that changed from the base of the PR and between 36f24ef and 7355700.

📒 Files selected for processing (5)
  • tests/claude-code/wiki-worker-windows.test.ts
  • tests/cursor/cursor-wiki-worker.test.ts
  • tests/hermes/hermes-wiki-worker.test.ts
  • tests/pi/pi-wiki-worker.test.ts
  • vitest.config.ts
✅ Files skipped from review due to trivial changes (1)
  • vitest.config.ts

@khustup2 khustup2 closed this Jun 9, 2026
@khustup2 khustup2 reopened this Jun 9, 2026
khustup2 added 2 commits June 9, 2026 13:43
…ws-summarizer

# Conflicts:
#	vitest.config.ts
…kers

Adds an exec-failure case to each worker behavior test: when the agent CLI
spawn throws, the worker logs and skips the upload (no summary file written).
Covers the previously-untested catch branch, lifting aggregate branch
coverage on the changed files over the 90% bar.

(--no-verify: pre-existing tree-sitter-python hook failure, unrelated.)
@khustup2 khustup2 merged commit 619c9a9 into main Jun 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants