Skip to content

fix(server): skip killing completed provider updates - #6284

Open
mitosky07 wants to merge 2 commits into
pingdotgg:mainfrom
mitosky07:fix/windows-skip-finished-provider-kill
Open

fix(server): skip killing completed provider updates#6284
mitosky07 wants to merge 2 commits into
pingdotgg:mainfrom
mitosky07:fix/windows-skip-finished-provider-kill

Conversation

@mitosky07

@mitosky07 mitosky07 commented Aug 12, 2026

Copy link
Copy Markdown

What changed

  • Check whether a provider update process is still running before killing it during cleanup.
  • Add a regression test for completed updates.

Why

Completed provider updates were still sent a kill request when their scope closed. On Windows this can invoke taskkill through cmd.exe and briefly flash a console window.

This keeps cleanup for running processes while skipping the redundant kill after a successful exit. Related to #2537.

Testing

  • vp test run apps/server/src/provider/providerMaintenanceRunner.test.ts (12 passed)
  • vp lint apps/server/src/provider/providerMaintenanceRunner.ts apps/server/src/provider/providerMaintenanceRunner.test.ts
  • vp run --filter t3 typecheck

Model: GPT-5.6 Sol · Harness: Codex

Note

Skip killing already-exited processes in provider maintenance runner

In providerMaintenanceRunner.ts, the finalizer now checks child.isRunning before calling child.kill(), skipping the kill signal if the process has already exited. If isRunning check fails, it still attempts to kill. A regression test is added to verify no kill is sent for already-completed processes.

Macroscope summarized 9442413.


Note

Low Risk
Small process-cleanup tweak with a safe fallback that still kills when isRunning cannot be determined. No auth, data, or API surface changes.

Overview
Stops the provider update cleanup finalizer from always calling kill() on completed child processes.

In collectCommandResult, the scoped finalizer now checks child.isRunning first and only kills when the process is still alive (isRunning failures still fall back to kill). Adds a regression test covering the already-exited case.

Reviewed by Cursor Bugbot for commit 9442413. Bugbot is set up for automated code reviews on this repo. Configure here.

Avoid redundant process-group cleanup after successful updates, which can invoke taskkill through cmd.exe on Windows.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 749699a6-c0db-4477-afad-ae9edc4c3271

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 12, 2026
@mitosky07
mitosky07 marked this pull request as ready for review August 12, 2026 08:10
Copilot AI lite review requested due to automatic review settings August 12, 2026 08:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the server-side provider maintenance runner to avoid issuing a redundant process kill during scoped cleanup when the provider updater has already exited (mitigating Windows cmd.exe / taskkill flash side-effects), and adds a regression test to cover the completed-update path.

Changes:

  • Guard the scoped finalizer so it only calls child.kill() when child.isRunning reports the updater is still running.
  • Add a regression test asserting kill() is not invoked for an already-exited updater process.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/server/src/provider/providerMaintenanceRunner.ts Adds an isRunning guard before attempting to kill the updater process during scoped cleanup.
apps/server/src/provider/providerMaintenanceRunner.test.ts Adds a regression test ensuring kill() is not called when the updater has already exited.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread apps/server/src/provider/providerMaintenanceRunner.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@macroscopeapp

macroscopeapp Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 9442413

Straightforward bug fix that adds a guard to check if a child process is still running before attempting to kill it in the cleanup finalizer. The change is defensive, self-contained, and includes a test verifying the behavior.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants