Skip to content

fix(models): keep --all aligned with synthetic catalog rows#40160

Merged
steipete merged 3 commits intoopenclaw:mainfrom
dorukardahan:codex/models-list-all-forward-compat
Mar 8, 2026
Merged

fix(models): keep --all aligned with synthetic catalog rows#40160
steipete merged 3 commits intoopenclaw:mainfrom
dorukardahan:codex/models-list-all-forward-compat

Conversation

@dorukardahan
Copy link
Copy Markdown
Contributor

Summary / What changed

  • keep openclaw models list --all rooted in discovered runtime rows
  • supplement missing catalog-backed rows (for example openai-codex/gpt-5.4) via loadModelCatalog() + resolveModelWithRegistry()
  • preserve auth-based availability for supplemented synthetic rows when the runtime registry does not know that key
  • add focused tests for synthetic Codex GPT-5.4 visibility and for the empty-catalog fallback path

Why

Tests

  • pnpm exec vitest run src/commands/models/list.list-command.forward-compat.test.ts src/commands/models.list.auth-sync.test.ts
  • pnpm exec vitest run --config vitest.e2e.config.ts src/commands/models.list.e2e.test.ts
  • pnpm build
  • pnpm check in this worktree still hits repo-wide missing optional extension deps (extensions/diagnostics-otel, extensions/feishu, extensions/matrix, ui, etc.); i did not expand PR scope to fix those unrelated failures

Real-world validation

  • i reproduced the reported code path against v2026.3.7 and confirmed the mismatch between models list --all and the synthetic catalog / forward-compat layer
  • i did not run a live interactive Codex OAuth login in this branch

Issue

Fixes #40068
Related #38696
Related #39678

AI-assisted: yes

@openclaw-barnacle openclaw-barnacle bot added commands Command implementations size: S labels Mar 8, 2026
@dorukardahan
Copy link
Copy Markdown
Contributor Author

Self-review: i kept discovered --all rows as the base list and only filled the missing catalog-backed rows on top. that keeps the old --all behavior when loadModelCatalog() returns [], and it avoids building fake catalog-only runtime models just for display.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 8, 2026

Greptile Summary

This PR fixes a gap in openclaw models list --all where synthetic/forward-compat catalog models (e.g. openai-codex/gpt-5.4) were omitted because the command only iterated runtime-discovered registry rows. The fix adds a supplement pass: after emitting all discovered rows, it calls loadModelCatalog and uses resolveModelWithRegistry to hydrate any catalog entries not already present, correctly applying auth-based availability fallback for models that aren't surfaced by the runtime's getAvailable() call.

Key implementation details:

  • The seenKeys / discoveredKeys distinction cleanly separates "already emitted" from "known to the runtime", allowing allowProviderAvailabilityFallback to be set precisely for truly synthetic rows.
  • The if (modelRegistry) guard means the supplement pass is skipped (safely) when registry loading fails.
  • Two new focused tests cover the catalog-present and empty-catalog paths with appropriate test isolation.
  • The fix preserves existing behavior and adds no breaking changes while addressing the reported issue with GPT-5.4 visibility.

Confidence Score: 5/5

  • Safe to merge. Core bug fix is correct with clean deduplication logic.
  • The PR correctly implements the bug fix for catalog model visibility in models list --all. The supplement-only approach preserves existing behavior, uses seenKeys for precise deduplication, and properly applies auth availability fallback only for truly synthetic rows. Test coverage is focused on the key scenarios (catalog-present and empty-catalog paths). No functional issues identified.
  • No files require special attention.

Last reviewed commit: 5cb8f81

@dorukardahan
Copy link
Copy Markdown
Contributor Author

small status note: i checked the current red CI, and on my read the failures are outside this diff.

  • check, build-artifacts, and install-smoke are failing on current base TS errors in src/agents/provider-capabilities.ts and src/agents/pi-embedded-runner-extraparams.test.ts
  • secrets is failing on .secrets.baseline drift and unrelated test fixtures

i re-ran the focused paths for this change locally and they were green:

  • pnpm exec vitest run src/commands/models/list.list-command.forward-compat.test.ts src/commands/models.list.auth-sync.test.ts
  • pnpm exec vitest run --config vitest.e2e.config.ts src/commands/models.list.e2e.test.ts
  • pnpm build

happy to refresh once base CI is green again if needed.

@dorukardahan
Copy link
Copy Markdown
Contributor Author

synced latest main into this branch.

my fix is still the same: keep discovered --all rows as the base list, then fill only the missing catalog-backed synthetic rows on top.

i also refreshed the focused list tests after upstream config/listing changes landed on main. local checks i re-ran after the sync:

  • pnpm exec vitest run src/commands/models/list.list-command.forward-compat.test.ts src/commands/models.list.auth-sync.test.ts
  • pnpm exec vitest run --config vitest.e2e.config.ts src/commands/models.list.e2e.test.ts
  • pnpm build

@steipete steipete merged commit 3da8882 into openclaw:main Mar 8, 2026
26 of 29 checks passed
@steipete
Copy link
Copy Markdown
Contributor

steipete commented Mar 8, 2026

Landed via temp rebase onto main.

  • Gate: pnpm exec vitest run src/commands/models/list.list-command.forward-compat.test.ts src/commands/models.list.auth-sync.test.ts; pnpm exec vitest run --config vitest.e2e.config.ts src/commands/models.list.e2e.test.ts; pnpm build; pnpm check
  • Land commit: ee38359
  • Merge commit: $(gh pr view 40160 --repo openclaw/openclaw --json mergeCommit --jq '.mergeCommit.oid')

Thanks @dorukardahan!

@dorukardahan
Copy link
Copy Markdown
Contributor Author

Thanks Peter, i appreciate you landing this.

Also good to see you back around GitHub. i had not seen you for a while. glad you are back.

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

Labels

commands Command implementations size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

models list --all bypasses model catalog synthetic fallbacks (e.g. GPT-5.4)

2 participants