Skip to content

[Bug]: ocx models new-policy / new-arrivals are documented and implemented but unreachable (models.ts dispatch omits them) #3094

Description

@atlastimed

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: "Use ocx models new-policy off globally, add --provider <name> for an override, and inspect ocx models new-arrivals [--json]."
  • src/cli/models-runtime.ts implements both handlers (newPolicy, newArrivals; dispatch at handleModelsRuntimeCommand) and lists them in its USAGE text.
  • src/cli/models.ts line 448 dispatches only ["live", "edit", "enable", "disable", "provider", "selected", "preset", "context", "shadow"] to the runtime module. new-policy and new-arrivals are absent, so any invocation reaches handleConfiguredModels, 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

  1. Install 2.38.0 from npm (npm i -g @bitkyc08/opencodex) or build main at ebb4d55.
  2. Run ocx models new-policy status --json.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliCLI, config inject, packaging flagsproxyHTTP proxy, routing, reverse-proxy / management auth

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions