Repository navigation
fix(models): separate rejected auth from catalog refresh failures - #158207
Conversation
Catalog publication treated every non-ready provider outcome as a refresh failure, including installed agent apps whose native sign-in was rejected. Keep auth-rejected outcomes as provider state and reserve refreshFailed for unavailable outcomes or recorded acquisition errors. Preserve incomplete native inventory as non-authoritative through publication and API renewals. Remove the CLI's duplicate outcome classification so models list consumes the same flag as Gateway models.list, chat metadata, /models, and the Control UI. Keep rejected model availability and installed-app sign-in guidance intact. Real partial refresh warnings, including the Automations behavior introduced in #142372, remain visible. Document the distinction in the Models CLI guide. Validation against base 53a0b85: - Before the fix, both reporter cases, three native renewal cases, and the auth-only models.list case failed on refreshFailed=true. The mixed auth-rejected plus unavailable models.list control passed. - After the fix, direct repository Vitest configs with one worker passed: agents 20 tests (94.23s), gateway 13 (76.38s), commands 20 (99.89s), UI catalog store/Automations/installed agents 51 (51.40s): 104 total. - Formatting and git diff --check pass. Independent Codex review found no actionable P0-P2 findings. Production LOC -1; tests +46; docs +5. - The normal test wrapper was stopped after cold subprocess preparation exceeded five minutes. Direct Vitest configs completed the focused proof. - node scripts/check-changed.mjs --base <base> hit a 600s host-load cap in assertion-safety (412.69s). Conflict markers, line-cap, max-lines and env count guards passed; typechecking, linting, and later guards were not reached. Follow-ups: restricted-role catalog presentation lacks scoped failure provenance, so a visible auth rejection can accompany a hidden provider's failure, and unscoped failures can be suppressed. Preserve its disclosure policy here. UI tests also emit obsolete Markdown optimizeDeps, duplicate Lit, and jsdom stylesheet warnings; all selected UI cases pass.
|
Codex review: blocked before merge. Reviewed September 25, 2026, 12:33 PM ET / 16:33 UTC. ClawSweeper reviewWhat this changesThe branch changes model catalog publication and the model-list CLI so rejected provider sign-in does not trigger a refresh warning, with supporting docs and tests. Merge readiness⛔ Blocked before merge - 3 items remain Keep open. Current main still marks rejected authentication as a catalog refresh failure, and no merged related PR resolves that false warning. The patch is focused and no concrete code defect was found. Priority: P2 Review scores
Verification
How this fits togetherProvider and installed-agent discovery feed OpenClaw’s prepared model catalog. The Gateway publishes its model choices and status to the CLI and Control UI, which use them for retry warnings and sign-in guidance. flowchart LR
A[Provider discovery] --> C[Prepared catalog]
B[Installed agent discovery] --> C
C --> D{Outcome type}
D --> E[Refresh warning status]
D --> F[Sign in status]
E --> G[Gateway model list]
F --> G
G --> H[CLI and Control UI]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -1, Tests +46, Docs +5. Total +50 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one catalog publisher responsible for refresh status while preserving separate sign-in guidance and non-authoritative inventory; verify the resulting UI states and focused test cost before landing. Do we have a high-confidence way to reproduce the issue? Yes. On current main, an installed but signed-out ACP agent can produce auth-rejected, and the publisher’s non-ready check then sets refreshFailed; the PR reports the resulting Automations banner from a live Mac. This review did not execute the flow. Is this the best way to solve the issue? Yes. A shared publisher decision gives Gateway, CLI, and UI consumers consistent status while retaining separate auth diagnostics and the incomplete-inventory guard. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f4151933b8ff. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…enclaw#158207) Catalog publication treated every non-ready provider outcome as a refresh failure, including installed agent apps whose native sign-in was rejected. Keep auth-rejected outcomes as provider state and reserve refreshFailed for unavailable outcomes or recorded acquisition errors. Preserve incomplete native inventory as non-authoritative through publication and API renewals. Remove the CLI's duplicate outcome classification so models list consumes the same flag as Gateway models.list, chat metadata, /models, and the Control UI. Keep rejected model availability and installed-app sign-in guidance intact. Real partial refresh warnings, including the Automations behavior introduced in openclaw#142372, remain visible. Document the distinction in the Models CLI guide. Validation against base 7f20f56: - Before the fix, both reporter cases, three native renewal cases, and the auth-only models.list case failed on refreshFailed=true. The mixed auth-rejected plus unavailable models.list control passed. - After the fix, direct repository Vitest configs with one worker passed: agents 20 tests (94.23s), gateway 13 (76.38s), commands 20 (99.89s), UI catalog store/Automations/installed agents 51 (51.40s): 104 total. - Formatting and git diff --check pass. Independent Codex review found no actionable P0-P2 findings. Production LOC -1; tests +46; docs +5. - The normal test wrapper was stopped after cold subprocess preparation exceeded five minutes. Direct Vitest configs completed the focused proof. - node scripts/check-changed.mjs --base <base> hit a 600s host-load cap in assertion-safety (412.69s). Conflict markers, line-cap, max-lines and env count guards passed; typechecking, linting, and later guards were not reached. Follow-ups: restricted-role catalog presentation lacks scoped failure provenance, so a visible auth rejection can accompany a hidden provider's failure, and unscoped failures can be suppressed. Preserve its disclosure policy here. UI tests also emit obsolete Markdown optimizeDeps, duplicate Lit, and jsdom stylesheet warnings; all selected UI cases pass. Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
On a Mac where an ACP-capable CLI is installed but not signed in (here the Qwen CLI), OpenClaw auto-detects the
acp-qwenprovider and its catalog read ends withauth-rejected.models.listthen reportedrefreshFailed: true, so the Control UI Automations page (and other catalog consumers) showed "Some models could not be refreshed. Open Models to try again." on every visit. Retrying can never clear it, because the provider's auth is rejected, not transiently failing. Observed live onmain(d36ba5479c3):acp-opencodeandacp-copilotwereready,acp-qwenwasauth-rejected, 99 models listed, banner permanent.Why This Change Was Made
src/agents/prepared-model-runtime.publication-events.tsclassified every non-readyprovider outcome as a refresh failure. A rejected credential is a determinate provider state that is already surfaced per model (availability: false,unavailableReason: "auth-failed") and, for installed ACP apps, as "Sign in required" in the picker. The publisher now counts onlyunavailableoutcomes and recorded acquisition errors as refresh failures; auth rejections keep their diagnostics and the incomplete-inventory protection. The CLI's duplicate classification inmodels listis removed so it reads the same published fact.Genuine refresh failures (timeouts, malformed catalogs, internal errors — the case #142372 surfaces) still set
refreshFailed.User Impact
Having an installed-but-signed-out ACP CLI no longer puts a permanent "try again" warning on Automations, model search, and pickers; the provider still shows as needing sign-in.
Evidence
models.listprovider outcomes, the native picker failure path, andopenclaw models listprepared catalog. Regressions fail on currentmain.models.listpresentation, chat metadatacatalogRefreshFailed,/models, CLImodels list, picker/search, Automations, Agents, Settings.oxfmt --check,git diff --checkpass; Codex autoreview scoped-clean ("patch is correct"). The repo-wide assertion-safety scan did not finish locally under extreme host load; CI is authoritative.docs/cli/models.mdnotes that rejected sign-in is not reported as a refresh failure.Production LOC: −1 (+10 / −11). Tests: +109 / −63. Docs: +5.