Repository navigation
fix: keep the selected provider when setting up a chat model - #204440
Conversation
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: b40d5101-e453-4b84-bf91-a187ecae589c
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: d3d2a2a9-1685-40bb-8307-39e621ebf468
|
Codex review: needs maintainer review before merge. What this changesThis PR carries the selected provider and source agent from the model picker into the existing provider connection dialog. Example: Click Set up in the Audit Provider tab of the chat model picker.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a provider-setup handoff still broken on current main, with sufficient visual proof and no blocking findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI model picker passes provider context through Settings navigation, where the Models controller resolves advertised login groups and opens the existing credential connection flow. flowchart LR
A[Chat or New Session picker] --> B[Provider setup callback]
B --> C[Settings navigation]
C --> D[Models route intent]
D --> E[Advertised login groups]
E --> F[Existing connection dialog]
Technical reviewBest possible solution: Preserve provider and source-agent context through the existing navigation and login owners while retaining generic setup and settings-only behavior. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the lost-provider path, and the contributor supplies matching before/after browser evidence; this read-only review ran no product code or tests. Is this the best way to solve the issue? The patch fixes the handoff at its existing owners, removes the superseded dispatcher, and preserves exact-brand precedence without adding another setup flow. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 463d7748595d. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +55, Tests +59. Total +114 across 15 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 24, 2026, 1:53 AM ET / 06:53 UTC. |
|
Follow-up note on scheduled CI. No action needed: the test is already updated on After this PR, Cause: the auth-state "Set up" action now calls Evidence, in a Linux container matching
Both red scheduled runs predate #204696. |
Closes #204420
What Problem This Solves
Choosing Set up in a provider tab of the chat model picker forgets that provider and opens the generic Models catalog. Users must find the same provider again before connecting it.
User Impact
User impact: provider-specific setup opens that provider’s existing connection flow for the source agent. Generic setup and settings-only links retain their behavior; no defaults, credentials, or model selections are changed by opening the flow.
Why This Change Was Made
Carry the active provider through the picker callback and existing provider-aware Settings navigation. The existing connection owner resolves aliases and consumes the route intent; no second dialog or setup owner is introduced.
Evidence
Before: on main
cb4f301c6bb7e27946f2cb98ef283f4500dcd6fa, the real picker’s Audit Provider Set up action reached/settings/model-providers?connect=1with an empty search and no provider dialog.After: the same real Gateway/production Control UI flow reached
/settings/model-providers?provider=audit-provider&connect=1and opened the Audit Provider connection dialog. Final local diff SHA-256:9ce5e2e2748a2a2a44265e3fea17a6184b3a8dc674dd16641d9ed88f52966f82.The provider is a locally authored archive fixture with a static catalog and no saved credentials. The final replay also publishes two login brands under one auth owner: the earlier-sorting sibling is present, but the exact Audit Provider connection opens without the sibling method. No inference or real provider login was performed. Chromium, light theme, 1280×900 viewport, matched 960×900 sidebar-free crops; the before view naturally scrolls to the generic search.
Clean comparison
Before
After
Annotated comparison
Before
After
Validation: two missing/failed-auth callback regressions fail on main and pass with the fix. The three shared-owner/exact-alias regressions also fail on the pre-correction candidate and pass after the matching repair. Initial pre-publication focused suite: 152 tests pass (5.07 s); earlier affected chat consumer suites: 219 pass (14.82 s). Final real-browser replay: 1 pass (49.30 s total; 3.341 s scenario). Two preliminary proof-harness failures were diagnosed and corrected without changing product source. UI build, UI typecheck, formatting, diff check, Solid guard and line-growth ratchet pass. CI is attached to the published head
fe961e3b710052fc3d1b7af6a19e3b07803c8df2; see the checks for current status.CI follow-up: The UI-pages test typecheck found a PR-caused
TS2540: the new regression assigned the read-only Settings capability after constructing its application context. The fixture now initializes that real capability during construction and disposes it after the test. The exacttest/tsconfig/tsconfig.core.test.ui-pages.jsongraph fails before and passes after the repair; all 140 tests across its six fixture consumers pass, as do focused lint/format checks. This follow-up changes only two test files (+11/−9), so production UI and the verified real-flow/media evidence are unchanged.Known local gate limitation: standalone lint still reports the pre-existing picker panel line cap: 709 counted lines versus 714 on main, cap 700. No semantic lint failures remain. The line-growth ratchet passes; no suppression, raised limit, or unrelated cleanup was added. Repository CI classifies size limits as warnings; semantic lint errors remain blocking.
Simplify pass: reuse the connection owner, remove the superseded route dispatch helper, retain source-agent and alias handling. Production delta +104/−49; regression tests +61/−2. Final candidate tree:
1e01b77d6a8a4d32206aa5c4f6c946d9f913dc6a.Independent review: coverage was completed on the same bound Auto Review route, P0–P2, openai/gpt-6.2-sol, with all 14 changed files and 20 dependency contracts supplied in full. The complete pre-correction review found one P2 issue: exact provider login groups must take precedence over auth-owner matches. That finding is addressed by ordered exact-group, canonical-group, then auth-owner selection; the three red/green regressions and final real shared-owner replay verify the repair. Original reports are preserved, including the historical finding status; no repeat review was requested solely to replace that status. The reviewer performed evidence-only assessment, not independent test execution.
Contributor: @daniel-lxs.
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by