Skip to content

fix(service): restart existing installations without re-registering - #2289

Draft
Ingwannu wants to merge 1 commit into
devfrom
fix/2287-service-restart
Draft

fix(service): restart existing installations without re-registering#2289
Ingwannu wants to merge 1 commit into
devfrom
fix/2287-service-restart

Conversation

@Ingwannu

Copy link
Copy Markdown
Owner

Summary

  • make bare ocx service install only when no service is registered
  • route an existing installation through the no-admin repair/restart path instead of re-running registration
  • add ocx service restart as an alias of repair
  • document the idempotent lifecycle behavior in README and all maintained CLI lifecycle translations

Closes #2287

Verification

  • node_modules/.bin/bun test tests/cli-help.test.ts tests/service.test.ts tests/winsw.test.ts — 173 pass / 0 fail on Bun 1.4.0
  • node_modules/.bin/bun run typecheck — passed
  • node_modules/.bin/bun run privacy:scan — passed
  • cd docs-site && ../node_modules/.bin/bun install --frozen-lockfile && ../node_modules/.bin/bun run build — 393 pages built
  • broad suite before the final help-expectation update: 14,144 pass / 16 skip / 1 fail; the single failure was the old service usage expectation, which is covered by the green focused rerun above

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.

@Ingwannu
Ingwannu requested a review from lidge-jun August 21, 2026 10:53
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 223e9234-b530-4618-b53a-f8fda9242909

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

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.

@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 62 / 80

지금 dev HEAD 3e130d239에 버그가 그대로임. src/service.ts:3276-3278 normalizeServiceSubcommand(undefined)"install"로 고정. serviceCommand (:3310-3312)가 parsed.sub를 그대로 스위치에 넣음. Windows case "install"은 이미 있는 스케줄러에 schtasks /create /f를 탐. #2287이 그거임. 이 PR은 그 리뷰의 해결방안을 거의 그대로 구현함. 드래프트. 닫을 중복 아님. #2287을 이 PR이 닫음.

핵심이 selectServiceSubcommand임. 배어 호출이고 백엔드 플래그 없고 installed"repair". 아니면 parsed.sub. restartnormalizeServiceSubcommand에서 이미 "repair"로 접힘 (parseServiceArgs 경유). tests/winsw.test.tsparseServiceArgs(["restart"]) === { sub: "repair", backend: null, invalid: [] }를 잠금. --native/--schedulerparsed.backend !== null이라 배어 repair로 안 떨어짐. install-only 유지. #2287 리뷰랑 같음.

런타임 배선. serviceCommandisServiceInstalled() (src/service.ts:3069-3071)를 부름. 그게 diagnoseService().installed임. Windows는 statusWindowsXml + 에셋 + WinSW 상태로 deriveWindowsServiceDiagnostic. repair 본체 (:2292-2322)는 Windows 스케줄러에서 schtasks /create 없음. 에셋 다시 쓰고 stop/start. UAC 없음. 배어 경로가 prepareServiceInstall을 안 타면 #2287이 죽음. 헬프/src/cli/registry.ts/README/docs-site 8개 로케일이 restart 별칭이랑 "없으면 install, 있으면 재등록 없이 repair"로 맞춰짐. 문서만 앞선 게 아님.

테스트 구멍. tests/service.test.tsselectServiceSubcommand 네 장을 잠금: 없음→install, 있음→repair, 명시 install→install, --native 있으면 install. serviceCommand 본문이 selectServiceSubcommand(parsed를 포함하는지도 소스 문자열로 봄. 근데 isServiceInstalled/diagnoseService를 가짜로 심어서 serviceCommand([])prepareServiceInstall을 안 부르는 테스트는 없음. diagnoseService가 Windows에서 false-negative면 (쿼리 실패=미설치) 배어 커맨드가 다시 install로 감. 같은 UAC. serviceCommand가 invalid 옵션 검사보다 isServiceInstalled()를 먼저 부름. 작은 순서 버그. 치명은 아님.

types.ts/config.ts 안 만짐. 스플릿 안 씹힘. 리베이스하지 말고 닫으라는 케이스 아님. #2188 L1–L9 사이드카 이미 dev. x_search 넣지 말 것. Grok OAuth Chat 기본(#2255)/GUI 옵트인 Responses(#2266)/#2283이랑 다른 레인임. 프리뷰 배포 아님. v2.29.0 이미 태그됨. 헤드 3e130d239는 데브로그뿐이라 이 패치랑 안 겹침. 드래프트인데 Windows 도그푸딩이 git pull 다음 ocx service 한 방에 프록시를 죽임. 구현이 맞고 범위가 작음. 그래서 62.

해결방안: 이 패치로 가라. 머지 전에 diagnoseService().installed === true를 심은 serviceCommand([])prepareServiceInstall/schtasks /create를 안 부르는 회귀 하나. 쿼리 실패를 미설치로 바꾸지 말 것. 불명이면 repair를 거절하고 상태를 찍는 쪽이 install보다 안전함. invalid 플래그 검사를 isServiceInstalled보다 앞에 둬라. 스플릿이 service.ts를 옮기면 리베이스하지 말고 닫고 다시 짜라. 지금은 그 정도 아님.

이 댓글은 grok-bot이 작성했습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants