Skip to content

fix(ui): stop restart errors from masquerading as model auth - #125513

Merged
steipete merged 4 commits into
mainfrom
steipete/team-server-issue-497efa
Aug 18, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/team-server-issue-497efa

Conversation

@steipete

@steipete steipete commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #125509

What Problem This Solves

Fixes an issue where opening the model picker during a Gateway restart, reconnect, or failed catalog refresh could show actionable authentication-failure guidance—and duplicate it in the composer—even when provider credentials were healthy.

The completed-ready catalog P1 findings in the durable ClawSweeper review are addressed: cached all-cold rows no longer auth-block Chat or New Session while catalog metadata is pending. Authentication gating now consumes availability only after the canonical catalog state is exactly ready.

Why This Change Was Made

The catalog state now treats connection and refresh freshness as authoritative before model availability. Empty, offline, refresh-error, refreshing, and authoritative all-cold states are distinct. The shared resolveChatModelCatalogState helper is the canonical Chat freshness owner, and both Chat auth gating and New Session's isModelUnavailable predicate use completed-ready state as the authority boundary.

Deferred reconnect/startup browser coverage proves that a stale all-cold cache remains visible but does not auth-block while metadata is pending, then a completed ready all-cold response restores the intended block. A cached-refreshing New Session regression covers the same boundary. Retry still bypasses both browser and Gateway catalog caches, while the visible composer reason remains the single explanation owner for disabled input.

Current main also contained the task/session suggestion owner extraction needed to keep chat-pane-render.ts below the 700-line limit. During the required conflict rebase, the earlier PR-local extraction was dropped in favor of current main's stronger combined suggestionChatProps owner. Before that rebase the renderer was 675 effective / 688 physical lines; the rebased renderer is 602 physical lines.

The latest integration rebase also followed current main's ownership move for paneDomId: chat-composer-view.ts now imports the pane ID from chat-composer-dom.ts, its current owner, rather than from the slash-menu module that no longer exports it.

User Impact

Operators now see Offline or catalog-refresh guidance during lifecycle interruptions, a generic No models available state for genuinely empty catalogs, and authentication recovery only when a completed authoritative catalog supports that diagnosis. Reconnect or Retry restores the picker without unnecessary credential churn. Model Setup remains available for empty catalogs, while ready all-cold catalogs still block send/start and show the configured unavailable models and recovery guidance.

Evidence

The original live incident was correlated with a service restart and later successful HTTP 200 provider calls. The deterministic browser proof in this PR uses the mocked Gateway; the exact production auto-update restart was not repeated. Related history #121852 and #123130 informed the lifecycle context.

  • node scripts/run-vitest.mjs ui/src/pages/chat/chat-composer.test.ts ui/src/pages/chat/chat-pane-session-controls.test.ts ui/src/pages/chat/chat-view.test.ts ui/src/pages/chat/models.test.ts ui/src/pages/model-providers/load.test.ts ui/src/pages/new-session/model-control.test.ts — latest integration/import proof: 6 focused unit files, 334 tests passed. The completed-ready repair was also proven earlier across 7 focused files with 345 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-composer-redesign.e2e.test.ts — 1 file, 3 tests passed for the latest integration/import proof.
  • node scripts/check-changed.mjs — the first broad run hit the 10-minute harness timeout only after the full dead-code scan plus i18n and type checks passed. OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1 node scripts/check-changed.mjs then skipped only that already-proven dead-code lane and completed the remaining changed-gate plan green.
  • git diff --check origin/main...HEAD — passed.
  • Fresh uncommitted autoreview covering the import fix: .claude/skills/autoreview/scripts/autoreview --mode uncommitted --max-priority P1 — clean; no accepted/actionable findings, 0.99 correctness.
  • Two flaky remote UI E2E shards on the prior head reproduced locally as 28/28 passing. Exact-head CI on the current rebased head is authoritative for landing.
  • Earlier exact-head CI run 32091150641 found one stale sibling expectation in ui/src/pages/model-providers/load.test.ts; the test reproduced locally and was mechanically updated to expect the already-reviewed refresh: true request shape, with no production change.
  • Exact triple-dot patch against rebase base 9de3ca5fc93d77b358403ffae15879380a241f72: production +81/-50 (net +31), tests +344/-21 (net +323), 15 UI files total. Current head: d3455cb0b047961af3b774ff41b8243da4d5e69c.

Visual proof

Before: restart-time stale availability was presented as duplicate authentication guidance.

Before: duplicate authentication guidance

After: an authoritative all-cold catalog retains configured models, authentication guidance, Model Setup, and blocked send/start behavior.

After: authoritative all-cold catalog

Offline during a lifecycle interruption:

Offline catalog state

Catalog refresh failure takes precedence over stale unavailable rows:

Catalog refresh error state

Recovered after Retry:

Recovered model catalog

[email protected]

The executable browser E2E owns the deferred reconnect, ready transition, Retry request, and queue/action clauses that a short recording cannot establish on its own.

AI-assisted: Yes.

@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 18, 2026 02:14
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 18, 2026
@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 Aug 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 12:28 AM ET / 04:28 UTC.

ClawSweeper review

What this changes

The PR separates model-catalog freshness from model availability in the Control UI, updates retry behavior and disabled-reason accessibility, and adds lifecycle regression coverage.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

The patch correctly makes model availability authoritative only after catalog completion across chat and new-session flows. It remains open for maintainer proof judgment and the in-progress exact-head checks.

Priority: P1
Reviewed head: d3455cb0b047961af3b774ff41b8243da4d5e69c
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source repair and cross-surface tests are strong, while the reported production restart was not repeated in the supplied evidence.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its mocked browser evidence is useful, while the un-repeated live restart remains a separate maintainer proof decision.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its mocked browser evidence is useful, while the un-repeated live restart remains a separate maintainer proof decision.
Evidence reviewed 8 items Current-main defect path: The current-main base fed cached catalog rows directly to the chat unavailable predicate, so an all-cold stale snapshot could block the composer without considering connection or refresh state.
Canonical freshness owner: The PR introduces one resolver that prioritizes offline and refresh-error state over cached availability and returns ready only after loading completes.
Chat gate consumes completed state: The chat renderer now passes catalog rows to the unavailable predicate only when the shared state is ready.
Findings None None.
Security None None.

How this fits together

The Control UI receives model metadata from the Gateway and uses it in the chat composer and new-session picker. Catalog freshness determines whether users see connection guidance, an empty-catalog state, or provider-auth recovery and a blocked action.

flowchart LR
  Gateway[Gateway catalog response] --> Cache[Cached model rows]
  Cache --> Resolver[Catalog freshness resolver]
  Gateway --> Resolver
  Resolver --> Picker[Picker status and retry]
  Resolver --> Composer[Composer send gate]
  Resolver --> Session[New-session gate]
Loading

Decision needed

Question Recommendation
Should this PR obtain an isolated live Gateway restart/reconnect recording before merge, or is the mocked browser proof plus incident evidence sufficient for this lifecycle repair? Capture isolated lifecycle proof: Record a redacted Control UI flow against an isolated Gateway restart or reconnect showing healthy credentials, connection guidance during interruption, and recovery afterward.

Why: The source repair and deterministic coverage are coherent, but the PR explicitly does not repeat the production restart path required by repository live-verification guidance.

Before merge

  • Resolve merge risk (P1) - The PR body says the actual production auto-update restart was not rerun; mocked browser coverage proves the state boundary but not that live lifecycle sequence.
  • Resolve merge risk (P1) - Judged production growth is net +28 lines; it is justified by the shared freshness state and retry contract, but no net-neutral deletion is apparent without reintroducing duplicated policy.
  • Resolve merge risk (P1) - Exact-head CI remains in progress and must finish green before merge.
  • Complete next step (P2) - No mechanical repair is indicated; the remaining work is proof sufficiency, exact-head CI completion, and protected maintainer handling.
Agent review details

Security

None.

PR surface

Source +31, Tests +323. Total +354 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 9 81 50 +31
Tests 6 344 21 +323
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 425 71 +354

Review metrics

Metric Value Why it matters
Production versus test delta production +78/-50 (net +28); tests +347/-21 (net +326) Production growth implements one shared catalog-freshness policy and refresh forwarding; the larger test delta covers lifecycle transitions across chat and new-session surfaces.

Stored data model

Persistent data-model change detected: vector/embedding metadata: ui/src/pages/chat/chat-pane-session-controls.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #125509
Summary: This PR is the candidate implementation for the linked stale-catalog authentication diagnosis regression.

Members:

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

Merge-risk options

Maintainer options:

  1. Capture lifecycle proof (recommended)
    Before merge, attach a redacted isolated Gateway restart or reconnect recording that confirms healthy credentials do not produce authentication guidance.
  2. Accept mocked boundary evidence
    Maintainers may accept the focused mocked-Gateway regression coverage and documented incident without repeating a live restart.

Technical review

Best possible solution:

Keep the shared completed-ready boundary, then attach isolated live restart/reconnect proof or explicitly accept that gap before merging; the small production growth is justified because collapsing it would duplicate or blur freshness policy again.

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

Yes: current-main source directly passes stale catalog rows to both unavailability gates, and the PR supplies focused browser and unit scenarios for offline, refresh-error, ready, retry, and recovery states.

Is this the best way to solve the issue?

Yes: one freshness resolver feeding both affected gates is the narrowest maintainable repair; the remaining question is live lifecycle proof, not the source-level fix shape.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9de3ca5fc93d.

Labels

Label changes:

  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. This maintainer-authored PR is outside the external-contributor proof gate; its mocked browser evidence is useful, while the un-repeated live restart remains a separate maintainer proof decision.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P1: The repair addresses a Control UI workflow that can misdiagnose healthy credentials and temporarily block chat or session creation during Gateway lifecycle interruptions.
  • merge-risk: 🚨 auth-provider: The patch changes when cached model availability is interpreted as provider-authentication failure and a user-facing send/start gate.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its mocked browser evidence is useful, while the un-repeated live restart remains a separate maintainer proof decision.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. This maintainer-authored PR is outside the external-contributor proof gate; its mocked browser evidence is useful, while the un-repeated live restart remains a separate maintainer proof decision.

Evidence

What I checked:

Likely related people:

  • steipete: Current-head blame attributes the shared freshness resolver and its chat consumer to this contributor; related merged catalog-state work also came from this area. (role: recent area contributor; confidence: high; commits: d3455cb0b047, be7f3225f722; files: ui/src/pages/chat/chat-pane-session-controls.ts, ui/src/pages/chat/chat-pane-render.ts, ui/src/pages/new-session/model-control.ts)
  • Patrick-Erichsen: The merged unavailable-model policy cited by this PR established the catalog behavior that this freshness fix preserves. (role: adjacent feature contributor; confidence: medium; commits: ad704f35c4fa; files: ui/src/pages/chat/components/chat-model-picker.ts)

Rank-up moves

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

  • Resolve the live lifecycle-proof decision.
  • Wait for the remaining exact-head checks to finish green.

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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-08-18T02:21:49.987Z sha 133cf9c :: needs maintainer review before merge. :: none
  • reviewed 2026-08-18T02:32:53.730Z sha d56e00ff7c0ed940d66d8cc2355d18b39f7e4f94 :: found issues before merge. :: [P1] Gate composer auth only on a completed catalog | [P1] Do not block New Session on refreshing cached metadata
  • reviewed 2026-08-18T03:04:57.623Z sha f264f98b0eaded8c0a7421a1ade2a759c8b8131d :: needs changes before merge. :: [P1] Gate composer auth only on a completed catalog | [P1] Do not block New Session on refreshing cached metadata
  • reviewed 2026-08-18T03:38:27.367Z sha fc1615597336fc1970412313f043a8e76e854eb0 :: found issues before merge. :: [P1] Keep pending startup catalogs non-authoritative
  • reviewed 2026-08-18T03:54:00.815Z sha 56b89b5acb54f8fd4c22354abd651d196584fa83 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 Aug 18, 2026
@steipete
steipete force-pushed the steipete/team-server-issue-497efa branch from d56e00f to f264f98 Compare August 18, 2026 02:56
@steipete steipete self-assigned this Aug 18, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. labels Aug 18, 2026
@steipete
steipete force-pushed the steipete/team-server-issue-497efa branch from fc16155 to 56b89b5 Compare August 18, 2026 03:47
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 18, 2026
@steipete
steipete force-pushed the steipete/team-server-issue-497efa branch from 56b89b5 to d3455cb Compare August 18, 2026 04:21
@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. 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 Aug 18, 2026
@steipete

steipete commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready verification for exact head d3455cb0b047961af3b774ff41b8243da4d5e69c.

The prior ClawSweeper P1 completed-ready findings are addressed at the shared lifecycle owner: Chat uses resolveChatModelCatalogState, and New Session now treats unavailable-model metadata as authoritative only after a completed ready catalog. Deferred reconnect/startup coverage preserves a visible stale cache without auth-blocking until the ready response arrives. The latest integration-only fix imports paneDomId from its current chat-composer-dom.ts owner after current main moved that export.

Exact-head CI is green: run 32098849212, pull_request, head d3455cb0b047961af3b774ff41b8243da4d5e69c. The rebase base was 9de3ca5fc93d77b358403ffae15879380a241f72; git range-diff showed all four reviewed commits patch-identical. The exact triple-dot patch is 15 UI files: production +81/-50 (net +31), tests +344/-21 (net +323).

Local proof:

  • node scripts/run-vitest.mjs ui/src/pages/chat/chat-composer.test.ts ui/src/pages/chat/chat-pane-session-controls.test.ts ui/src/pages/chat/chat-view.test.ts ui/src/pages/chat/models.test.ts ui/src/pages/model-providers/load.test.ts ui/src/pages/new-session/model-control.test.ts — 6 files, 334 tests passed for the latest integration/import state.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-composer-redesign.e2e.test.ts — 3/3 passed.
  • Earlier completed-ready proof: 7 focused unit files, 345 tests passed.
  • node scripts/check-changed.mjs — the first broad run reached the 10-minute harness timeout only after the full dead-code scan, i18n checks, and type checks passed. OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1 node scripts/check-changed.mjs skipped only that already-proven dead-code lane and completed the remaining plan green.
  • git diff --check 9de3ca5fc93d77b358403ffae15879380a241f72...d3455cb0b047961af3b774ff41b8243da4d5e69c — passed.
  • .claude/skills/autoreview/scripts/autoreview --mode uncommitted --max-priority P1 — fresh import-fix review clean, 0.99 correctness.
  • Two flaky remote UI E2E shards on the prior head reproduced locally as 28/28 passing; the exact-head CI above is authoritative.

The PR body retains the before, authoritative all-cold, offline, refresh-error, recovered, and video visual proof. That proof is mocked-Gateway browser evidence; the exact production auto-update restart was not repeated, so no claim of live authenticated reproduction is being made.

The completed current-head ClawSweeper review reports no actionable findings and 5/6 patch quality. Its rank-up moves were a green exact-head rollup and a decision on isolated live lifecycle proof. The rollup is green. For this deterministic UI owner repair, the authorized maintainer landing accepts the focused mocked-Gateway boundary proof and documented incident evidence; the optional isolated live restart recording is not required for this landing, and the gap remains explicit above.

@steipete
steipete merged commit 0776c46 into main Aug 18, 2026
155 checks passed
@steipete
steipete deleted the steipete/team-server-issue-497efa branch August 18, 2026 04: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 Aug 20, 2026
…w#125513)

* fix(ui): distinguish model catalog freshness errors

* test(ui): cover refreshed configured model load

* fix(ui): wait for fresh model catalogs before auth gating

* fix(ui): import pane ids from composer owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P1 High-priority user-facing bug, regression, or broken workflow. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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.

[Bug]: Model picker reports authentication failure during Gateway restart

1 participant