Repository navigation
[WRONG BRANCH] fix(service): treat launchctl 125 on the GUI domain as an unreachable domain (#7697) - #7710
[WRONG BRANCH] fix(service): treat launchctl 125 on the GUI domain as an unreachable domain (#7697)#7710chenyb999-zhcn wants to merge 1 commit into
Conversation
…omain answer
On a headless macOS session launchctl print gui/<uid>/<label> exits 125
("Domain does not support specified action") before ever looking at the
label. The probe returned unknown at that point, skipping the user-domain
query and the plist checks, so absence could never be proven and every
admission-gated write was fenced on a machine with nothing installed.
125 from the gui/ domain is now counted like 112 - a label-independent
answer about the domain - and the probe continues to the user domain and
the on-disk definition checks. A user-domain 125 stays unknown: the
fallback must be able to answer, so its failure is a failure to ask.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Handle GUI-domain status 125 src/service-manager-probe.ts |
Lines 223–234 define status 125 as an unsupported GUI-domain action. Lines 372–382 continue to the user-domain query only for GUI-domain status 125. Lines 394–400 include that response when determining absence from an unstaged plist. |
Verify domain and plist outcomes tests/codex-integration/codex-service-manager-probe.test.ts |
Lines 245–299 test GUI-domain status 125 followed by user-domain statuses 113 and 0, staged and absent plists, and a user-domain status 125. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk: 
Minimal · up to 4d7ba
-
The change appears ready to merge after normal checks; no specific issue requiring a fix was identified.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
Issue
#7697requires the probe to treat exit 125 as an unreachable response only forgui/<uid>, continue touser/<uid>, preserve plist and registration checks, and keep user-domain failures unknown.src/service-manager-probe.tsaddsLAUNCHCTL_DOMAIN_UNSUPPORTED_ACTION = 125and incrementsunreachableDomainsonly whendomain.startsWith("gui/"); the existing timeout and spawn-failure checks still returnunknownbefore status handling. The added tests intests/codex-integration/codex-service-manager-probe.test.tsverify GUI 125 with user 113 returnsabsentwithout a plist, preserves a staged plist with absent registration, detects a loaded user-domain job, and keeps user-domain 125 asunknown.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff changes only
src/service-manager-probe.tsand its focused regression test file. The source change is limited to the linked issue's GUI-domain exit-125 handling and related comments. The four tests directly cover the required behavior and the negative user-domain case. No unrelated production behavior, cleanup, or documentation change is present.
-
-
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.
Comment @coderabbitai help to get the list of available commands.
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. Its title has been prefixed with |
|
Release decision (v2.93.0 dev-merge, maintainer triage lane): CARRIED to #7745 is not merging for 2.93.0. Review asked for native macOS evidence that |
Summary
Closes #7697
On a headless Mac (screen sharing / SSH only, no window server logged in),
launchctl print gui/<uid>/…answersCould not print domain: 125— "Domain does not support specified action". The service-manager probe treated any non-112/113/0 exit as "could not ask", so ownership came backunknownand every Codex write delegated nothing and refused.Like 112, the 125 for a
gui/<uid>domain is a label-independent answer about the domain itself — an unreachable GUI domain cannot be holding our job. The probe now countsgui/*125 as an unreachable domain (proven-absent when nothing is staged on disk, present-registration-absent when the plist is there), while a 125 from theuser/<uid>domain still fails closed as unknown.src/service-manager-probe.ts: recognizeLAUNCHCTL_DOMAIN_UNSUPPORTED_ACTION = 125in thegui/domain loop.tests/codex-integration/codex-service-manager-probe.test.ts: four regression tests — GUI 125 + user 113 with and without a staged plist, GUI 125 + loaded user domain, and user-domain 125 still unknown.Verification
bun test tests/codex-integration/codex-service-manager-probe.test.ts— 118 pass / 1 skip / 0 fail.bun run typecheck— clean.unknown-expecting scratch repro tests from the issue failed on the pristine tree and pass with the fix; they were then merged into the existing suite.Checklist
launchctl printis issued.)Summary by CodeRabbit
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.