Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
c1e389b to
c145cc8
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 10:23 PM ET / August 22, 2026, 02:23 UTC. ClawSweeper reviewWhat this changesThe branch revalidates the Control UI chat model catalog on picker open at most once every five minutes per browser client and agent, while joining concurrent refreshes and preserving explicit force refresh. Regression provenancePossible regression — suspected (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessNo blocking patch defect was found: the change keeps revalidation in the Control UI cache owner and exercises the Gateway’s existing refresh contract. This PR remains necessary because current main still lacks picker-open bounded refresh; the PR body’s Codex cache comparison could not be independently checked because the required sibling source checkout is absent. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Control UI chat picker reads its configured model catalog through a browser-side cache, then renders that catalog in the composer. A due picker open can request a refreshed Gateway catalog, while ordinary reopening uses the bounded cached result. flowchart LR
A[Chat model picker] --> B[Browser catalog cache]
B --> C{Refresh due?}
C -->|Yes| D[Gateway model catalog]
C -->|No| E[Cached models]
D --> F[Rendered picker options]
E --> F
Decision needed
Why: Repository policy requires direct sibling-Codex inspection for a Codex-dependent claim, but the checkout was absent and the read-only environment could not supply it. Before merge
Agent review detailsSecurityNone. PR surfaceSource +35, Tests +161. Total +196 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the bounded policy in the Control UI cache owner, retain explicit settings refresh, and independently verify the cross-repository Codex comparison from an environment containing the required source before treating that comparison as supporting evidence. Do we have a high-confidence way to reproduce the issue? Yes—source reproduces the stale-cache path: current main returns the completed cache on picker reopen, while the proposed caller requests a due Gateway refresh through the existing protocol. Is this the best way to solve the issue? Yes—the browser cache owns picker-open policy, while the Gateway and provider retain their existing discovery and explicit-refresh contracts; no duplicate provider or protocol path was added. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 53fbe2eb33ad. 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 (3 earlier review cycles)
|
c145cc8 to
2c3544e
Compare
2c3544e to
8aa2638
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer review complete for exact HEAD 8aa2638. Clean local review and fresh autoreview; exact-head CI is green. ClawSweeper found no actionable findings and identified the bounded picker-cache refresh as the best narrow fix. No API or config changes, breaking changes, or compatibility concerns. Ready to merge. |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where users with OpenAI ChatGPT/Codex account models could keep seeing an old model list in the Control UI chat picker after their available account catalog changed. Reopening the picker reused the Gateway's completed catalog indefinitely, while forcing discovery on every open would make a long-running, expensive probe unbounded.
Regression provenance: #125661, merged as
475d20a034739551a821da8125b90a568ddeb5e6, removed the picker-openrefreshrequest while documenting that reopening re-requested the catalog. #127394 separately lets an explicitly selected account model run before catalog refresh; it does not make newly available models appear in the picker.Why This Change Was Made
Picker-open discovery now uses a bounded refresh mode: the first open without a recent successful refresh revalidates the account catalog, successful results receive a five-minute per-client/per-agent cooldown, and the next open after that cooldown may refresh again. Repeated opens while discovery is still active join that request instead of returning the stale cooldown cache. Failed discovery remains retryable on reopen, and explicit Refresh controls keep their force-refresh behavior.
The fix stays at the Control UI catalog-cache owner. The OpenAI plugin already performs account-scoped ChatGPT/Codex OAuth discovery and retains its provider-level cache; no provider, auth, model-routing, or Gateway protocol contract changes.
Codex dependency audit: at
openai/codex@d4fcb2873bf23464cfacd804a31d46529db943b0, app-servermodel/listfilters picker-visible account models throughOnlineIfUncached, and the model manager defines a 300-second cache horizon and refresh policies. The UI cooldown preserves that bounded-catalog design instead of probing on every interaction.AI-assisted: yes. The author reviewed the owner boundary, provider/Codex contracts, regression provenance, tests, and final diff.
User Impact
Newly available ChatGPT account models can appear in the chat model selector without a page reload or an indefinitely stale catalog. Opening and reopening the picker during ordinary use does not repeatedly launch the expensive full model probe.
Evidence
ClawSweeper proof
loadModelscache owner -> Gatewaymodels.listconfigured view -> existing OpenAI ChatGPT/Codex OAuth catalog discovery.openai/gpt-5.6-lunaon the first refreshed catalog and addsopenai/gpt-5.6-terraafter the browser clock crosses the five-minute cooldown. The scenario also reopens the picker after one minute and asserts that no second request occurs. Focused cache-owner scenarios prove a concurrent reopen receives the active refresh result and that an unsuccessful discovery retries on the next open. Separate exact-head real behavior proof below uses the existing authenticated Gateway and OpenAI account catalog.v24.19.0, pnpm11.15.1, Linux.node scripts/run-vitest.mjs ui/src/pages/chat/models.test.ts ui/src/pages/chat/chat-pane-session-controls.test.ts;OPENCLAW_UI_E2E_ARTIFACT_DIR=.artifacts/openai-account-model-catalog node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-composer-catalog.e2e.test.ts;pnpm check:changed;.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --codex-bin /home/rev/openclaw/node_modules/.bin/codex --stream-engine-output.expected 1 to be 2because reopening made no secondmodels.listrequest. Final focused unit lane: 17/17 passed. Final Chromium lanes: 9/9 passed, including the 5/5 catalog scenarios.pnpm check:changed: exit 0, including policy, format, dead-code, i18n, core/UI typecheck, and lint lanes. Final structured review: clean, no accepted/actionable findings, correctness confidence 0.99. Exact-head real proof returned and rendered eight official OpenAI account models while immediate reopen kept the request count at one.ui/src/e2e/chat-composer-catalog.e2e.test.tsand emits01-account-catalog-before-refresh.png(Luna only) and02-account-catalog-after-refresh.png(Luna plus Terra) when the artifact environment variable is set. Sanitized real Gateway/browser before, after, and machine-readable trace are pinned to immutable evidence commitcbd21a33b8a1e93e86be11a0deb98f8f8f7f4f4d. Exact reviewed head:8aa2638863fbea3c22d711afe7db43caeea8ce46. Exact-head GitHub checks: 147 passed, 22 intentionally skipped, 0 failed (check suite, CI run).Real behavior proof
HEAD:
8aa2638863fbea3c22d711afe7db43caeea8ce46Claim: The exact-head Control UI requests real account-catalog discovery on picker open, renders all official OpenAI account models returned by the existing authenticated Gateway, and does not issue another expensive probe on immediate reopen.
Exercised surface: Exact-head Vite Control UI -> production browser
GatewayBrowserClientWebSocket -> existing OpenClaw 2026.8.1 Gateway -> installed OpenAI ChatGPT/Codex OAuth provider discovery -> production model-picker DOM. No Gateway response or provider discovery was mocked.Environment: Kali Linux x86_64, Node
v24.19.0, pnpm11.15.1, system Chromium, exact clean HEAD above. The live Gateway remained running and unmodified.Scenario: Opened the exact-head chat UI in a fresh Chromium context, authenticated to the existing Gateway without logging credentials, opened the picker, captured only the
models.listrequest/response pair, read the rendered model-option DOM, closed and immediately reopened the picker, and compared the filtered request count.Exact command:
Sanitized real UI before/after:
Both captures are tight crops of the production picker DOM from the same exact-head run. They contain provider/model labels only; credentials, sessions, messages, and workspace content are excluded. The unmodified sanitized WebSocket/DOM trace is inspectable here.
Relevant sanitized output:
Observed result: The real provider response contained all eight official OpenAI account models and the exact-head picker rendered all eight. Immediate reopen reused the completed result without another
models.listrequest.Limits: This proof covers one authenticated Linux/Chromium setup and an immediate cooldown reuse. The deterministic browser test covers the exact five-minute boundary, newly appearing model transition, failed refresh retry, and mocked failure timing. No model execution was started.
Live read-only observation
Command:
The existing OpenAI plugin returned eight available account models, including
gpt-5.6-sol,gpt-5.6-terra,gpt-5.6-luna,gpt-5.5,gpt-5.4,gpt-5.4-mini,gpt-5.3-codex-spark, andgpt-daybreak-blue-latest. This isolates the defect to picker refresh behavior rather than account discovery or authentication.Production footprint: +35 net lines across the Control UI catalog cache and picker-open owner. Tests: +161 net lines covering cooldown, in-flight refresh joining, force-refresh compatibility, failure retry, request shape, and the browser-visible catalog transition.