Skip to content

fix(update): show verified Windows stop refusals in dashboard jobs - #9281

Merged
lidge-jun merged 4 commits into
lidge-jun:devfrom
luvs01:codex/windows-dashboard-update-stop-reason
Dec 3, 2026
Merged

lidge-jun merged 4 commits into
lidge-jun:devfrom
luvs01:codex/windows-dashboard-update-stop-reason

Conversation

@luvs01

@luvs01 luvs01 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Show a verified Windows service-stop refusal in the dashboard when an npm or pnpm update aborts before package replacement. The operator can distinguish access denied, unreadable service/process state, unverified wrapper ownership, and insufficient time for a checked stop.
  • The Node launcher reads the structured result from its own stop invocation. The worker accepts only an allowlisted reason correlated with its update attempt. Other failures keep the generic terminal guidance. Job records continue to withhold raw child output.
  • This addresses the diagnostic part of [Bug][Windows] GUI/CLI update fails at the pre-update stop on every release on a slow, process-heavy host (a different fixed cap each time) #9270. It does not extend time limits, disregard pending teardown records, change stop admission, or change the Tauri desktop updater.

Verification

  • On Windows with Bun 1.4.4, the baseline worker returned the generic failure for a typed unverified-budget refusal. The patched runGuiUpdateWorker test passed for both npm and pnpm (2 cases), with the native spawn replaced by a fixture and the persisted job read back. The correlation value and the child, launcher, and vendor output were absent from that record.
  • bun test ./tests/update/update-stop-classification.test.ts ./tests/update/update-mutation-boundaries.test.ts ./tests/update/update-home-launcher.test.ts --only-failures: 56 passed. The mutation guard, capability policy, mutation scanner, and launcher source suites passed 323 tests. The pre-stop launcher branch was also exercised against synthetic child results for the four reasons and fallback/authorization paths.
  • bun run typecheck, bun run structure:check, bun run privacy:scan, and the docs-site build passed. The Spanish localization suite passed 55 tests. Verified the rendered updates in EN/ES/TR.
  • Local validation focused on the two update transports, their failure and mutation boundaries, and documentation. The full repository suite was not run locally. No live package replacement or service stop was required for these checks.

CI repair verification — 2026-12-02

  • Incorporated the test-only Advisor heartbeat correction from test(advisor): release the consultation after two observed heartbeats #9283. The consultation completes after two observed heartbeats, with the continuation order, terminal events, and bounded cleanup asserted.
  • Linux x64, Bun 1.4.4: bun test ./tests/advisor/advisor-guard.test.ts passed 63 tests / 359 assertions. bun run typecheck passed for 2,741 files; git diff --check passed.
  • Full local execution was omitted because concurrent worktrees shared the available runner resources; the complete affected test files and type checking were executed. Hosted PR CI provides the broader import-connected coverage.
  • Hosted PR CI run 46821043821 completed successfully for head d9c8c474df477c431b1d71934bc99d4f51c4c7ff (11 jobs passed; 11 jobs skipped by the repository's PR policy). Catalog async contracts and CodeRabbit also completed successfully.

Checklist

  • Scope stays focused on reporting a pre-update stop refusal.
  • Updated the troubleshooting guide and its existing translations.
  • Reviewed the persisted job fields, launcher compatibility and existing mutation checks.

Summary by CodeRabbit

  • New Features
    • Windows npm and pnpm dashboard updates now provide guidance when an update cannot proceed because the service or process could not be stopped or verified.
    • Dashboard messages explain when to run ocx stop with the same Windows account and retry the update. Other failures direct you to run ocx update in a terminal for details.
    • Raw installer output, which may contain local paths, is not shown in dashboard failure messages.
  • Documentation
    • Updated troubleshooting guides with the new Windows update-failure guidance.

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Dec 1, 2026
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Windows dashboard package updates now pass a private stop token through the Node launcher. For qualifying stop failures, the launcher returns a validated reason that the update worker uses to select fixed guidance. Tests and troubleshooting documentation cover the reporting flow.

Changes: Dashboard stop-failure reporting

Layer / File(s) Summary
Stop-report contract and validation
src/update/update-failure-guidance.mjs, src/update/update-failure-guidance.d.mts, tests/update/update-stop-classification.test.ts
The guidance module extracts tokens, validates correlated stop markers, reads recognized reasons, and formats reason-specific messages. Tests cover recognized reasons and reject malformed or abnormal results.
Launcher-to-worker reporting flow
src/update/check-types.ts, src/update/job.ts, bin/ocx.mjs, tests/update/*, tests/cli/ocx-launcher-source.test.ts, tests/helpers/update-import-policy.ts, structure/ops/update-supervised-recovery.md, docs-site/src/content/docs/*/troubleshooting/update-failed.md, docs-site/src/content/docs/troubleshooting/update-failed.md
For eligible Windows package updates, the worker adds a token to the launcher command. The launcher requests JSON from ocx stop and emits a marker for qualifying failures. The worker uses recognized reasons for fixed guidance. Tests and documentation cover the flow and the withholding of raw output.

Advisor heartbeat test

Layer / File(s) Summary
Control consultation completion in the heartbeat test
tests/advisor/advisor-guard.test.ts
The test uses a deferred promise to control consultation completion. It checks heartbeat and continuation event ordering and adds watchdog and cleanup handling.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant GUIUpdateWorker
  participant runLoggedCommand
  participant NodeLauncher
  participant ocxStop
  GUIUpdateWorker->>runLoggedCommand: request Windows package update
  runLoggedCommand->>NodeLauncher: append dashboard stop token
  NodeLauncher->>ocxStop: run stop with --json
  ocxStop-->>NodeLauncher: structured stop result
  NodeLauncher-->>runLoggedCommand: correlated stop marker
  runLoggedCommand-->>GUIUpdateWorker: recognized stop reason
  GUIUpdateWorker->>GUIUpdateWorker: select fixed failure guidance
Loading

Possibly related issues

  • lidge-jun/opencodex#9270: The change reports recognized pre-update stop failures in dashboard jobs. It addresses the diagnostic objective, but does not change stop time caps or stop admission.

Possibly related PRs

  • lidge-jun/opencodex#9027: Both changes report Windows service-stop refusal reasons, including unverified wrapper ownership. The exact shared identifiers are not established by the available summaries.
Merge Risk: Minimal · up to d9c8c

Windows dashboard updates now show fixed guidance when the service stop is refused, and other failures keep the generic message. The change is covered by tests and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(update): show verified Windows stop refusals in dashboard jobs" matches the main change. The PR adds Windows npm/pnpm dashboard handling that surfaces verified service-stop refusals (ac…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "fix(update): show verified Windows stop refusals in dashboard jobs" matches the main change. The PR adds Windows npm/pnpm dashboard handling that surfaces verified service-stop refusals (access denied, unreadable state, unverified ownership, insufficient time) as reason-specific messages in dashboard update jobs. The title is concise, specific, and follows the conventional-commit style. It does not cover the docs, tests, or the Advisor test fix, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

Commits

Reviewing files that changed from the base of the PR and between accc572 and d9c8c47.

Files selected for processing: 1

  • tests/advisor/advisor-guard.test.ts

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

luvs01 commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

CI follow-up for accc572e4b. The changed-test job passed both npm/pnpm dashboard cases, the repository file-size check, and the Node stop authorization fixture. Its sole remaining test failure was the Advisor heartbeat timing case (one heartbeat observed in the fixed 35 ms consultation). That unchanged test passed on the previous PR head. I reproduced the timing sensitivity with a stalled consumer and submitted the test-only fix separately in #9283. This PR's current CI result remains red until a subsequent integrated run verifies it.

…ation

Carry the verified fixture correction from lidge-jun#9283 into lidge-jun#9281. Preserve heartbeat, continuation-order, and terminal-event assertions with bounded cleanup.

(cherry picked from commit 6d07fbc)

@lidge-jun lidge-jun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Verified diff & ratchet/CI checks on exact head d9c8c47 (all hosted PR CI checks green, 0 unresolved review threads).

@lidge-jun
lidge-jun merged commit 72ab420 into lidge-jun:dev Dec 3, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants