Skip to content

mise upgrade leaves launchd proxy running an old OpenCodex version #3464

Closed

Description

@garysassano

Client or integration

Codex CLI

Area

Service lifecycle

Summary

After upgrading OpenCodex through mise, the installed CLI was 2.42.0, but the launchd background proxy continued running 2.10.1-preview.20260805.

Codex continued routing requests through the stale proxy. Requests to GitHub Copilot then included internal_chat_message_metadata_passthrough.content_item_kinds, which the upstream endpoint rejected. The installed 2.42.0 adapter contains handling to remove this private metadata for noncanonical providers, but that code was not serving the requests.

I expected OpenCodex to detect the CLI/proxy version mismatch during normal startup and either repair the service automatically or refuse to route requests with an actionable error.

This is the same stale-launchd symptom reported in #3450, but with the external upgrade path and downstream request failure identified. It is also the macOS counterpart to the resolved Linux/mise issue #2898: in v2.42.0, the launchd plist still bakes package-local Bun and CLI paths, while the systemd unit uses the stable launcher added for mise/asdf upgrades.

Reproduction

  1. Install OpenCodex through mise as npm:@bitkyc08/opencodex.
  2. Install and start the OpenCodex launchd service with an older release.
  3. Upgrade OpenCodex through mise without manually restarting the service.
  4. Start Codex CLI and send a request through OpenCodex to GitHub Copilot.
  5. Observe that requests still use the old proxy and fail with an unknown-parameter response.
  6. Run ocx status and observe that the installed CLI and running proxy versions differ.

Relevant mise configuration:

[tools]
codex = "latest"
opencodex = "latest"

[tool_alias]
opencodex = "npm:@bitkyc08/opencodex"

Running opencodex service restart repaired the service and started proxy 2.42.0. No repository resync, Codex history cleanup, or provider configuration change was needed.

Version

2.42.0 installed; 2.10.1-preview.20260805 remained running before repair.

Operating system

macOS 26.6.2 (25G83)

Provider and model

GitHub Copilot / github-copilot/gpt-5.6-sol

Codex CLI version: 0.153.2

Logs or error output

{"error":{"message":"Unknown parameter: 'input[0].internal_chat_message_metadata_passthrough.content_item_kinds'.","code":"invalid_request_body"}}

Before repair, ocx status reported:

Proxy: running
CLI 2.42.0 does not match the running proxy 2.10.1-preview.20260805
Default provider: github-copilot
Codex version: 0.153.2
Service: installed and loaded (launchd)

After running opencodex service restart, ocx doctor reported:

ok ocx 2.42.0 matches the running proxy

There was also a stale-shim warning because Codex is managed by mise:

Codex autostart shim not restored: wrapper present but not an opencodex shim.
This Codex binary is owned by a version manager, so opencodex will not wrap it as a new original.

Redacted configuration

{
  "defaultProvider": "github-copilot"
}

The Codex configuration points the built-in OpenAI provider at the local OpenCodex proxy on 127.0.0.1:10100.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    platform
    service
    on Sep 4, 2026
  2. lidge-jun commented on Sep 4, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 71 / 80

    설명

    이 이슈는 macOS에서 mise로 OpenCodex를 올린 뒤에도 launchd 백그라운드 프록시가 예전 버전을 계속 돌리는 문제입니다. 보고자는 CLI는 2.42.0인데 프록시는 2.10.1-preview.20260805로 남았고, Copilot 요청이 오래된 어댑터를 타면서 internal_chat_message_metadata_passthrough.content_item_kinds가 그대로 올라가 upstream에서 거절됐습니다. opencodex service restart 한 번으로 고쳐졌다는 점이 중요합니다. 코드/설정이 깨진 게 아니라 서비스 정의가 업그레이드를 따라가지 못한 것입니다.

    지금 dev(HEAD 2421e44ce, package 2.43.0)를 보면 Linux 쪽은 이미 같은 가족을 고쳤습니다. #2898 → #2909/#2916에서 systemd는 stableLauncherEntry()로 찾은 안정 ocx 런처를 ExecStart에 굽습니다. 버전 매니저가 패키지 트리를 갈아치워도 심이 살아 있어서 다음 재시작이 새 CLI를 탑니다. 반면 macOS buildPlist()(src/service.ts 약 489행)는 여전히 cliEntry()의 Bun+CLI 절대 경로를 ProgramArguments에 넣습니다. mise install 경로(~/.local/share/mise/installs/npm-opencodex/<ver>/...)가 바뀌면 plist는 옛 바이너리를 가리키거나, 옛 경로가 남아 있으면 옛 프록시가 KeepAlive로 계속 살아 있습니다. 보고의 “Linux는 고쳤는데 launchd는 그대로” 진단과 코드가 정확히 맞습니다.

    닫힌 #3450(GUI가 업그레이드 후 낡은 프록시를 열고 admin-token을 물어봄)과 같은 증상 축입니다. 다만 3450은 GUI/토큰 표면이고, 3464는 외부 업그레이드 경로(mise) + Copilot 요청 실패까지 재현이 잡혀 있어서 서비스 수명주기 버그로 따로 다루는 게 맞습니다. types.ts/config.ts 분할과는 무관하고, 독립 착륙 후보입니다.

    진단 쪽은 이미 절반 있습니다. src/cli/version-skew.ts의 computeVersionSkew와 ocx status/doctor가 CLI↔프록시 버전 불일치를 보여 줍니다. 그런데 경고 문구가 “PATH의 ocx가 낡았다” 쪽으로 기울어 있습니다. 이 재현은 반대입니다. CLI가 새것이고 프록시가 낡았습니다. 운영자가 잘못된 쪽을 고치려다 더 헤맬 수 있습니다. 또한 감지만 하고 라우팅을 막거나 자동 repair하지는 않아서, 보고자가 원한 “불일치면 자동 수리 또는 요청 거부”에는 아직 못 미칩니다.

    라인 489 - buildPlist()가 Bun+CLI 패키지 로컬 경로를 굽습니다. Linux buildUnit(..., { launcher })와 달리 mise/asdf 업그레이드에 취약합니다.
    라인 556 - buildServiceShellCommand는 패키지 로컬 쌍만 실행합니다. 바로 아래 buildServiceLauncherShellCommand(약 567행)는 이미 안정 런처용인데 plist 경로에서 안 씁니다.
    심볼 stableLauncherEntry - Linux 전용으로 문서화·사용됩니다. darwin install에도 같은 계약을 쓸지 결정이 필요합니다.
    경로 src/cli/version-skew.ts - 불일치는 잡지만 문구가 “CLI가 낡음” 가정입니다. 프록시가 낡은 경우(이 이슈) 안내가 틀립니다.
    경로 ocx status / doctor - 경고만 하고 요청을 막거나 service repair를 강제하지 않습니다.

    메인테이너의 판단이 필요한 지점

    • launchd도 systemd처럼 안정 ocx 런처를 구울지, 아니면 Bun+CLI를 유지한 채 업그레이드/시작 시 자동 repair만 넣을지
    • 버전 불일치 시 요청을 거절할지, 경고만 할지, 백그라운드에서 repair 후 재시도할지
    • #3450을 상위 이슈로 두고 3464를 플랫폼 하위 작업으로 묶을지, 3464를 독립 수정 PR로 받을지
    • mise 사용자에게 공식 postinstall/ocx service repair 문서를 필수 안내로 올릴지

    너의 추천
    help wanted로 두고 macOS launchd에 Linux와 같은 stableLauncherEntry 경로를 이식하는 PR을 받는 게 좋습니다. 최소 범위는 buildPlist가 런처를 쓰면 buildServiceLauncherShellCommand로 돌리고, install state에 launcherPath를 기록하며, status 경고 문구를 “어느 쪽이 낡은지”로 고치는 것입니다. 자동 repair까지는 2차로 미뤄도 됩니다. 수동 service restart로 이미 복구되는 만큼, 먼저 “업그레이드 후 재시작이 필요 없게” 만드는 쪽이 체감이 큽니다. 중복 close는 하지 말고 #3450만 related로 링크하세요.

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

  3. lidge-jun commented on Sep 8, 2026

    @lidge-jun
    Owner

    Fixed on dev.

    macOS now has the same stable-launcher contract Linux received in #2898. buildPlist takes a
    launcher and execs the stable ocx entry instead of baking in the package-local Bun + CLI pair
    (src/service.ts:495-501, with buildPlist declared at :504), and installLaunchd resolves it
    once through stableLauncherEntry() and records it in install state (src/service.ts:2308). A mise or asdf upgrade that replaces the package
    directory is therefore picked up on the next launchd start, with no manual ocx service restart.

    Regression coverage is in tests/service/service.test.ts — the launcher is named in the plist with no
    versioned path baked in, only a proof-bound Bun override survives, shell and XML metacharacters stay
    quoted, and start/status compare the live job against the expected command — plus
    tests/cli/cli-version-skew.test.ts, which also corrects the skew wording so it names which side is
    actually older. That was the reversed-diagnosis problem you hit.

    Thank you for identifying the external upgrade path and the downstream Copilot failure; that is what
    separated this from #3450.

    Closing as fixed. If a version-manager upgrade still leaves an old build serving on current dev,
    please reopen with ocx service status --json and the rendered plist.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplatformservice

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions