[Bug][macOS] `ocx service restart/repair` after LaunchAgent bootout reports "not loaded" on the first call

Open
#8,362 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start by tracing the macOS ocx service restart and repair paths that bootstrap the com.opencodex.proxy LaunchAgent and check whether it is serving on port 10100. Reproduce the reported sequence with launchctl bootout, then inspect related issues #4141 and #4236 for context. Done means a single restart after bootout restores the proxy and passes a bounded health check.

Written by the indexing model from the issue text.

Description

cli platform service

Summary

On macOS, after the com.opencodex.proxy LaunchAgent has been booted out (launchctl bootout gui/$UID/com.opencodex.proxy), the first ocx service restart or ocx service repair ends with

⚠️  installed, not loaded (launchd …)
   Registered, but no proxy is answering on port 10100.
   …
   Meanwhile: ocx start   (serves in the foreground)

Running ocx service repair a second time then succeeds (✅ opencodex service repaired and serving on port 10100.). Seen twice in a row today on 2.99.0 (npm global, macOS 27).

Sequence:

  1. launchctl bootout gui/$UID/com.opencodex.proxy (to edit config.json safely)
  2. edit config
  3. ocx service restart → not loaded / not serving
  4. ocx service repair → ✅ serving

and on the next cycle bootout → repair → not serving → repair → ✅.

Possibly a race between bootout completing and the re-bootstrap (launchd still tearing down the job), similar in spirit to #4141 / #4236.

Suggested fix

When the job is not loaded, restart/repair should bootstrap it and poll health for a bounded time (retrying bootstrap once on EIO/5), instead of reporting failure after the first attempt.

Acceptance

bootout → ocx service restart brings the proxy back on the first call.

Dominant language
TypeScript
Stars
16.9k
Forks
1.3k
Avg merge
23h
Merged PRs (30d)
687

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lidge-jun/opencodex

All issues in lidge-jun/opencodex

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.