openclaw - 💡(How to fix) Fix Dynamic model enumeration for CLI runtimes (claude-cli, codex-cli, google-gemini-cli) instead of static catalog [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

CLI-runtime providers (claude-cli, codex-cli, google-gemini-cli) currently rely on a static, hand-maintained model catalog (dist/extensions/<provider>/openclaw.plugin.json) for the /models picker. Because these CLIs are externally maintained — Anthropic / OpenAI / Google control which models the binary supports and when new ones ship — the static list is the wrong source of truth and goes stale on every upstream model release.

Concrete example today: dist/extensions/anthropic/openclaw.plugin.json lists claude-opus-4-5/4-6/4-7 and claude-sonnet-4-5/4-6 but not claude-haiku-4-5. Users on the latest Claude CLI binary can run claude --model claude-haiku-4-5 fine but /models won't surface it.

The fundamental mismatch: OpenClaw is shipping a snapshot of someone else's product as a built-in JSON.

Error Message

  1. On failure (API down / rate limited / auth lapsed): surface the error inline ("couldn't fetch live model list, try again") rather than serving stale static data

Root Cause

  • New Anthropic/OpenAI model ships → users see it in /models immediately, no OpenClaw release needed
  • Eliminates the ongoing maintenance burden of tracking external model releases in the OpenClaw repo
  • Catalog finally reflects what the CLI binary can actually do (today the gap is claude-haiku-4-5 and probably more)
  • Architecturally honest: external state lives in the system that owns it (provider API), not in our shipped JSON

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Summary

CLI-runtime providers (claude-cli, codex-cli, google-gemini-cli) currently rely on a static, hand-maintained model catalog (dist/extensions/<provider>/openclaw.plugin.json) for the /models picker. Because these CLIs are externally maintained — Anthropic / OpenAI / Google control which models the binary supports and when new ones ship — the static list is the wrong source of truth and goes stale on every upstream model release.

Concrete example today: dist/extensions/anthropic/openclaw.plugin.json lists claude-opus-4-5/4-6/4-7 and claude-sonnet-4-5/4-6 but not claude-haiku-4-5. Users on the latest Claude CLI binary can run claude --model claude-haiku-4-5 fine but /models won't surface it.

The fundamental mismatch: OpenClaw is shipping a snapshot of someone else's product as a built-in JSON.

Proposal

  1. Add CliRuntime.listAvailableModels(): Promise<Model[]> to the runtime interface
  2. Implement per CLI:
    • claude-cli → hit Anthropic /v1/models using the existing CLI auth profile
    • codex-cli → hit OpenAI /v1/models using its auth
    • google-gemini-cli → hit Google's model listing endpoint
  3. commands-models.ts awaits this call when building buildModelsProviderData(...) for CLI providers
  4. On failure (API down / rate limited / auth lapsed): surface the error inline ("couldn't fetch live model list, try again") rather than serving stale static data
  5. Remove the CLI-runtime entries from the bundled dist/extensions/<provider>/openclaw.plugin.json files — their canonical source is the runtime, not OpenClaw's package

CLI providers stay clickable interactively in /models (matching #81212's resolution if that lands first) — the picker still works exactly the same; only the data source changes.

Non-CLI providers (custom OpenAI-compatible endpoints, MiniMax, LM Studio, BYO models in ~/.openclaw/agents/<agent>/agent/models.json) keep their existing static catalog behavior — they have no canonical /v1/models to query, so a user-edited JSON is the right place.

Optional micro-cache

A sub-second in-memory TTL (5-10s) to avoid re-hitting the API when a user reopens the picker twice in a row. No persistence, no "refresh weekly" — keeps the "always live" semantic.

Why this matters

  • New Anthropic/OpenAI model ships → users see it in /models immediately, no OpenClaw release needed
  • Eliminates the ongoing maintenance burden of tracking external model releases in the OpenClaw repo
  • Catalog finally reflects what the CLI binary can actually do (today the gap is claude-haiku-4-5 and probably more)
  • Architecturally honest: external state lives in the system that owns it (provider API), not in our shipped JSON

Related

  • #81212 — visibility of CLI providers in /models picker (this issue depends on that being fixed so users can actually click through)
  • The static-catalog files I'd remove: dist/extensions/anthropic/openclaw.plugin.json (claude entries), and the codex / google-gemini equivalents

Affected versions

Observed on 2026.5.12-beta.1. Static-catalog approach predates the beta.

Happy to put up a PR if maintainers signal which direction is preferred.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING