Skip to content

fix(models): show catalog authentication rejections in models list - #167128

Open
tianhaotian wants to merge 1 commit into
openclaw:mainfrom
tianhaotian:fix/models-catalog-rejection-diagnostics
Open

tianhaotian wants to merge 1 commit into
openclaw:mainfrom
tianhaotian:fix/models-catalog-rejection-diagnostics

Conversation

@tianhaotian

@tianhaotian tianhaotian commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Related: #166875

What Problem This Solves

Fixes: openclaw models list silently shows an empty or partial catalog when the published catalog reports rejected provider authentication without refreshFailed.

User Impact

Users now see provider/profile-specific discovery guidance on stderr in human, JSON, and plain modes. JSON also exposes the published providerOutcomes; available model rows and plain stdout remain usable.

This addresses the reproducible CLI diagnostic gap in #166875. It does not establish or repair the reported xAI subscription entitlement or request-routing behavior. Outcomes describe the whole catalog, even when model rows are filtered.

Why This Change Was Made

The catalog already publishes ready, auth-rejected, and unavailable outcomes. The CLI now preserves those public facts, sanitizes terminal labels, and keeps authentication rejection separate from the generic refresh-failure warning. It does not manufacture models or change discovery/authentication policy.

Evidence

  • Regression first: the prepared-catalog command suite had 7 failures before the change (26.61s wrapper wall time), including rejection without refreshFailed, empty/filtered catalogs, and JSON/plain output. After the change: 23/23 passed (24.61s wrapper, 22.15s Vitest) using pnpm test src/commands/models/list.prepared-catalog.test.ts --maxWorkers=1.
  • pnpm build passed (159.21s wall time; non-fatal UI startup gzip budget warning: 364.8 KiB vs 364.7 KiB).
  • Built CLI proof on commit 1d4a7a9b41: all five pnpm openclaw --profile catalog-proof-166875 models list scenarios passed against an isolated WebSocket catalog fixture (8.74s total). Empty human/JSON/plain catalogs all emitted the authentication diagnostic with exit 0; retained JSON/plain catalogs kept the available model. JSON included only public provider outcomes; plain stdout contained only model keys. No generic refresh warning was emitted when refreshFailed was absent.
  • check:changed: production and all six selected test type graphs passed, along with initial guards. The full-tree dead-export scan fails on the same five symbols at pristine baseline 0043bb028914e6f92632623a99b482a8cd93b3b5 (independently reproduced in 52.88s): LocalRemoteShellSpawnResult in src/agents/sandbox/remote-fs-bridge.test-helpers.ts, plus TURN_MODEL_PERSISTED_CHANNEL_REF, TURN_MODEL_PERSISTED_PEER_REF, TURN_MODEL_SESSION_REF, and TurnModelSelectionPath in src/test-utils/turn-model-selection-differential.ts. No unrelated baseline edits are included. All nine checks after that scan were run separately and passed, including changed-file type-aware lint, state-schema and database guards, import cycles, and pairing/webhook checks.
  • Fresh independent autoreview: scoped-clean through P2; no accepted findings.
  • Environment: macOS arm64, Node 24.19.0, repository-pinned pnpm 12.5.1. First PR CI completed with 52 passing checks and 54 skipped checks. The prepared-catalog suite passed 23/23 in 10.06s Vitest / 11.82s wrapper (CI job). The full repository test suite and live provider entitlement were not exercised.

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: S labels Oct 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 6:37 AM ET / 10:37 UTC (Revision 2).

ClawSweeper review

What this changes

The branch displays provider-specific discovery diagnostics on stderr and includes public catalog outcomes in model-list JSON.

Example: The user lists an empty xai catalog using profile xai:work.

  • Before: The command prints “No models found.” without explaining the published authentication rejection.
  • After: It also reports authentication rejection for xai (profile xai:work), directs the user to Models in the Control UI, and suggests retrying with --refresh.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct, and proven diagnostic repair that addresses only part of the broader linked report.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The contributor reports after-fix runs of the built models-list CLI through an isolated WebSocket catalog fixture on macOS arm64, observing rejection diagnostics in human, JSON, and plain modes with retained rows and clean stdout. This covers the changed CLI presentation owner; live xAI eligibility is outside the patch, and no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Users see an empty or partial model list without learning that catalog authentication was rejected.
Reason: The silent diagnostic omission has a concrete existing input and a small presentation repair. The linked issue's broader provider claims remain outside this deliberately bounded change.

Merge readiness

✅ Ready for maintainer review

This PR remains useful because current main still omits catalog authentication diagnostics. No actionable correctness or security finding remains, and the supplied CLI proof covers the changed presentation boundary.

Priority: P2
Reviewed head: 1d4a7a9b41e23a91baed589350d0a39494d7d171

Before merge

None.

Findings

None.

Agent review details

How this fits together

The model-list CLI reads models and discovery outcomes published by the selected Gateway or local catalog owner. It presents these facts as a table, JSON, or plain model keys.

flowchart TD
 A[User lists models] --> B[Selected Gateway or local catalog]
 B --> C[Published models and discovery outcomes]
 C --> D[Present discovery diagnostics]
 D --> E[Stderr with recovery guidance]
 C --> F[Render requested output]
 F --> G[Table, JSON, or model keys]
Loading

Technical review

Best possible solution:

Present the catalog owner's existing failure facts at the CLI boundary and investigate the remaining xAI entitlement and routing claims separately.

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

Yes: an auth-rejected provider outcome without refreshFailed deterministically receives no provider diagnostic on current main. Source and existing coverage establish the trigger; this review did not execute code.

Is this the best way to solve the issue?

Yes for the diagnostic gap: displaying already-published facts is a narrow repair that preserves discovery ownership and avoids speculative authentication or routing changes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5e8fbaf8b422.

Provenance checked

  • src/commands/models/list.list-command.ts: published-catalog consumption keeps the original intent (refactor(models): read published catalog inventory through the Gateway #142063: Read the selected Gateway's published inventory without competing local discovery or secret resolution; explicit refresh owns acquisition.)
  • src/commands/models/list.list-command.ts, docs/cli/models.md, and prepared-catalog coverage: rejection classification keeps the original intent (fix(models): separate rejected auth from catalog refresh failures #158207: Treat rejected authentication as provider state rather than a transient refresh failure, and consume the publisher's refreshFailed fact.)
  • src/commands/models/list.table.ts: JSON output keeps the original intent (4ee41cc: Separate JSON payload output from logging.)

Testing

Proof path: shipped entry point. Added test files: 1.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 3685f7a adds src/commands/models/list.list-command.ts:133 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3685f7a7fb22; files: src/commands/models/list.list-command.ts)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

PR surface

Source +25, Tests +79, Docs +9. Total +113 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 27 2 +25
Tests 1 81 2 +79
Docs 1 13 4 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 121 8 +113

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #166875
Summary: This PR is a candidate repair for the linked issue's diagnostic omission, not its broader entitlement and routing claims.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded CLI diagnostic repair that does not change provider entitlement, authentication, or routing.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-08T10:23:14.799Z sha 1d4a7a9 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 8, 2026

This branch has not been deployed

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

Labels

commands Command implementations docs Improvements or additions to documentation 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