Skip to content

fix(models): separate rejected auth from catalog refresh failures - #158207

Merged
steipete merged 1 commit into
mainfrom
fix/catalog-auth-rejected-not-refresh-failure
Sep 25, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/catalog-auth-rejected-not-refresh-failure

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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-qwen provider and its catalog read ends with auth-rejected. models.list then reported refreshFailed: 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 on main (d36ba5479c3): acp-opencode and acp-copilot were ready, acp-qwen was auth-rejected, 99 models listed, banner permanent.

Why This Change Was Made

src/agents/prepared-model-runtime.publication-events.ts classified every non-ready provider 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 only unavailable outcomes and recorded acquisition errors as refresh failures; auth rejections keep their diagnostics and the incomplete-inventory protection. The CLI's duplicate classification in models list is 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

  • Producer tests: auth-rejected alone ⇒ no refresh failure; auth-rejected plus a genuine failure ⇒ refresh failure. Boundary tests for models.list provider outcomes, the native picker failure path, and openclaw models list prepared catalog. Regressions fail on current main.
  • Direct Vitest over the affected suites: 104 passed.
  • Consumers checked: models.list presentation, chat metadata catalogRefreshFailed, /models, CLI models list, picker/search, Automations, Agents, Settings.
  • oxfmt --check, git diff --check pass; 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: docs/cli/models.md notes that rejected sign-in is not reported as a refresh failure.

Production LOC: −1 (+10 / −11). Tests: +109 / −63. Docs: +5.

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.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations agents Agent runtime and tooling labels Sep 25, 2026
@steipete
steipete marked this pull request as ready for review September 25, 2026 16:24
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 25, 2026, 12:33 PM ET / 16:33 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 08e89021c40e4ab464cd5654f1bdf97bd9c9403b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused and covers the distinct outcome cases; repository presentation and test-cost evidence remains to be recorded.
Proof confidence 🌊 off-meta tidepool Not applicable: The author has verified repository admin permission, so the external-contributor proof gate does not apply. The body reports a live before-fix Mac result and after-fix focused tests, but no after-fix rendered capture; the separate screenshot gate remains. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author has verified repository admin permission, so the external-contributor proof gate does not apply. The body reports a live before-fix Mac result and after-fix focused tests, but no after-fix rendered capture; the separate screenshot gate remains. No stored-data contract changes.
Evidence reviewed 12 items Current main still has the defect: The publisher on the fetched main revision treats every non-ready provider or native outcome as a refresh failure.
Introduced classification: The pinned PR delta makes unavailable outcomes and recorded acquisition errors set the warning while retaining auth rejection as a separate outcome.
Incomplete inventory remains guarded: The projected catalog remains non-authoritative when native discovery has a non-ready outcome, independently of whether the refresh warning is set.
Findings None None.
Security None None.

How this fits together

Provider 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]
Loading

Before merge

  • Resolve merge risk (P1) - The changed rendered warning state has no inspected before/after screenshots embedded in the PR; the required originating-chat delivery is unverified.
  • Resolve merge risk (P1) - The modified test files have no measured per-file wall times or CI seconds in the PR body, leaving the repository’s test-cost gate unverified.
  • Complete next step (P2) - Satisfy the before/after UI screenshot gate in the originating chat and PR, then record measured costs for the modified tests.
Agent review details

Security

None.

PR surface

Source -1, Tests +46, Docs +5. Total +50 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 3 10 11 -1
Tests 4 109 63 +46
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 124 74 +50

Review metrics

Metric Value Why it matters
Test cost evidence 4 modified test files; 0 per-file wall times reported The repository requires measured cost for new or materially changed tests.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add P2: A persistent false retry warning affects model-selection UX, but the reported workflow remains usable.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author has verified repository admin permission, so the external-contributor proof gate does not apply. The body reports a live before-fix Mac result and after-fix focused tests, but no after-fix rendered capture; the separate screenshot gate remains. No stored-data contract changes.

Label justifications:

  • P2: A persistent false retry warning affects model-selection UX, but the reported workflow remains usable.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author has verified repository admin permission, so the external-contributor proof gate does not apply. The body reports a live before-fix Mac result and after-fix focused tests, but no after-fix rendered capture; the separate screenshot gate remains. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rank-up moves

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

  • Attach inspected, sanitized before/after Automations screenshots in the originating chat and the PR, verifying that the PR images render.
  • Add measured per-file test wall times and CI seconds to the PR body when the run is available.

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 3685f7a into main Sep 25, 2026
271 of 278 checks passed
@steipete
steipete deleted the fix/catalog-auth-rejected-not-refresh-failure branch September 25, 2026 17:35
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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