GeezerVison is showing github.com — fix(windows): stop service loop on missing install by Ingwannu · Pull Request #1877 · lidge-jun/opencodex
Conversation
Ingwannu
commented
Aug 17, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
- verify the Task Scheduler wrapper's baked Bun runtime and CLI entry before every child start;
- log one actionable incomplete-install message and exit when either path is absent;
- preserve the existing five-second restart behavior for a proxy child that actually launched and then failed;
- document the recovery command and the reason this slice does not attempt an unsafe npm directory copy-back.
Partial fix for #1849: this closes the unbounded missing-file restart loop. Transactional npm package-and-shim rollback remains separate follow-up work.
Why this scope
A missing executable cannot become healthy inside the same wrapper process, so retrying it 1,009 times adds log churn without recovery. A generic crash ceiling would also stop legitimate recovery after unrelated intermittent runtime failures. The wrapper therefore treats only proven missing baked paths as terminal.
The current dev updater already has stop-first and registry-integrity preflight that were not present in the reported 2.13.0 build. It still does not have a verified transactional restore of both the npm package tree and global launchers. Copying a package directory alone would not safely restore shims, ownership, and lock state, so that broader design is intentionally not guessed in this PR.
Verification
bun test tests/service.test.ts — 124 pass, 0 fail.
bun run typecheck — passed.
bun run privacy:scan — passed.
cd docs-site && bun install --frozen-lockfile && bun run build — 385 pages built successfully.
git diff --check — passed.
dev2-go
No separate Go-native counterpart exists for this behavior; the Windows service asset generator remains in the TypeScript lifecycle control plane.
Review notes
This is self-authored maintainer work, so I will not approve or merge it myself. Exact-head CI, the service-lifecycle workflow, and another maintainer review are required.
Summary by CodeRabbit
-
Bug Fixes
- Improved Windows service startup validation by detecting incomplete installations before launch.
- Services now stop cleanly with an actionable message instead of repeatedly retrying when required files are missing.
- Existing restart behavior remains available when a service starts successfully but later crashes.
-
Documentation
- Added guidance explaining how incomplete Windows service installations are handled and repaired.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
✅ Deterministic PR hygiene checks passed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Aug 17, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 89864c7d-aaf6-4c72-9461-d01385689b6c
📥 Commits
Reviewing files that changed from the base of the PR and between 9830ab1 and 1b9ba76.
📒 Files selected for processing (4)
docs-site/src/content/docs/reference/cli/lifecycle.md
src/service.ts
structure/06_docs-and-release.md
tests/service.test.ts
Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review.
📝 Walkthrough
Walkthrough
The Windows service wrapper now checks its bundled Bun executable and CLI entry before each launch. Missing files produce one repair message and exit code 3 without retrying. Tests cover both missing-file cases and retained retries after successful launches and crashes.
Changes
Windows service startup validation
| Layer / File(s) |
Summary |
Startup preflight and regression coverage src/service.ts, tests/service.test.ts |
The wrapper checks the bundled Bun runtime and CLI entry before spawning. It exits with code 3 when either file is missing. Tests verify both failure cases and retry-loop ordering. |
Recovery behavior documentation docs-site/src/content/docs/reference/cli/lifecycle.md, structure/06_docs-and-release.md |
Documentation describes the incomplete-installation message, exit behavior, preserved crash retries, and reinstall-and-repair procedure. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Merge Risk: ⚪ Minimal · up to 1b9ba
The change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.
Possibly related issues
Possibly related PRs
- lidge-jun/opencodex#306 — Directly related Windows service-wrapper logic and regression tests in
src/service.ts and tests/service.test.ts.
- lidge-jun/opencodex#980 — Related Windows service repair and startup behavior in the same implementation and test files.
- lidge-jun/opencodex#838 — Related handling of Windows service viability and missing on-disk service assets.
Suggested reviewers: lidge-jun
Sequence Diagram(s)
sequenceDiagram
participant WindowsServiceWrapper
participant BundledFiles
participant ServiceProcess
WindowsServiceWrapper->>BundledFiles: Check Bun executable and CLI entry
BundledFiles-->>WindowsServiceWrapper: Return file availability
alt Both files exist
WindowsServiceWrapper->>ServiceProcess: Spawn service
else A file is missing
WindowsServiceWrapper-->>WindowsServiceWrapper: Log incomplete installation
WindowsServiceWrapper-->>WindowsServiceWrapper: Exit with code 3
end
Loading
🚥 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%. |
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: stopping the Windows service loop when required installation files are missing. |
| 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. |
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
ingw/fix-windows-service-missing-install-1849
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. The macOS provider request pacing queue failure is unrelated to this PR: #1877 does not touch request-pacing code/tests, while the service-lifecycle workflow and focused service changes are green. The branch is currently 14 commits behind dev, so it still needs to be updated and exact-head CI rerun before merge.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 18, 2026
luvs01
pushed a commit
to luvs01/opencodex
that referenced
this pull request
Aug 18, 2026
…#1049
lidge-jun#1849 was two defects wearing one issue number. lidge-jun#1877 stopped the service
wrapper hammering a missing install and shipped in v2.24.0; nothing has been
done about how the install went missing, which is npm install -g removing the
existing package before the replacement is verified. That half is now lidge-jun#1942 and
the umbrella stays open so the original evidence stays attached to it.
lidge-jun#1049 I assessed and did not start. The design is complete in the write-substrate
contract and none of it exists: adoption-pending appears 37 times in the devlog
and zero times in src. What is missing is not an adoption branch but the whole
publication protocol - a complete-database temp publisher, atomic no-clobber
publication, fsync ordering, and the positive-authority gate.
That is crash-safety machinery for durable state in the user's Codex home, where
a subtly wrong publication corrupts an install rather than failing a test. It is
implemented completely with its fixture matrix or not at all, and squeezing a
partial version into a wave beside unrelated fixes is the worst of the options.
agentHits
pushed a commit
to agentHits/opencodex
that referenced
this pull request
Sep 17, 2026
…vice-missing-install-1849
fix(windows): stop service loop on missing install
agentHits
pushed a commit
to agentHits/opencodex
that referenced
this pull request
Sep 17, 2026
…#1049
lidge-jun#1849 was two defects wearing one issue number. lidge-jun#1877 stopped the service
wrapper hammering a missing install and shipped in v2.24.0; nothing has been
done about how the install went missing, which is npm install -g removing the
existing package before the replacement is verified. That half is now lidge-jun#1942 and
the umbrella stays open so the original evidence stays attached to it.
lidge-jun#1049 I assessed and did not start. The design is complete in the write-substrate
contract and none of it exists: adoption-pending appears 37 times in the devlog
and zero times in src. What is missing is not an adoption branch but the whole
publication protocol - a complete-database temp publisher, atomic no-clobber
publication, fsync ordering, and the positive-authority gate.
That is crash-safety machinery for durable state in the user's Codex home, where
a subtly wrong publication corrupts an install rather than failing a test. It is
implemented completely with its fixture matrix or not at all, and squeezing a
partial version into a wave beside unrelated fixes is the worst of the options.
Reviewers
lidge-jun
Awaiting requested review from lidge-jun
lidge-jun is a code owner
1 more reviewer
Wibias
Wibias approved these changes
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
bug
Something isn't working
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|