Skip to content

ocx models edit fails with not_found when the proxy has no reachable management API (custom-local routing) #4662

Closed

Description

@marioaltvater

Client or integration

Other (the bundled ocx CLI of this project)

Area

Catalog / models

Summary

ocx models edit <id> --modalities ... fails with Error: not_found when the proxy has no reachable management listener (custom-local routing). I expected the edit to apply through the running proxy, or a clear offline/management-unavailable error instead of the data-plane 404 surfacing as not_found.

Reproduction

  1. opencodex 2.52.0 daemon runs as a single data-plane listener on 127.0.0.1:10100; ocx status reports routing=custom-local, service=viable, shim=healthy. The conventional loopback management port (10101) is occupied by an unrelated transport relay.
  2. Run ocx models edit <custom-uuid> --modalities text,image → Error: not_found.
  3. Direct calls to the proxy return the data-plane 404 shape for management routes, for both GET and PUT:
GET/PUT http://127.0.0.1:10100/api/custom-models/<uuid>
→ 404 {"error":"not_found","method":"PUT","path":"/api/custom-models/<uuid>"}

Same result with Host: localhost:10100.
4. models edit only talks to the management API (models-runtime → runtimeRequest("/api/custom-models/<id>", PUT)); unlike models add, it has no offline/config-file fallback, so it cannot complete in this topology.

Version

2.52.0

Operating system

Fedora Linux 44 (Forty Four)

Provider and model

N/A (not provider-specific; affects the custom-model catalog edit path)

Logs or error output

$ ocx models edit 48eda5c5-554d-46d6-a878-e574863811af --modalities text,image
Error: not_found

$ curl -sS -X PUT http://127.0.0.1:10100/api/custom-models/<uuid> -H 'authorization: Bearer <redacted>' \
    -H 'content-type: application/json' --data '{"inputModalities":["text","image"]}'
{"error":"not_found","method":"PUT","path":"/api/custom-models/<uuid>"}

Redacted configuration

{
  "port": 10100,
  "routing": "custom-local",
  "note": "single data-plane listener; loopback 10101 is bound by an unrelated relay, so no management listener is reachable"
}

Workaround that worked: stop the unit, patch customModels[].inputModalities in config.json (with a backup), start the unit, ocx sync. The proxy regenerated the Codex catalog correctly afterwards.

Not verified: whether a default install binds management on 10101 normally when that port is free.

Checks

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

Activity

  1. added
    cli
    proxy
    on Sep 14, 2026
  2. github-actions commented on Sep 14, 2026

    @github-actions
    Contributor

    Issue reopened

    The report now contains the information required by the automated check. Thanks for updating it.

  3. added
    bug
    catalog
    on Sep 14, 2026
  4. lidge-jun commented on Sep 14, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 44 / 80

    설명

    이 이슈는 ocx models edit가 관리 API에만 기대는데, 실제로는 데이터 플레인 리스너만 살아 있는 토폴로지에서 그 호출이 404 not_found로 떨어져 운영자가 “모델이 없다”고 오해하게 만든다는 보고입니다. 재현 환경은 routing=custom-local, 프록시는 127.0.0.1:10100 데이터 플레인만 듣고, 관례상 관리용으로 쓰는 루프백 10101은 다른 프로세스가 잡고 있는 상태입니다. 그 상태에서 PUT /api/custom-models/<uuid>를 10100으로 보내면 데이터 플레인이 관리 경로를 모르니 {"error":"not_found","method":"PUT","path":"/api/custom-models/..."}가 나옵니다. CLI는 그 본문의 error 필드를 그대로 꺼내 Error: not_found만 보여 줍니다.

    지금 dev(HEAD aa91958e3) 코드를 보면 원인이 설계 분리와 맞닿아 있습니다. ocx models add는 src/cli/models.ts의 오프라인 config.json 경로로 customModels를 고칩니다(models-runtime-subcommands.ts 주석도 관리 클라이언트를 add 경로에서 빼 둔다고 명시). 반면 ocx models edit는 src/cli/models-runtime.ts에서 runtimeRequest('/api/custom-models/' + id, PUT)만 호출합니다. runtimeRequest → runtimeBaseUrl → findLiveProxy()(src/server/proxy-liveness.ts)는 살아 있는 프록시의 런타임/설정 포트(여기선 10100)를 돌려줍니다. 관리 라우트 자체는 src/server/management/model-routes.ts와 route-registry.ts에 등록되어 있고, 관리 평면이 안 열려 있으면 management-auth.ts 쪽이 reason/hint가 있는 503을 주도록 되어 있지만, 아예 다른 리스너(데이터 플레인)에 꽂히면 그 친절한 503이 아니라 데이터 플레인 404가 됩니다. #2698에서 CLI가 reason/hint를 살리도록 고친 것과도 맞물립니다. 지금은 “관리 불능”이 아니라 “not_found”로 보이는 게 핵심 UX 버그입니다.

    우선순위는 중간입니다. 워크어라운드(유닛 정지 → config.json의 customModels[].inputModalities 수정 → 기동 → ocx sync)가 명확하고, 카탈로그 재생성이 됐다는 점도 적혀 있습니다. 기본 설치에서 10101이 비어 관리 리스너가 붙는 일반적인 경우는 해당 없을 수 있습니다. 다만 custom-local·포트 충돌·단일 리스너 운영은 실제 배포에서 자주 나오는 형태라, “edit만 관리 전용 + 잘못된 포트 + 모호한 에러” 조합은 반복 이슈가 됩니다. #4546 센드 예산이나 갓파일 round3과는 겹치지 않는 CLI/프록시 경계 버그입니다. types.ts/config.ts 스플릿으로 무효화될 PR 후보도 아니고, 중복 이슈로 바로 닫을 근거도 아직 없습니다(유사 축은 관리 평면 메시지 #2698, 데이터/관리 경계 일반론).

    고칠 방향은 대체로 세 갈래입니다. (1) models edit에 models add처럼 config.json 오프라인 패치 폴백을 두기, (2) findLiveProxy/CLI가 관리 리스너를 따로 찾아 실패 시 “management API unavailable / 포트 충돌”로 명확히 거절하기, (3) 데이터 플레인 404 형태가 관리 경로에서 오면 RuntimeApiError가 not_found 대신 관리 불능 힌트로 재매핑하기. (1)은 add/edit 대칭이 좋아지고 이번 토폴로지를 바로 살립니다. (2)(3)은 근본 원인(잘못된 리스너)과 메시지 품질을 고칩니다. 보안상 데이터 플레인에 관리 PUT을 열어 버리는 해결은 하지 않는 편이 맞습니다. 카탈로그 다운로드가 데이터 플레인에 별도 최소 권한 라우트를 둔 이유(catalog-download.ts 주석)와 같은 경계입니다.

    src/cli/models-runtime.ts (edit → runtimeRequest PUT /api/custom-models/...) - add와 달리 오프라인/config 폴백이 없어 관리 리스너가 없으면 항상 실패합니다.
    src/cli/runtime-api.ts (runtimeBaseUrl / findLiveProxy) - 데이터 플레인 포트만 반환하면 관리 경로가 404 not_found로 위장됩니다. 관리 전용 probe·실패 메시지가 없습니다.
    src/cli/runtime-api.ts (responseMessage) - 본문 error: not_found를 그대로 꺼내 운영자에게 “모델 없음”처럼 보입니다. 관리 불능·포트 충돌 hint가 없습니다.
    src/server/proxy-liveness.ts (findLiveProxy) - runtime/config.port 정체성만 확인합니다. 10101 Occupied + 단일 10100 토폴로지를 “관리 가능”으로 오인할 수 있습니다.
    이슈 본문 Version 2.52.0 - dev는 2.56.0대입니다. 재현이 tip에서도 같은지(관리 리스너 분리·에러 문구) 한 번만 확인하면 우선순위 조정이 쉽습니다.

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

    • edit를 add처럼 오프라인 config 패치로 허용할지, 관리 API 전용을 유지한 채 에러/디스커버리만 고칠지
    • custom-local에서 관리 리스너를 의무로 둘지, 단일 리스너+별도 관리 인증 모델을 문서화할지
    • 2.52.0 재현을 tip(2.56.0)에서 재확인한 뒤 라벨/help wanted로 둘지
    • 관련 문서(포트·management loopback·포트 충돌)에 “edit는 관리 평면 필요”를 명시할지

    너의 추천
    이슈는 열어 두세요. 바로 닫을 중복/무효가 아닙니다. 다음 패치는 (우선) 관리 평면 미도달 시 not_found 대신 행동 가능한 에러(포트·management unavailable·hint)로 바꾸고, 가능하면 models edit에 검증된 오프라인 config 패치 폴백을 add와 대칭으로 추가하는 쪽이 사용자 고통이 가장 큽니다. 데이터 플레인에 관리 PUT을 여는 방식은 비추천입니다. tip에서 같은 토폴로지 재현 한 번만 확인하면 구현 PR 범위가 안정됩니다.

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

  5. added a commit that references this issue on Sep 17, 2026
    b5a0875
  6. lidge-jun commented on Sep 18, 2026

    @lidge-jun
    Owner

    Fixed on dev by #4959, squashed as b5a08750277e983ae9704b5cbf1aaf10141db7dd.

    The affected surface is wider than the title says, so recording it for anyone who searches later: this is not specific to ocx models edit. It affects every management-backed ocx subcommand on a client machine.

    Your port-10101 diagnosis turned out to be a red herring, and the real cause is more specific. The 404 body you captured is emitted by exactly one constructor in the tree — the connected-client machine listener, which binds the same default port and answers /healthz with role client. The CLI liveness parser read that discriminator and discarded it, so a healthy client-role listener was indistinguishable from a missing management route. It is now told apart.

    Shipping in the next release off dev.

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

    bugcatalogcliproxy

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions