Repository navigation
fix: recover new-session models through Gateway startup - #119120
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 1:15 AM ET / 05:15 UTC. ClawSweeper reviewWhat this changesThis PR preserves the New Session model picker when optional command metadata fails, retries only the canonical Gateway-startup response, and stabilizes the related Control UI auth-transport E2E lifecycle. Merge readinessKeep open. The PR remains necessary because current main couples required model discovery to optional command enumeration; the proposed owner-boundary repair and focused Gateway/UI coverage show no blocking defect. Its protected maintainer label and active exact-head checks keep the merge decision human-owned. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI asks Gateway for configured models and text commands before rendering New Session choices. Gateway supplies that metadata, while the UI turns the returned model catalog into the operator's model picker. flowchart TD
A[New Session page] --> B[Control UI metadata request]
B --> C[Gateway metadata assembly]
C --> D[Configured model catalog]
C --> E[Optional text commands]
D --> F[Model picker]
E --> F
C --> G[Startup unavailable response]
G --> B
Decision needed
Why: The protected maintainer label requires an explicit human merge judgment even though the code review found no mechanical blocker. Before merge
Agent review detailsSecurityNone. PR surfaceSource +103, Tests +316. Total +419 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge this replacement for #118893 after exact-head checks pass and a maintainer approves it, retaining fatal behavior for genuine configured-model failures. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s coupled Promise.all path and one-shot New Session request establish the failure path, and the PR body records focused Gateway and rendered-browser after-fix runs. Is this the best way to solve the issue? Yes. Separating required model discovery from optional commands at Gateway and retrying only the typed startup response is narrower and safer than a generic UI retry. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5a1daf81a554. 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
|
|
Land-ready proof for exact head
Proof:
Known proof gaps: none. |
|
Merged via squash.
|
* origin/main: fix: preserve live updater failure diagnostics (#119096) fix: recover new-session models through Gateway startup (#119120) test(qa): cover instruction profile artifacts (#119078) fix(telegram): record automatic delivery message ids test(qa): cover memory promotion safety (#119093) test(qa): prove overflow compaction pruning (#119033) fix(tool-search): preserve deferred MCP failures (#118363)
) * fix: preserve new-session models through startup errors * fix(ui): normalize metadata retry failures to errors * test(ui): prove new-session metadata recovery * test(gateway): use public model fixtures * test(ui): order auth transport E2E lifecycle * test(ui): drain auth transport bootstrap work --------- Co-authored-by: ZYV5ge <[email protected]>
* 'main' of https://github.com/openclaw/openclaw: test(qa): cover sandboxed exec behavior (#119053) test(qa): prove shared-channel memory recall (#119111) fix(telegram): keep request deadlines through response bodies test(qa): cover gateway plugin approvals (#119128) fix(ai): keep OpenAI tool call id truncation UTF-16 safe (#110471) fix: preserve live updater failure diagnostics (#119096) fix: recover new-session models through Gateway startup (#119120) test(qa): cover instruction profile artifacts (#119078) fix(telegram): record automatic delivery message ids test(qa): cover memory promotion safety (#119093) test(qa): prove overflow compaction pruning (#119033) fix(tool-search): preserve deferred MCP failures (#118363) fix(macos): keep setup activation within app checks test(setup): type provider kind fixture fix(setup): complete prepared model activation fix(protocol): regenerate Swift wizard models fix(ollama): activate the model selected during setup fix(setup): preserve the prepared model handoff
* origin/main: fix: preserve live updater failure diagnostics (openclaw#119096) fix: recover new-session models through Gateway startup (openclaw#119120) test(qa): cover instruction profile artifacts (openclaw#119078) fix(telegram): record automatic delivery message ids test(qa): cover memory promotion safety (openclaw#119093) test(qa): prove overflow compaction pruning (openclaw#119033) fix(tool-search): preserve deferred MCP failures (openclaw#118363)
* 'main' of https://github.com/openclaw/openclaw: test(qa): cover sandboxed exec behavior (openclaw#119053) test(qa): prove shared-channel memory recall (openclaw#119111) fix(telegram): keep request deadlines through response bodies test(qa): cover gateway plugin approvals (openclaw#119128) fix(ai): keep OpenAI tool call id truncation UTF-16 safe (openclaw#110471) fix: preserve live updater failure diagnostics (openclaw#119096) fix: recover new-session models through Gateway startup (openclaw#119120) test(qa): cover instruction profile artifacts (openclaw#119078) fix(telegram): record automatic delivery message ids test(qa): cover memory promotion safety (openclaw#119093) test(qa): prove overflow compaction pruning (openclaw#119033) fix(tool-search): preserve deferred MCP failures (openclaw#118363) fix(macos): keep setup activation within app checks test(setup): type provider kind fixture fix(setup): complete prepared model activation fix(protocol): regenerate Swift wizard models fix(ollama): activate the model selected during setup fix(setup): preserve the prepared model handoff
Closes #118891.
Closes #119105.
Related: #116118
Supersedes #118893 because its contributor fork branch became unwritable after the maintainer proof commits; the replacement preserves both original commits and contributor credit.
What Problem This Solves
Users opening New Session can lose their valid configured model catalog when optional text-command metadata fails or the first
chat.metadatarequest arrives while Gateway startup sidecars are still initializing.Why This Change Was Made
The Gateway now treats configured models as required metadata and text commands as optional metadata. It captures synchronous command enumeration failures, logs them, and returns the valid model catalog without commands. Model discovery failures remain fatal.
The Control UI retries only the canonical retryable startup-sidecars
UNAVAILABLEresponse. Retries respect the server delay, abort when the owning Lit task is invalidated, and stop after 60 seconds. Unrelated errors still fail immediately.This does not weaken exec-approval migration checks, modify model configuration, or retry arbitrary failures. Direct inspection of
@lit/task1.0.3 confirmed that starting a new task aborts the previous signal and stale task results do not invoke completion/error callbacks.The branch also repairs the unrelated current-main auth-transport E2E failure that blocked exact-head CI twice. Successful connected shells start background Gateway bootstrap RPCs that can outlive browser-context teardown; the test now exercises rejection paths first, runs the full connected shell last, closes every context explicitly, and captures page errors before navigation. No timeout was enlarged and no assertion was weakened.
User Impact
New Session keeps the complete configured model catalog through unrelated command-metadata failures and recovers automatically from the bounded Gateway startup window. Real model-catalog failures remain visible.
Evidence
Exact candidate head:
44fb886a59434def2b58f4ba282fee9df1730767.tbx_01kz5ck73tzdghk3v3zdyn7e9s:pnpm test ui/src/e2e/new-session-page.catalog-reconnect.e2e.test.ts ui/src/pages/new-session/model-control.test.ts src/gateway/server.chat.gateway-server-chat-b.test.tschat.metadatarequests for agentmain, opened the picker, and found the uniquely recovered model.pnpm check:changedpassed thecore,coreTests, anduilanes.pnpm buildpassed, including the production Control UI build, precompressed-asset validation, and performance guard.tbx_01kz5dnv26szt9mbwqcxvg76v5: 97/97 Gateway tests passed after the final public-model fixture cleanup.origin/main: clean, no accepted/actionable findings, confidence 0.97.git diff --checkand targetedoxfmt --checkpassed.{ "head": "44fb886a59434def2b58f4ba282fee9df1730767", "overall_behavior": "satisfies_contract", "overall_confidence": 0.98, "checks": { "optional_command_failure_preserves_models": "pass", "required_model_failure_remains_fatal": "pass", "canonical_startup_retry_count": 2, "rendered_recovered_model_visible": "pass", "noncanonical_error_no_retry": "pass", "task_invalidation_aborts_wait": "pass", "retry_deadline_60_seconds": "pass" }, "blockers": [] }Scope and safety
Six files, +488/-69. Production is +110/-7; tests are +378/-62. The production growth pays for one explicit required-versus-optional Gateway owner boundary and one cancellable, deadline-bounded Control UI startup retry. The additional current-main CI repair is test-only. No config, protocol, storage, dependency, workflow, version, signing, credential, or user-data surface changes.
Contributor credit: this branch preserves the two original commits authored by @ZYV5ge.
AI-assisted: yes.