Skip to content

fix(daemon): stopping a daemon ends its version check's npm view - #1886

Merged
V3RON merged 2 commits into
mainfrom
bug/1852
Nov 26, 2026
Merged

V3RON merged 2 commits into
mainfrom
bug/1852

Conversation

@V3RON

@V3RON V3RON commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1852

Status

Implement: done (1/1 green) Review: round 1 passed, 0 findings Hardware: n/a Gate: running
Next: gate

  • Stopping a worker or a gateway ends the npm view its version check is still waiting on — src/daemon/main-update.test.ts passes for both roles; the audit removed controller.abort() and the test failed on ended: false

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 1 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 1. Tokens: 1.8M.
Runs: 6. Cost USD: 1.3526. Agent seconds: 775.

Assessment: complete

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The version check now passes an abort signal to the npm CLI. Disposing the version check aborts that signal. NodeNpmCli forwards a provided signal to the process runner. Tests verify that stopping either the worker or gateway daemon aborts a pending npm process run.

Suggested reviewers: leonardoxr

Severity of issue fixed: Low

Merge Risk: Minimal · up to ca510

Stopping a daemon now cancels its pending version-check npm process, which addresses the flaky Windows cleanup failure. No merge-blocking risk was found.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Issue #1852 requires the flaky gateway-fleet e2e test to stop failing with EBUSY during worker temp folder cleanup on Windows. The PR adds an AbortController signal to the version-check npm view (src/… Provide evidence that gateway-fleet.e2e.test.ts passes on Windows with this PR applied, for example a CI run on the reviewed head. Alternatively, show that dispose() releases the npm process and its folder handles before the test cleanup ru…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the change: stopping a daemon now ends the npm view run that its version check is waiting on. The diff adds an AbortSignal to startVersionCheck and to the npm view path, and the new te…
Description check Passed The description relates directly to the changeset. It names the test file src/daemon/main-update.test.ts, states that stopping a worker or gateway ends the npm view its version check waits on, and men…
Out of Scope Changes check Passed The PR changes three files: src/daemon/version-check.ts, src/ports/npm-cli.ts, and src/daemon/main-update.test.ts. The version-check change passes an AbortSignal to npm.view and aborts it in dispose()…
Full details: Title check

Explanation

The title names the change: stopping a daemon now ends the npm view run that its version check is waiting on. The diff adds an AbortSignal to startVersionCheck and to the npm view path, and the new test covers stopping worker and gateway daemons. The title follows the conventional commit style and is specific. It is 64 characters, within a normal range.

Full details: Description check

Explanation

The description relates directly to the changeset. It names the test file src/daemon/main-update.test.ts, states that stopping a worker or gateway ends the npm view its version check waits on, and mentions removing controller.abort() during the audit. It also references issue #1852 and includes review and status notes.

Full details: Out of Scope Changes check

Explanation

The PR changes three files: src/daemon/version-check.ts, src/ports/npm-cli.ts, and src/daemon/main-update.test.ts. The version-check change passes an AbortSignal to npm.view and aborts it in dispose(). The npm-cli port change adds an optional signal parameter to NpmCli.view, FakeNpmCli.view, and NodeNpmCli.view, and forwards it to the process runner. The test change covers worker and gateway stop behavior for that abort. All three changes connect directly to the stop-time abort mechanism that the PR describes as the fix for #1852. No unrelated behavior change appears in the summary. Version parsing, warning, and timer behavior are unchanged.

Full details: Linked Issues check

Explanation

Issue #1852 requires the flaky gateway-fleet e2e test to stop failing with EBUSY during worker temp folder cleanup on Windows. The PR adds an AbortController signal to the version-check npm view (src/daemon/version-check.ts, src/ports/npm-cli.ts) and a test in src/daemon/main-update.test.ts. That test checks that stopping a worker or gateway aborts the npm process run. The PR states this fixes the cleanup failure. The code evidence supports the abort behavior. It does not establish the EBUSY fix. The author did not run the Windows e2e test. The reviewer note states that dispose() aborts npm view but does not wait for the child process to exit. The folder lock can therefore persist after dispose() returns, so the cleanup race may remain. The test in gateway-fleet.e2e.test.ts is not changed by this PR. Whether the failing test passes is unknown from the available evidence.

Resolution

Provide evidence that gateway-fleet.e2e.test.ts passes on Windows with this PR applied, for example a CI run on the reviewed head. Alternatively, show that dispose() releases the npm process and its folder handles before the test cleanup runs, for example by awaiting child process exit. Then reassess.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: c2541292-80ee-4458-9a45-952660ad6260
Commits

Reviewing files that changed from the base of the PR and between c550e87 and ca51051.

Files selected for processing: 3

  • src/daemon/main-update.test.ts
  • src/daemon/version-check.ts
  • src/ports/npm-cli.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@V3RON

V3RON commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: ca51051

Runs: 6. Cost USD: 1.3526. Agent seconds: 775.
Tokens input 107, output 20049, cache read 2066683, cache write 259262.
- build implementer: claude-sonnet-5-5 156 s $0.1837
- audit implementer: claude-sonnet-5-5 38 s $0.143
- review 1 reviewer: claude-sonnet-5-5 323 s $0.2254
- review 1 spec: claude-sonnet-5-5 12 s $0.1026
- review 1 code behaviour: claude-opus-5-5 234 s $0.5943
- review 1 claims: claude-sonnet-5-5 12 s $0.1036
Finding outcomes: {}. Classes: {}.
{"findings":[]}

Written by an agent.

@V3RON

V3RON commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • code: src/daemon/version-check.ts:50 dispose aborts the npm view but does not wait for the child to exit; harmless, the runner kills it with SIGKILL and the fleet test retries the folder removal for 25 s.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 26, 2026 17:11
@V3RON
V3RON merged commit 72c8ec6 into main Nov 26, 2026
89 checks passed
@V3RON
V3RON deleted the bug/1852 branch November 26, 2026 17:16
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.

flaky: gateway-fleet e2e on Windows fails cleanup with EBUSY on a worker temp folder

1 participant