Repository navigation
Description
Client or integration
Other
Area
CLI
Summary
ocx models new-policy and ocx models new-arrivals are documented in the docs site and implemented in the CLI's models runtime module, but they are unreachable: handleModels in src/cli/models.ts never routes them to handleModelsRuntimeCommand, so both fall through to handleConfiguredModels and fail with Unexpected argument(s).
Evidence (paths relative to repository root, verified on main at ebb4d55 and on npm 2.38.0):
docs-site/src/content/docs/guides/model-routing.md(around lines 88-89) documents: "Useocx models new-policy offglobally, add--provider <name>for an override, and inspectocx models new-arrivals [--json]."src/cli/models-runtime.tsimplements both handlers (newPolicy,newArrivals; dispatch athandleModelsRuntimeCommand) and lists them in its USAGE text.src/cli/models.tsline 448 dispatches only["live", "edit", "enable", "disable", "provider", "selected", "preset", "context", "shadow"]to the runtime module.new-policyandnew-arrivalsare absent, so any invocation reacheshandleConfiguredModels, which rejects unknown arguments.
The underlying feature works through the management API (GET/PUT /api/model-discovery, POST /api/model-discovery/acknowledge) and the dashboard Models page, so the impact is CLI-only: the documented commands cannot be executed headlessly.
Suggested fix: add "new-policy" and "new-arrivals" to the dispatch array in handleModels (models.ts).
Reproduction
- Install 2.38.0 from npm (
npm i -g @bitkyc08/opencodex) or buildmainat ebb4d55. - Run
ocx models new-policy status --json. - Run
ocx models new-arrivals --json.
Both commands fail with Unexpected argument(s) and exit 1 instead of reaching the implemented runtime handlers. No configuration or provider setup is needed; the failure is in CLI dispatch and reproduces with or without the proxy running.
Version
2.38.0 (npm @bitkyc08/opencodex); also present on main at commit ebb4d55.
Operating system
Windows 11
Provider and model
Not provider-specific.
Logs or error output
> ocx models new-policy status --json
Unexpected argument(s): new-policy, status
Usage: ocx models [--provider <name>] [--json]
(exit 1)
> ocx models new-arrivals --json
Unexpected argument(s): new-arrivals
Usage: ocx models [--provider <name>] [--json]
(exit 1)Screenshots and supporting files
None.
Redacted configuration
None required.
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
lidge-jun commentedon Aug 31, 2026
리뷰 · 우선순위 67 / 80
이 이슈는 문서와 구현이 있는데, CLI 입구가 그 명령을 안 받아 주는 구멍입니다. 지금
devHEAD는a0d386b49입니다. 패키지는 2.39.0입니다.라운드2 본선은 아닙니다.
그래도 문서에 나온 명령이 바로 거절되면, 헤드리스로 새 모델 정책을 못 켭니다. 대시보드와 관리 API는 이미 됩니다. CLI만 막혀 있습니다.
흐름은 짧습니다.
src/cli/models.ts의handleModels가 첫 단어를 보고 갈 곳을 고릅니다.add/remove/list-custom은 커스텀 모델 쪽입니다.live,edit,enable,disable,provider,selected,preset,context,shadow아홉 개는handleModelsRuntimeCommand로 넘깁니다.그 배열에
new-policy와new-arrivals가 없습니다. 그래서 두 명령은handleConfiguredModels로 떨어집니다.거기는 제공자 목록을 찍는 자리라서, 모르는 단어가 있으면
Unexpected argument(s)를 내고 끝냅니다. 작성자가 붙인 로그와 같은 문장입니다.실제 동작 코드는 이미 있습니다.
src/cli/models-runtime.ts의 USAGE 27-28줄에 두 명령이 적혀 있습니다.handleModelsRuntimeCommand332-333줄이newPolicy/newArrivals로 연결합니다.newPolicy는 GET/PUT/api/model-discovery를 치고,newArrivals는 같은 GET에서recentArrivals를 보여 줍니다.문서
docs-site/src/content/docs/guides/model-routing.md88-89줄도 두 명령을 안내합니다. 구현과 문서와 입구가 셋인데, 입구만 빼먹은 상태입니다.고치는 내용은 디스패치 배열에 문자열 두 개를 넣는 일이 거의 전부입니다.
재현 명령에는 작은 함정이 있습니다. 이슈 본문은 new-policy 뒤에 status 를 붙였습니다.
USAGE는
new-policy [on|off]입니다. 상태를 안 주면 GET으로 지금 값을 보여 줍니다.status라는 단어는 없습니다.디스패치를 고쳐도
new-policy status는new policy must be on or off로 거절됩니다.확인용은 인자 없는
new-policy --json과new-arrivals --json입니다. 켜고 끄는 예는 문서대로new-policy off입니다.테스트가 이 구멍을 못 본 이유도 분명합니다.
handleModels를 부르는 테스트는 커스텀 add/list 쪽입니다.new-policy/new-arrivals디스패치를 잠근 테스트는 없습니다. 입구 배열이 빠져 있으면 핸들러로 한 번도 안 갑니다.고칠 때 그 배열을 잠그는 테스트가 같이 와야 같은 실수가 다시 안 납니다. types.ts/config.ts 분할과 무관합니다. 같은 주제의 열린 PR은 지금 목록에 없습니다.
라인 448 (src/cli/models.ts handleModels 디스패치 배열) -
new-policy와new-arrivals가 없습니다. 그래서 구현된 핸들러에 도달하지 못하고handleConfiguredModels의 382줄Unexpected argument(s)로 떨어집니다.라인 332-333 (src/cli/models-runtime.ts handleModelsRuntimeCommand) - 핸들러는 이미 있습니다. 입구만 열리면 됩니다. 여기 로직을 다시 쓸 필요는 없습니다.
라인 236 (src/cli/models-runtime.ts newPolicy) - 첫 단어가 on/off가 아니면 거절합니다. 이슈의
new-policy status는 디스패치 수정 뒤에도 여기 걸립니다.경로 tests/ -
handleModels가 두 단어를 런타임으로 넘기는지 잠근 테스트가 없습니다. 배열에서 두 단어를 빼면 지금처럼 조용히 다시 깨집니다.경로 docs-site/src/content/docs/guides/model-routing.md 88-89 - 문서가 안내하는 명령이 지금 트리에서 실행되지 않습니다. 고친 뒤에는 로케일 페이지도 같은 문장인지 한 번 보면 됩니다.
메인테이너의 판단이 필요한 지점
new-policy status별칭을 추가할지, USAGE대로 인자 없음=조회만 유지할지너의 추천
받습니다.
src/cli/models.ts448줄 배열에new-policy와new-arrivals를 넣고, 그 두 단어가 런타임 핸들러로 가는 테스트를 같이 넣으세요.status별칭은 넣지 마세요. 조회는 인자 없는new-policy가 이미 있습니다. 관리 API와 GUI는 건드리지 않습니다. types/config 분할 무관, 중복 닫기 불필요. 라벨은 바꾸지 않습니다.이 댓글은 grok-bot이 작성했습니다
atlastimed commentedon Aug 31, 2026
Thanks for the detailed review — analysis matches, and good catch on the repro nuance.
Correcting for anyone following along:
new-policytakes no subcommand word. The valid verification commands after the dispatch fix are:ocx models new-policy --json(no argument = GET current policy)ocx models new-arrivals --jsonocx models new-policy off [--provider <name>]to mutatenew-policy statusin my original repro was wrong usage and would be rejected by the handler even after the fix ("new policy must be on or off") — the underlying dispatch failure stands regardless, since both commands never reach the handler today.Agreed with the recommendation: add the two strings to the dispatch array plus a test locking the routing, no
statusalias, no management-API/GUI changes.fix(cli): route ocx models new-policy and new-arrivals to the runtime…
lidge-jun commentedon Sep 1, 2026
Fixed by #3171, landed on dev as e92aa33.
Root cause was duplication rather than a missing name: handleModelsRuntimeCommand and handleModels each carried their own list of runtime subcommands, and only the first was updated when these two were added. The fix moves the set into a leaf module both sides consult, so a future runtime subcommand cannot be implemented without also being routed. tests/cli-models-runtime-dispatch.test.ts parses the runtime module's own USAGE and fails if the two ever drift again.
Closing manually because pull requests target dev rather than the default branch.
github-actions commentedon Sep 1, 2026
Automated translation bookkeeping — detected language: English.
fix(cli): route ocx models new-policy and new-arrivals to the runtime…
fix(cli): route ocx models new-policy and new-arrivals to the runtime…