Repository navigation
fix(ui): stop restart errors from masquerading as model auth - #125513
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 12:28 AM ET / 04:28 UTC. ClawSweeper reviewWhat this changesThe 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 provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessThe 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 Review scores
Verification
How this fits togetherThe 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]
Decision needed
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
Agent review detailsSecurityNone. PR surfaceSource +31, Tests +323. Total +354 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest 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. 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
HistoryReview history (5 earlier review cycles)
|
d56e00f to
f264f98
Compare
fc16155 to
56b89b5
Compare
56b89b5 to
d3455cb
Compare
|
Land-ready verification for exact head d3455cb0b047961af3b774ff41b8243da4d5e69c. The prior ClawSweeper P1 completed-ready findings are addressed at the shared lifecycle owner: Chat uses Exact-head CI is green: run 32098849212, Local proof:
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. |
|
Merged via squash.
|
…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
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
resolveChatModelCatalogStatehelper is the canonical Chat freshness owner, and both Chat auth gating and New Session'sisModelUnavailablepredicate 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
mainalso contained the task/session suggestion owner extraction needed to keepchat-pane-render.tsbelow the 700-line limit. During the required conflict rebase, the earlier PR-local extraction was dropped in favor of currentmain's stronger combinedsuggestionChatPropsowner. 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 forpaneDomId:chat-composer-view.tsnow imports the pane ID fromchat-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 availablestate 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.mjsthen skipped only that already-proven dead-code lane and completed the remaining changed-gate plan green.git diff --check origin/main...HEAD— passed..claude/skills/autoreview/scripts/autoreview --mode uncommitted --max-priority P1— clean; no accepted/actionable findings, 0.99 correctness.ui/src/pages/model-providers/load.test.ts; the test reproduced locally and was mechanically updated to expect the already-reviewedrefresh: truerequest shape, with no production change.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.
After: an authoritative all-cold catalog retains configured models, authentication guidance, Model Setup, and blocked send/start behavior.
Offline during a lifecycle interruption:
Catalog refresh failure takes precedence over stale unavailable rows:
Recovered after Retry:
[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.