Repository navigation
PX-398: avoid fnm multishell paths in service launchers - #6030
andrew05060414 wants to merge 2 commits into
Conversation
避免将 fnm 的 shell 临时路径写入服务,并提示 Codex shim 缺失状态。
让 launchd 清理旧 plist 的临时 PATH 而不重启健康服务,并让 Windows 服务脚本复用同一过滤规则。
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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. This PR stays in draft until every box above is ticked. |
리뷰 · 우선순위 62 / 80이 PR은 서비스가 fnm 같은 도구의 잠깐 쓰는 폴더를 시작 경로로 기억하지 않게 한다. fnm은 터미널이 켜질 때마다 막는 방법은 이렇다. 경로 한 칸이 기준 브랜치는 dev다. 같은 주제로 열려 있는 다른 PR은 없다. 작성자가 Draft로 두었고, Linux 실제 기기 확인은 아직 하지 않았다. src/service/launchd.ts:551 - 임시 PATH를 설정 파일에서만 지운다. 지금 돌아가는 프로세스는 그대로 둔다. 그런데 화면에는 "service is already loaded from the current plist; nothing to do."라고 찍는다. 파일은 바뀌었는데 할 일이 없다고 말한다. 반환값도 src/service/repair.ts:167 - 수리를 이미 하는 중에 경고가 "ocx service repair를 실행하라"고 한다. 문장은 src/service/state.ts:100의 상태 진단 문장이다. 수리 시작 알림으로 쓰면 사용자가 같은 명령을 또 쳐야 하는 것처럼 보인다. src/codex/shim.ts:151 - 서비스는 다섯 가지 폴더 이름을 칸 전체로 비교한다. shim은 fnm만 보고, 비교 방식도 다르다. src/codex/shim.ts:166에서 실제 경로가 임시 폴더 안에 남으면 그 경로를 그대로 쓴다. src/codex/shim.ts:985는 그 경로의 파일을 백업하고 shim으로 덮어쓴다. 그 파일이 임시 폴더 안의 복사본이면 터미널이 끝날 때 shim도 같이 사라진다. 메인테이너의 판단이 필요한 지점 Mac에서 건강한 서비스를 끄지 않는 것은 #4236을 지키려는 선택이다. 임시 PATH가 이미 죽은 폴더라면, 파일만 고쳐서 지금 프로세스가 그 경로를 계속 쓴다. 잠깐 재시작해도 되는지, 다음 부팅까지 둘지 정해야 한다. Linux 실제 기기 확인은 작성자도 아직 안 했다고 적었다. Oracle ARM에서 fnm으로 한 번 보기 전에는 머지하지 않는 편이 맞다. Draft와 체크리스트 0/4도 그 상태다. 너의 추천 임시 폴더를 서비스 설정에 넣지 않는 방향이 이 고장의 원인과 맞다. 머지 전에 세 가지를 고치면 된다. launchd가 파일을 고쳤으면 고쳤다고 말하고, 필요하면 재시작 여부를 드러낼 것. 수리 중 경고는 "임시 경로를 빼고 다시 기록하는 중"처럼 지금 하는 일을 말할 것. shim도 서비스와 같은 폴더 이름 규칙을 쓰고, 경로가 임시 폴더 밖에 있지 않으면 그 파일을 덮어쓰지 말고 실패로 알릴 것. Linux 실제 기기 확인 전에는 Draft를 유지할 것. 이 댓글은 grok-bot이 작성했습니다 |
|
Early draft blocker on exact head Compare full plist bytes after normalizing only the previous PATH field, rather than returning the whole previous plist on PATH equality. Add a regression combining fnm path cleanup with a simultaneous environment/property change. Holding approval while the PR remains draft; no functional exact-head CI is present yet. |
|
Thanks, @andrew05060414. The release train 4 bug-hardening lane reviewed this and is leaving it open, because it cannot land as-is.
A narrower version would be welcome: the multishell PATH filter alone in the service owner, rebased on |
|
Thanks @andrew05060414. This change landed on |
Summary
*_multishellspaths are not treated as durable launchers or baked into service PATH values.ocx service repairunconditionally evicts the running LaunchAgent, accepts a no-oplaunchctl loadas success, and leaves the hub down with no log line #4236 PATH-reuse safeguard, so a stale temporary entry is removed without booting out a healthy loaded hub. mise upgrade leaves launchd proxy running an old OpenCodex version #3464 is related launchd stale-version background; this PR does not close any of those issues.ocx connectreadiness changes: fnm multishell Codex links are reported through their durable Node installation, and missing/unhealthy shims explain theOPENCODEX_API_AUTH_TOKEN/Missing environment variablefailure mode.Verification
bun run typecheck— passed (bun x tsc --noEmit, exit 0).bun run structure:check— passed (structure/ SSOT checks passed).bun test tests/service/service-fnm-launcher.test.ts— 4 passed, 0 failed.bun test tests/service/launchd-repair.test.ts— 59 passed, 0 failed, 221 expect calls. This includes the stale launchd PATH cleanup case and asserts no launchctl/bootout calls.bun test tests/service/service.test.ts— 207 passed, 3 skipped, 0 failed, 693 expect calls.bun test tests/test-layout.test.ts tests/test-layout-tooling.test.ts— 18 passed, 0 failed, 553 expect calls.bun test tests/cli/cli-connect-readiness.test.ts— 22 passed, 0 failed, 123 expect calls.bun test tests/codex-integration/codex-shim.test.ts --test-name-pattern "fnm multishell|durable node installation"— 1 passed, 1 skipped, 0 failed.bun run privacy:scan— passed (Privacy scan passed).git diff --check— passed.bun test tests/codex-integration/codex-shim.test.ts— 87 passed, 9 skipped, 10 failed. The failures are Windowspowershell.execases blocked by the host execution policy when running generated temporary scripts; the focused fnm regression test passed.launcherPathto a disposablefnm_multishells/<id>/bin/ocxpath, run this branch'socx service repair, verify stale diagnosis, durable replacement/direct Bun runtime, and a systemdExecStartwithoutfnm_multishells; then verify reboot recovery and restore the saved state.Checklist
This PR is intentionally a Draft until confirmed Linux real-machine UAT is complete; no review-ready claim is checked.
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.