Skip to content

fix(windows): hide internal process launches (#967) - #1027

Open
danielgap wants to merge 6 commits into
Gentleman-Programming:mainfrom
danielgap:fix/967-windows-hide-internal-launches
Open

danielgap wants to merge 6 commits into
Gentleman-Programming:mainfrom
danielgap:fix/967-windows-hide-internal-launches

Conversation

@danielgap

@danielgap danielgap commented Sep 14, 2026

Copy link
Copy Markdown

🔗 Linked Issue

Closes #967


🏷️ PR Type

  • type:feature — New feature
  • type:bug — Bug fix
  • type:question — Question requiring tracked work
  • type:docs — Documentation only
  • type:refactor — Code refactoring (no behavior change)
  • type:chore — Maintenance, dependencies, tooling
  • type:breaking-change — Breaking change

📝 Summary

  • Add explicit windowsHide: true at the twenty audited Windows-capable internal Node launch callsites across six files (CodeGraph CLI and Node fallback, review workspace identity, and the review publication-gate/snapshot/transaction/repositories Git and gh wrappers). Arguments, environment, shell selection, stdio, exception handling, and the user-requested external editor are untouched.
  • Port the reporter's contract test suite (tests/windows-hidden-processes.test.ts, mocked Node boundaries asserting the launch option at every mapped boundary) onto current main, plus its dedicated dual-OS workflow, retriggered for this repository: pull_request/push on main instead of the reporter's fork-scoped branch, with the fork-only repository gate removed.

Credit: the audit, the regression suite, and the verified fix are @decode2's work (issue regression 7d5b58ee, verified candidate dcedd074, with hosted RED/GREEN runs linked in the issue). This PR cherry-picks both commits preserving authorship and adds the CI trigger port as a third commit.


📂 Changes

File Change
extensions/codegraph-tools.ts windowsHide: true on the root-probe exec and the shared CLI/Node fallback options (3 callsites).
extensions/gentle-ai.ts windowsHide: true on review workspace Git identity (1).
lib/review-publication-gate.ts windowsHide: true on gate Git probes, push-destination resolution, and the gh runner (11).
lib/review-repository.ts windowsHide: true on the legacy Git wrapper (1).
lib/review-snapshot.ts windowsHide: true on snapshot Git runs (1).
lib/review-transaction.ts windowsHide: true on store-root resolution and gate Git runs (4).
tests/windows-hidden-processes.test.ts Contract suite: twelve ordered action traces over mocked Node child-process boundaries asserting windowsHide === true; external editor stays exempt.
.github/workflows/windows-hidden-processes.yml Dual-OS (ubuntu-24.04, windows-latest) contract run, ported from the fork-scoped trigger to pull_request/push on main.

🧪 Test Plan

  • RED confirmed on current main before the fix: node --experimental-strip-types --test tests/windows-hidden-processes.test.ts reports the editor-exemption test passing and the internal-launch contract failing (windowsHide undefined).
  • GREEN after the fix: 2/2 passing locally on Linux.
  • Full suite: pnpm test 0 failures (the 10 cancelled rdd-status-line subtests reproduce on pristine origin/main, pre-existing).
  • Dual-OS contract run will execute on this PR via the ported workflow (Linux + hosted Windows), matching the reporter's hosted GREEN evidence.
  • Scope honesty per the issue: this establishes launch-option propagation, not observed desktop windows; GUI descendants of external tools remain out of scope.

🔍 Review Provenance

Two native four-lens review cycles (risk, resilience, readability, reliability), both approved with zero corrections:

  1. fix+test commits (target sha256:825e1d45…): approved at revision sha256:308a11bc…, acknowledgement burned.
  2. Final head including the CI trigger port (target sha256:d2080c6b…): approved at revision sha256:ab967959…, acknowledgement burned.

All findings in both cycles are informational advisories (test-suite hygiene items like indent/cleanup nuances, argv contract coupling notes, and an uncached-install suggestion for the new workflow); none block this change.


Contributor Checklist

Summary by CodeRabbit

  • Bug Fixes

    • Windows users will no longer see unwanted console windows during background repository, review, publication, or code analysis operations.
    • Interactive external-editor launches continue to open normally when explicitly requested.
  • Tests

    • Added automated cross-platform coverage verifying hidden background processes on Windows while interactive tools retain their expected behavior.

decode2 and others added 3 commits September 14, 2026 17:37
Port the Windows hidden-process workflow from the reporter's fork-scoped
trigger to the org repository: run on pull_request and push to main,
and drop the fork-only repository gate. Without this, the new contract
suite never executes on Windows in CI, breaking the cross-OS validation
chain this fix relies on.
Copilot AI lite review requested due to automatic review settings September 14, 2026 17:25

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 34009c47-c196-410f-8f44-484f42770a02

📥 Commits

Reviewing files that changed from the base of the PR and between 94ecee5 and 2096846.

📒 Files selected for processing (1)
  • tests/windows-hidden-processes.test.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The change adds windowsHide: true to internal Git, GitHub CLI, and CodeGraph launches. New contract tests capture these routes and preserve the external-editor exception. A GitHub Actions workflow runs the tests on Ubuntu and Windows.

Changes

Windows hidden-process coverage

Layer / File(s) Summary
Internal launch option propagation
extensions/codegraph-tools.ts, extensions/gentle-ai.ts, lib/review-*.ts
Internal Git, GitHub CLI, and CodeGraph child-process invocations now pass windowsHide: true.
Child-process contract tests
tests/windows-hidden-processes.test.ts
Capturing fakes trace twelve public actions and verify hidden-process options. The external editor remains configured with inherited stdio and no windowsHide option.
Cross-platform workflow
.github/workflows/windows-hidden-processes.yml
The new workflow runs the contract tests on ubuntu-24.04 and windows-latest with pinned Node and pnpm versions.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: alan-thegentleman

Merge Risk: ⚪ Minimal · up to 20968

The audited internal launches now set Windows process hiding, with cross-platform contract coverage and no concrete merge-blocking defect identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: hiding internal Windows process launches.
Linked Issues check ✅ Passed Issue #967 requires windowsHide: true at 21 audited internal, noninteractive launch callsites across six files. The PR adds the option to the listed CodeGraph, review identity, Git, and gh launche…
Out of Scope Changes check ✅ Passed The source changes stay within issue #967. The contract tests and dual-OS workflow support the required launch-option validation. The changes do not add unrelated launch families or alter arguments, e…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

The inline win32 spread widened its element type to plain strings and
tripped the recorded-diagnostics ratchet (TS2322 against ExpectedCall,
201 vs 200). Extract the fallback into an ExpectedCall[] constant so the
literal kinds stay narrowed; no behavior change.
@danielgap

Copy link
Copy Markdown
Author

The first CI run failed on two pre-existing or unrelated causes, both addressed or scoped:

  1. Type check (fixed): the new test file's inline win32 spread widened its element type and tripped the recorded-diagnostics ratchet (TS2322 against ExpectedCall, 201 vs 200). 2096846d extracts the fallback into a typed ExpectedCall[] constant: ratchet back to 200 with no regressions, contract tests still 2/2, full suite 0 failures. This head went through its own full four-lens native review (approved, zero corrections).

  2. review-repository-windows (pre-existing): candidate view owner preparation failed is the documented ci(windows): candidate owner preparation fails when a PowerShell spawn exceeds its 5 s timeout #990 PowerShell spawn-timeout failure on cold Windows runners, already fixed by open PR fix(review): bound Windows owner command duration #1009. It is unrelated to this change; this PR's own Windows validation runs through the ported test (windows-latest) leg, which passed (43s) alongside its Ubuntu twin.

Port the Windows hidden-process workflow from the reporter's fork-scoped
trigger to the org repository: run on pull_request and push to main,
and drop the fork-only repository gate. Without this, the new contract
suite never executes on Windows in CI, breaking the cross-OS validation
chain this fix relies on.
@danielgap

Copy link
Copy Markdown
Author

Rebased onto current main (d8abc81). The situation changed since this PR opened: the fix itself and the contract tests are already on main (windowsHide across gentle-ai.ts, the lib/review-* files, and codegraph-tools.ts, plus tests/windows-hidden-processes.test.ts via 7d5b58e and f2bb223).

What this PR now carries is the one piece main is missing: the workflow trigger. Main's copy of windows-hidden-processes.yml only runs on the fix/windows-hidden-internal-processes branch with a fork guard, so the contract tests never execute on PRs to the canonical repo. After the rebase this is a single 6-line change restoring push: main + pull_request: main, and the effect is visible on this PR itself: test (windows-latest) and test (ubuntu-24.04) now run and pass here.

If you'd rather keep Windows runners off every PR, closing this in favor of a maintainer-side trigger tweak works too; otherwise this is ready to merge as-is.

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.

bug(windows): hide remaining internal CodeGraph and review process launches

3 participants