fix(service): bind service start to the installed environment - #5026
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe service ChangesService environment validation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The startup environment guard is invoked before service launch, and the added regression test correctly protects that ordering. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked. |
|
Red on The cap cannot be raised: The remedy is a move, not a number. Put the new case in a sibling file, byte for byte, and register it in both One caution from tonight: a moved case is not automatically the same case. One moved out of The job log names the offending path; |
Ingwannu
left a comment
There was a problem hiding this comment.
I traced the two-line runtime change at exact head 7ce5a6322d. Reusing assertServiceEnvironmentMatchesInstall() before ops.start() is the correct narrow follow-up: start launches the recorded service environment, so allowing the caller's SQLite/Codex home to disagree would split the operator's history view. Keeping read-only status available is also the right exception.
I found no additional source-level correctness blocker in this diff, but I am not approving a red head: hosted test 2/4 is currently failed and macOS is still running. Please inspect the completed failure log, fix or demonstrate a baseline-only failure, and clean the accidental indentation drift in the existing source-invariant assertions before re-requesting approval.
…art guard The branch added five lines to `tests/service/service.test.ts`, which sits at its committed cap of 4106 in `tests/fixtures/file-size-baseline.json`, so the file-size ratchet failed the run. Caps only move down, so the fix is to move the new assertion rather than to raise the cap. The start-case ordering check now lives in a sibling, `tests/service/service-start-environment.test.ts`, and asserts the same property plus one more: the guard is imported, so a local stub of the same name cannot satisfy it. This also restores three lines the branch had reindented from four spaces to three. They are the `repair`/`restart` assertions and were unrelated to the change. Co-authored-by: luvs01 <luvs01@users.noreply.github.com>
|
Pushed a follow-up commit to this branch (
The same commit restores three lines this branch had reindented from four spaces to three. They are the The production change itself is unmodified, and it is the right one: |
Summary
Follow-up for a CodeRabbit fix that missed the #4951 merge window: the review thread was resolved against commit
7ce6475e9, but the PR merged at the earlier head90471ea92, so the fix never reacheddev. This replays exactly that change onto currentdev.ocx service startnow runs the sameassertServiceEnvironmentMatchesInstall()guardstopalready runs. Without it, starting the service from a shell whosesqlite_home/CODEX_SQLITE_HOME/CODEX_HOMEdiffers from the recorded install silently binds the recorded database while the shell resolves another — splitting native Codex history between two databases.statusis intentionally left unguarded (read-only diagnostics should still work to inspect the mismatch).Verification
bun test tests/service/service.test.ts— 209 pass / 3 skip / 0 fail.origin/dev88249ed75, 0 behind.Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
Bug Fixes
Tests