Skip to content

fix(cli): resolve plugin-catalog metadata for configured models list rows - #115190

Merged
steipete merged 1 commit into
mainfrom
steipete/jovial-hugle-f415d3
Jul 28, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/jovial-hugle-f415d3

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw models list (the default configured view) and openclaw models list --all disagree about plugin-catalog models referenced from agents.defaults.model.fallbacks. With fallbacks: ["kimi/k3"] and the bundled kimi provider plugin authenticated:

$ openclaw models list --all | grep '^kimi/k3 '
kimi/k3              text+image 1049k  no  yes  fallback#1

$ openclaw models list | grep '^kimi/k3 '
kimi/k3              text       200k   no  yes  fallback#1     <-- wrong

The configured view synthesized a placeholder row (input: ["text"], contextWindow: DEFAULT_CONTEXT_TOKENS = 200_000) for any configured/default/fallback ref that is not declared in cfg.models.providers — which is exactly the case for plugin-catalog models. Display-only: the runtime resolves the real catalog entry (contextTokenBudget: 1048576 on a live openclaw agent --local --model kimi/k3 run).

Why This Change Was Made

The cheap default view emits configured rows first via appendConfiguredRows without a model registry, so toFallbackConfiguredListModel fell through to the hardcoded placeholder. The real catalog row was appended later by appendAuthenticatedCatalogRows from the prepared catalog snapshot, but by then the key was already in seenKeys and got skipped.

Fix: appendConfiguredModelRowSources now loads the prepared model catalog snapshot once up front and threads it into both appendConfiguredRows (which resolves configured refs against it before falling back to the placeholder) and appendAuthenticatedCatalogRows (which previously did its own load) — one catalog load per listing, same committed generation for every row source. Precedence per row: explicit cfg.models.providers definition → prepared catalog entry → placeholder, so user-authored provider metadata stays authoritative. The two duplicated inline snapshot-load blocks in list.rows.ts are folded into a shared loadListModelCatalogSnapshot.

User Impact

openclaw models list now shows the same context window and input modalities as --all for plugin-catalog models tagged default, fallback#N, image, or configured. Previously users could conclude a fallback model had a 200k text-only budget when the runtime actually uses the full catalog entry (1M+ multimodal for kimi/k3).

Evidence

  • Regression test: src/commands/models/list.configured.test.ts — drives resolveConfiguredEntries → appendConfiguredModelRowSources with a plugin-catalog kimi/k3 in fallbacks; asserts text+image/1_048_576/fallback#1, that explicit models.providers metadata beats a conflicting catalog row, that unknown refs keep the placeholder, and that the snapshot loads exactly once. Fails against unfixed code with the reported symptom.
  • Live proof (isolated OPENCLAW_STATE_DIR, kimi plugin enabled, kimi auth present):
    • baseline (fresh build without the fix): kimi/k3 text 200k fallback#1 — bug reproduced
    • with fix: kimi/k3 text+image 1049k fallback#1 in both models list and models list --all
  • node scripts/run-vitest.mjs src/commands/models/list — 8 files, 72 tests green
  • node scripts/run-vitest.mjs src/commands/models.list.e2e.test.ts — 21 tests green
  • tsgo core + test-src typechecks green; oxfmt/oxlint clean
  • Codex autoreview (gpt-5.6-sol): first pass flagged catalog-over-configured precedence; fixed and re-reviewed clean

@steipete
steipete marked this pull request as ready for review July 28, 2026 12:34
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S maintainer Maintainer-authored PR labels Jul 28, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 8:38 AM ET / 12:38 UTC.

ClawSweeper review

What this changes

The branch makes configured openclaw models list rows resolve plugin-catalog metadata before using generic placeholder model details, so fallback and default rows match the richer --all view.

Merge readiness

⚠️ Needs maintainer review before merge - 2 items remain

Keep this PR open for normal maintainer review. The supplied PR evidence describes a focused display-metadata correction with live before/after CLI output and targeted regression coverage, but the current-main source and merge-result audit could not be completed because read-only shell inspection was blocked by the sandbox. Likely related people: steipete is the implementation author and has the clearest current context for the intended catalog precedence; historical ownership remains unconfirmed.

Priority: P2
Reviewed head: 39892d45c771d604e5467cc77432b96be9b7b2f4

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The reported live CLI proof and focused tests are useful, but independent current-main and three-way merge inspection was not possible in this environment.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body supplies an isolated real CLI before/after run for the reported kimi/k3 fallback case, and the supplied checks show a successful Real behavior proof run.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body supplies an isolated real CLI before/after run for the reported kimi/k3 fallback case, and the supplied checks show a successful Real behavior proof run.
Evidence reviewed 5 items Focused implementation path: The supplied branch patch loads one prepared catalog snapshot before configured rows, passes it to configured-row resolution, and reuses it for authenticated catalog rows; explicit models.providers metadata remains first in the stated precedence.
Fallback resolution behavior: The supplied patch changes fallback configured rows from an unconditional generic placeholder to explicit provider metadata, then a prepared catalog entry, then the placeholder.
Regression coverage: The PR body identifies coverage for a plugin-catalog fallback, explicit-config precedence, unknown-reference placeholders, and a single snapshot load.
Findings None None.
Security None None.

How this fits together

The model-list CLI combines configured model references, explicit provider configuration, and prepared plugin-catalog entries into display rows. The resulting rows show operators each model's modalities, context budget, and configured/default/fallback role without changing runtime model selection.

flowchart LR
  A[OpenClaw configuration] --> C[Configured model references]
  B[Prepared plugin catalog] --> D[Metadata precedence]
  C --> D
  D --> E[Configured model rows]
  E --> F[Models list CLI output]
  B --> G[All catalog rows]
  G --> F
Loading

Before merge

  • Resolve merge risk (P1) - The PR head is reported behind main; before landing, refresh the three-way merge review against current main and confirm the prepared-catalog loading contract still has the intended single-load and read-only behavior.
  • Complete next step (P2) - The PR has protected maintainer labeling and needs a current-main merge refresh rather than an automated repair; no concrete patch defect was established.
Agent review details

Security

None.

PR surface

Source +23, Tests +111. Total +134 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 55 32 +23
Tests 1 111 0 +111
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 166 32 +134

Review metrics

None.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/commands/models/list.configured.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase or refresh the merge result, then confirm the shared prepared-catalog snapshot preserves explicit configured-provider precedence and the reported CLI output before merging.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase or refresh the merge result, then confirm the shared prepared-catalog snapshot preserves explicit configured-provider precedence and the reported CLI output before merging.

Do we have a high-confidence way to reproduce the issue?

No independent high-confidence reproduction was completed because sandbox restrictions blocked read-only repository inspection and execution. The PR nevertheless provides a concrete isolated configuration, baseline CLI output, after-fix output, and focused regression-test path.

Is this the best way to solve the issue?

Unclear pending a current-main and merge-result audit. The stated explicit-config → prepared-catalog → placeholder precedence is a narrow maintainable direction if it matches the existing prepared-catalog contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 74954fd931e0.

Labels

Label changes:

  • add P2: This is a bounded CLI correctness repair: configured plugin-catalog model rows can otherwise display misleading capabilities and context budgets.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies an isolated real CLI before/after run for the reported kimi/k3 fallback case, and the supplied checks show a successful Real behavior proof run.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body supplies an isolated real CLI before/after run for the reported kimi/k3 fallback case, and the supplied checks show a successful Real behavior proof run.

Label justifications:

  • P2: This is a bounded CLI correctness repair: configured plugin-catalog model rows can otherwise display misleading capabilities and context budgets.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body supplies an isolated real CLI before/after run for the reported kimi/k3 fallback case, and the supplied checks show a successful Real behavior proof run.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies an isolated real CLI before/after run for the reported kimi/k3 fallback case, and the supplied checks show a successful Real behavior proof run.

Evidence

What I checked:

  • Focused implementation path: The supplied branch patch loads one prepared catalog snapshot before configured rows, passes it to configured-row resolution, and reuses it for authenticated catalog rows; explicit models.providers metadata remains first in the stated precedence. (src/commands/models/list.row-sources.ts:70, 39892d45c771)
  • Fallback resolution behavior: The supplied patch changes fallback configured rows from an unconditional generic placeholder to explicit provider metadata, then a prepared catalog entry, then the placeholder. (src/commands/models/list.rows.ts:424, 39892d45c771)
  • Regression coverage: The PR body identifies coverage for a plugin-catalog fallback, explicit-config precedence, unknown-reference placeholders, and a single snapshot load. (src/commands/models/list.configured.test.ts:202, 39892d45c771)
  • Real behavior evidence: The PR body reports an isolated live baseline of kimi/k3 as text-only/200k and an after-fix result of text+image/1049k in both configured and --all views; the supplied check state also includes a successful Real behavior proof run. (39892d45c771)
  • Inspection limitation: The required read-only repository inspection command was rejected before execution by the environment sandbox (bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted), so current-main callers, history, scoped guidance, and exact merge result were not independently verified.

Likely related people:

  • steipete: The supplied PR body gives the concrete catalog-precedence rationale and the branch introduces the focused repair; broader current-main feature-history ownership could not be verified after sandbox read access failed. (role: implementation author and likely follow-up owner; confidence: low; commits: 39892d45c771; files: src/commands/models/list.row-sources.ts, src/commands/models/list.rows.ts, src/commands/models/list.configured.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase or otherwise refresh the branch against current main, then confirm the focused configured-model listing tests and live CLI scenario on the resulting merge candidate.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 3951b42 into main Jul 28, 2026
182 of 193 checks passed
@steipete
steipete deleted the steipete/jovial-hugle-f415d3 branch July 28, 2026 12:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

commands Command implementations maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant