You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(service): explain a missing Windows scheduled task on start - #9043
When the Windows Task Scheduler backend fails to start, check whether the task is registered. A confirmed missing task now makes ocx service start exit 1 with the explicit ocx service install command.
Reuse the locale-independent, three-state registration probe on the failed-start path. A present or unreadable registration keeps the original failure. An explicit access denial keeps its existing guidance.
Document the start recovery path and cover absence, presence, unreadable results, and access denial with injected scheduler failures.
Refs #9038. This covers the missing-registration start diagnostic. The reported installation timeout and elevation behavior remain open. #9041 is related to the status lookup during installation.
Verification
bun test tests/windows/windows-scheduler-errors.test.ts tests/windows/windows-scheduler-install-verification.test.ts tests/service/service-start-environment.test.ts — 41 passed.
bun check --no-script --noEmit — no errors in 2,691 files.
bun scripts/structure-ssot.ts — passed.
cd docs-site && bun run build — static HTML generation completed and the updated lifecycle page was verified. Pagefind completion is still pending locally.
git diff --check — passed.
Local checks used Bun 1.4.4 on Linux with isolated homes and a bounded cgroup. Scheduler responses were injected. Live Windows Task Scheduler acceptance is pending.
Checklist
Scope stays focused and avoids unrelated cleanup.
Docs or release notes were updated when needed.
Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults (none of those surfaces changed).
Summary by CodeRabbit
Bug Fixes
On Windows, ocx service start now checks whether the service is registered when startup fails. If registration is confirmed missing, it displays installation guidance and exits with a nonzero status. Other startup failures continue to report the original error.
Documentation
Updated the service-start guidance to explain how to install the service when Windows Task Scheduler registration is missing.
Reviewing files that changed from the base of the PR and between f554eda and 4123218.
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
No actionable comments were generated in the recent review.
Walkthrough
The Windows Scheduler service-start path now checks task registration after a qualifying generic /run failure. It advises ocx service install only when the task is confirmed absent; other failures retain their original error. The CLI, tests, and service-start documentation reflect this behavior.
Changes: Windows Scheduler start recovery
Layer / File(s)
Summary
Detect and handle confirmed task absence src/service/windows-scheduler.ts, tests/windows/windows-scheduler-errors.test.ts
The recovery helper returns install advice only when a qualifying Scheduler /run error is followed by a probe confirming the task is absent. Tests cover absent, present, and unknown probe results, as well as other errors.
Wire recovery into the start command src/service/cli.ts, docs-site/src/content/docs/reference/cli/lifecycle.md, structure/ops/service-and-sidecars.md
The CLI uses recovery for the Windows Scheduler backend. When recovery advice is returned, it reports the advice, sets a nonzero exit code, and skips the serving report. The documentation describes this behavior.
Issue 9038: The missing-task start-path behavior is addressed when the registration probe confirms absence. The issue’s separate installation timeout problem is not addressed.
Merge Risk: Minimal · previous review f554e
ocx service start now advises running ocx service install when a failed Windows Scheduler start is followed by a probe confirming the task is missing. All other failures keep their original error. No merge-blocking risk is identified; live Windows acceptance is still pending.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(service): explain a missing Windows scheduled task on start" matches the main change. The PR makes ocx service start detect a confirmed missing Windows Task Scheduler registration aft…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(service): explain a missing Windows scheduled task on start" matches the main change. The PR makes ocx service start detect a confirmed missing Windows Task Scheduler registration after a generic /run failure, exit with code 1, and advise running ocx service install. The docs and tests cover the same behavior. The title is specific, short, and uses a conventional prefix. It does not mention the exit code or the probe, but it does not need to cover every detail.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Validation update for 2e7657f59fc9cc546acc4e01b4b5473750c2f7ba. The hosted docs build completed successfully, including the build step that generates search assets. The local build reached static HTML generation. I ended the redundant local indexing run after the hosted result became available. Live Windows acceptance is still pending.
Move the try/catch around the Scheduler start into startWindowsSchedulerService so
the advice-or-rethrow decision is exercised directly: one start attempt, advice only
for a confirmed missing registration, the original error otherwise.
Supersedes #9085, which reported the same missing-task start failure (#9038).
Co-authored-by: EnesKartal <43950508+EnesKartal@users.noreply.github.com>
Maintainer integration (lane W, @lidge-jun) at exact head 41232188769a63bbf0448545d294c04553452422. This covers the missing-registration half of #9038: ocx service start now exits 1 with the install command when Task Scheduler confirms the task is absent.
Changes I added since 2e7657f59:
f78fdef93 moves the start-or-explain decision into startWindowsSchedulerService, with a test for one start attempt, advice only on confirmed absence, and the original error otherwise. It carries a Co-authored-by trailer for @EnesKartal, because this supersedes fix(service): refuse cleanly when starting an uninstalled service #9085.
f89fb79cc keeps the literal ops.start(); that the environment-guard order check reads.
Merges from dev.
Relaxed merge gate, checked against dev8d43c92f84:
(a) the head is 7 commits behind.
(b) merge-tree is clean (aaa6d5cebd).
(c) no intervening commit touches this PR's files. The only shared class both sides touch is docs-site/, and here that is one prose paragraph, not a count.
(d) the temporary merge adbb137da5 was not pushed. Typecheck is clean. The focused files windows-scheduler-errors, windows-scheduler-install-verification and service-start-environment give 42 pass / 0 fail. The guards give 53 pass / 0 fail. structure:check passes.
Evidence:
PR CI on this head: all checks pass. A cancelled gates job (its GUI-tests step was cancelled) was rerun and passed. The exact-head test changed job is the test:changed evidence (coordinator ruling).
Real Windows x64 (Bun 1.4.4), at f89fb79cc: the same three files give 42 pass / 0 fail. A live check ran a real schtasks /run against a random missing task name: the registration probe reported absent and the install advice was returned.
Independent gpt-6.1-terra review, two rounds: PASS. The remaining limit is that CLI printing and the exit code are covered by reading, not by a command-level test. Since that review, only dev was merged in.
assert-mergeable-review.sh --maintainer-integration 9043: OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ocx service startexit 1 with the explicitocx service installcommand.Refs #9038. This covers the missing-registration start diagnostic. The reported installation timeout and elevation behavior remain open. #9041 is related to the status lookup during installation.
Verification
bun test tests/windows/windows-scheduler-errors.test.ts tests/windows/windows-scheduler-install-verification.test.ts tests/service/service-start-environment.test.ts— 41 passed.bun check --no-script --noEmit— no errors in 2,691 files.bun scripts/structure-ssot.ts— passed.cd docs-site && bun run build— static HTML generation completed and the updated lifecycle page was verified. Pagefind completion is still pending locally.git diff --check— passed.Checklist
Summary by CodeRabbit
ocx service startnow checks whether the service is registered when startup fails. If registration is confirmed missing, it displays installation guidance and exits with a nonzero status. Other startup failures continue to report the original error.