Skip to content

improve(ui): unify first-run model setup onto the Models page - #207591

Merged
obviyus merged 8 commits into
mainfrom
unify-first-run-models
Nov 28, 2026
Merged

obviyus merged 8 commits into
mainfrom
unify-first-run-models

Conversation

@obviyus

@obviyus obviyus commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A fresh Gateway with no model sent people to /settings/model-setup?firstRun=1, a separate legacy page: "Set up a model", a red Add account button, Check again, a full-width "Use an installed agent" dropdown, "Available models", a six-row "Run a model locally" wall, a raw "Set up and verify a model" sign-in list and a raw manual provider/key form. Settings → Models already had a clean new-user view (Connect a provider catalog, Find local models, Installed agents). Two surfaces did the same job.

Solution

First run now uses the Models page itself.

  • The automatic first-run redirect, custodian's "choose a primary model" exit and legacy model-setup?firstRun=1|explicit links open /settings/model-providers?firstRun=<value>. Other model-setup links still go to model-providers?connect=1. model-setup is a redirect-only route.
  • First-run Models is the same page: header, Connect a provider catalog with Find local models, then Installed agents. Empty defaults stay hidden.
  • First run adds only what it owns, through the existing createModelSetup / FirstRunSetup owner:
    • activation progress, failures and the unresolved-activation recovery block, shown only when present;
    • detected ready-to-use models (for example Apple Foundation Models on-device), as a settings section above the catalog, only when detection finds some. Nothing activates without a click;
    • Find local models opens the "Available models" dialog of that same owner (local servers, remaining sign-in methods, API key form), so its activations keep the first-run recovery receipt and hand off to custodian?onboarding=1 through Continue setup.
  • Agent scope: first-run Models loads and edits credentials for context.agentSelection (the agent the app uses), as the old page did. The route loader picks that selection; the page gives its controller a context whose settings selection is the app selection, so credentials, installed agents and model activation all target the same agent.
  • The catalog never waits for discovery: Connect a provider, Find local models and Installed agents render with the normal Models load. Detected models render above the catalog when discovery finishes first; when discovery finishes after the catalog painted, they render at the end of the page (CSS order), so nothing visible moves.
  • While a first-run activation is unresolved, catalog Connect is disabled (as the old setup login was), so recovery cannot be bypassed from another entry point. The setup owner reports that state to the page through one callback; login-controller.ts is unchanged in this respect.
  • Provider sign-in from the catalog keeps the Models login and its own recovery receipt and completion. The setup page's private copy of that login (its "Add account" button and the manual-provider hand-off into the setup form) is gone.

Deleted: the full-page branches of model-setup/view.tsx, native-model-setup.tsx (replaced by Installed agents), loading-view.tsx, the ConfiguredModel verify panel, the full-page heading/intro, unused copy and CSS.

UX decisions (recorded per standing orders):

  • On this host Apple Foundation Models is always detected, so "after" first-run shows one candidate row; on hosts without one the section is absent.
  • Placement of detected models depends on timing: above the catalog when discovery wins the race with the Models data, below Installed agents otherwise. This keeps both rules (no new wait, zero layout shift); the trade-off is that a slow discovery puts the on-device row lower on the page.

Impact

  • Fresh installs see one clean Models page instead of a second cluttered setup page.
  • Net −1.7k lines; one setup owner; no schema, protocol or dependency change.

Evidence

Before (merge base b90cda2, fresh isolated Gateway, scratch HOME, no keys):

After (head, fresh isolated Gateway):

Real-Gateway head E2E (fresh isolated Gateway, no model, Chromium + WebKit):

  • Opening the Control UI redirects automatically to /settings/model-providers?firstRun=1 with Connect a provider, the detected Apple Foundation Models row above it, and Installed agents.
  • Find local models opens the "Available models" dialog (Check again, detected model, Run a model locally rows).
  • Connect on Anthropic opens the API key dialog for the app's agent.
  • layout-shift PerformanceObserver at 400 / 820 / 1280 px (head bdb7fe24, fresh Gateway, Chromium): 0 / 0.0006 / 0.002 (settings-group/sidebar on first paint, not the catalog); discovery finished after the catalog painted, so the Apple Foundation Models row rendered below Installed agents/defaults and nothing moved. 0 console errors, 0 page errors.

Checks:

  • pnpm tsgo:ui, pnpm lint:ui:styles, pnpm ui:i18n:baseline (no baseline change), pnpm ui:i18n:verify, pnpm check:control-ui-controllers --prune, oxfmt/oxlint on changed files.
  • ocx test unit: model-setup, model-providers, bootstrap, app shell, custodian and route importers: 65 files, 725 tests passed.
  • ocx test UI E2E (mocked Gateway): 27 first-run, Models, login, discovery, chat and layout files: 164 passed, 1 failed. The failure, initial-connect-splash "keeps finalized recording pixels intact while capturing an element on a tall page", fails identically on the merge base (headless recording, firstScene=-1); not ours.

Tests retired with this change: model-setup-headings (deleted page layout), model-setup-codex-sign-in (covered by model-provider-login.e2e "shows a provider's accounts and every connection method before browser sign-in" and model-setup.e2e device-code completion), the first-run API-key hand-off test in model-provider-login.e2e (that hand-off is removed; manual API keys are covered in the discovery dialog), native installed-agent "Use" tests, ConfiguredModel tests and the setup page's own account-connection tests.

Before: first-run setup page, desktop

Before: first-run setup page, mobile

After: first-run Models page with detected model above Connect a provider, desktop

After: first-run Models page, mobile

After: Find local models dialog

Review round 1 (local ClawSweeper)

  • "Keep provider choices usable while discovery runs": accepted. Removed the first-run loading gate; the catalog renders without waiting for discovery.
  • "Share unresolved activation state with catalog login admission": accepted. Catalog Connect is disabled while a first-run activation is unresolved; covered by model-setup-recovery.e2e (uncertain → disabled, rejected → enabled).

Review round 2 (local ClawSweeper)

  • "Preserve verification for an already configured model": accepted. First-run Models shows the configured model with Check model (existing FirstRunSetup.verify), then Continue setup once it answers. Covered by view.test.ts "lets first run verify an already configured model before continuing".

Review round 3 report (final head)

  • "Refresh first-run readiness after catalog connections": accepted. The setup owner rescans on the existing model-catalog change events (when idle), so a catalog sign-in on first-run Models shows Check model / Continue setup without a reload. Covered by model-setup-recovery.e2e "offers the first-run handoff after a model is configured elsewhere on Models".

Final-head review findings

  • "Route catalog-first continuation into guided onboarding": rejected. A model configured through Models (catalog or, on the old page, Add account) has no first-run activation receipt; FirstRunSetup.continueSetup() then opens chat, exactly as the deleted ConfiguredModel did on the base. Changing that completion contract is new behavior outside this cut. Docs now describe it precisely.
  • "Keep the catalog stationary when first-run discovery completes": accepted. Late results render after the catalog (see above); initial-connect-splash.e2e asserts the catalog keeps its position and the late row renders below it.

Final local review

Head bdb7fe24: ClawSweeper local review "patch is correct", zero findings.

- First run lands on /settings/model-providers?firstRun=1: the Models page (Connect a provider catalog, Find local models, installed agents) for the agent the app uses.
- First run adds only detected ready-to-use models and activation recovery above the catalog; local, sign-in and manual setup live in the Find local models dialog owned by the same first-run owner.
- /settings/model-setup is redirect-only; deleted the full-page setup view, the installed-agent dropdown, loading skeletons and the setup page's own Models login.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL labels Nov 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 28, 2026
- Do not hold the Models catalog behind first-run discovery; detected models appear above it when found.
- Disable catalog sign-in while a first-run activation is unresolved, as the old setup login did.
- Drop the now-unused Models connect action and port the gateway setup test to the first-run dialog.

Co-authored-by: obviyus <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Nov 28, 2026
obviyus and others added 6 commits November 28, 2026 21:42
- First-run Models shows the configured model with Check model, then Continue setup once it answers.

Co-authored-by: obviyus <[email protected]>
- A catalog sign-in on first-run Models now shows Check model and Continue setup without a reload.

Co-authored-by: obviyus <[email protected]>
- A newer detection replaces a scan that began before Models configured a model.

Co-authored-by: obviyus <[email protected]>
- Detected models render above the catalog when discovery finishes first, and after it otherwise.

Co-authored-by: obviyus <[email protected]>
@obviyus

obviyus commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator Author

Final-head screenshots (head bdb7fe2, fresh isolated Gateway): first-run Models desktop and mobile, detected model rendered below the catalog after late discovery, and the Find local models dialog.

After (final head): first-run Models, desktop

After (final head): first-run Models, mobile

After (final head): late-detected model below the catalog

After (final head): Find local models dialog

@obviyus

obviyus commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator Author

Maintainer override: checks-ui-e2e (5/10) is red only on ui/src/e2e/chat-comment-lifecycle.e2e.test.ts ("keeps a legacy comment-file bubble stable while its attachment is read"), which also fails on main. This PR does not touch chat comments or attachments.

ci-triage output (head bdb7fe2; main run 46159819558):

checks-ui-e2e (5/10)	ui/src/e2e/chat-comment-lifecycle.e2e.test.ts	MAIN-ALSO
checks-ui-e2e (5/10)	ui/src/e2e/skills-category-discovery.e2e.test.ts	OURS

The skills-category-discovery line is a tagging artifact: all 11 of its tests passed in that job log (✓ ui/src/e2e/skills-category-discovery.e2e.test.ts (11 tests)); the job's only failure is chat-comment-lifecycle.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR moves first-run model setup onto Models while retaining the existing activation and recovery owner.

Example: Open a fresh Gateway with no configured model.

  • Before: The browser opens /settings/model-setup?firstRun=1 with a separate setup page.
  • After: The browser opens /settings/model-providers?firstRun=1 with the provider catalog, installed agents, and detected model choices.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful consolidation with relevant visual proof and no definite introduced findings; required CI remains unresolved.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected browser captures support the fresh-Gateway Models layout and discovery dialog, with final-head screenshots showing late results below the catalog; the body reports Chromium/WebKit entry checks and console diagnostics, while activation completion remains outside the supplied live demonstration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: New users encounter a separate, cluttered setup page despite Models already providing the main connection choices.
Reason: The maintainer-authored direction consolidates the visible flow and removes redundant machinery while retaining explicit activation and existing completion contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored consolidation removes a redundant setup surface, and inspection found no definite introduced defect.

Reviewed head: bdb7fe24a080e66ee16c79f111c7f2d5e8dfef01

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI combines Gateway model discovery, agent-scoped credentials, and setup wizard results into model choices, activation feedback, and continuation actions.

flowchart TD
  A[First-run entry or saved link] --> B[Models route]
  B --> C[Provider catalog]
  B --> D[Existing setup owner]
  C --> E[Provider login owner]
  D --> F[Gateway discovery and activation]
  E --> F
  F --> G[Model readiness and continuation]
Loading

Technical review

Best possible solution:

Retain this consolidation through the existing Models and setup owners, with required CI resolved before landing.

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

Current-main routing and the inspected before screenshots establish the separate first-run page; no target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

Reusing Models while retaining FirstRunSetup is a coherent cutover that removes duplicate rendering without introducing another activation owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b64fd500ba52.

Provenance checked

  • First-run route separation changes intended behavior with a stated reason (11a42b7: The earlier consolidation retained first run to preserve consent and activation recovery.)
  • Inline Models provider catalog keeps the original intent (31fe57d: Give new users clear provider choices and keep empty defaults out of their initial path.)
  • First-run reload recovery keeps the original intent (4e87ff7: Resume an existing setup wizard after reload without replaying starts or discarding uncertain activation recovery.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 31fe57d adds ui/src/pages/model-providers/model-providers-page.tsx:53 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 31fe57d22000; files: ui/src/pages/model-providers/model-providers-page.tsx)
  • Peter Steinberger: Raw commit 18cd308 adds ui/src/pages/model-providers/model-providers-page.tsx:65 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 18cd3088f476; files: ui/src/pages/model-providers/model-providers-page.tsx)

PR surface

Source -634, Tests -1035, Docs +2, Other -1. Total -1668 across 57 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 25 452 1086 -634
Tests 29 328 1363 -1035
Docs 2 5 3 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 57 785 2453 -1668

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

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

  • Resolve the exact-head chat-comment lifecycle check by establishing whether its timeout is inherited or diff-caused.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 28, 2026, 12:14 PM ET / 17:14 UTC.

@obviyus
obviyus merged commit 0b1e4ac into main Nov 28, 2026
144 of 148 checks passed
@obviyus
obviyus deleted the unify-first-run-models branch November 28, 2026 17:15
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
…aw#207591)

First-run model setup now uses the Models page (`/settings/model-providers?firstRun=1`) for the agent the app uses. First run adds only activation recovery, detected ready-to-use models and the Find local models dialog of the existing first-run owner. `/settings/model-setup` is redirect-only; the legacy full-page setup view, installed-agent dropdown, loading skeletons and the setup page's private Models login are removed.

Co-authored-by: Ayaan Zaidi <[email protected]>
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 docs Improvements or additions to documentation gateway Gateway runtime impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

1 participant