Repository navigation
fix(first-run): keep the chosen harness and guide a multi-model save - #560
Open
Zhangbo-cn wants to merge 5 commits into
Open
Zhangbo-cn wants to merge 5 commits into
Zhangbo-cn wants to merge 5 commits into
Conversation
Zhangbo-cn
requested review from
hsliuustc0106 and
princepride
as code owners
November 28, 2026 14:58
Zhangbo-cn
force-pushed
the
fix/first-run-harness-and-guidance
branch
from
November 29, 2026 03:54
1732977 to
23a4deb
Compare
Collaborator
Ran: |
Zhangbo-cn
force-pushed
the
fix/first-run-harness-and-guidance
branch
3 times, most recently
from
December 4, 2026 16:27
55b08ff to
6140a6a
Compare
Saving a language model inside the setup wizard always wrote runtime=default, silently replacing a harness the user had just picked (Claude Code, Codex, OpenCode). A language-model save now keeps a non-default runtime, validates the runtime that actually runs, and only updates modelSelections.agent. Explicitly picking another harness still switches. Also make a multi-model save understandable: show how many models were added, mark the new rows, move focus to the first one, and keep the single-model auto-continue behaviour unchanged. Refs ThinkFlowLab#556, ThinkFlowLab#559 Co-Authored-By: Claude Code <noreply@anthropic.com>
Zhangbo-cn
force-pushed
the
fix/first-run-harness-and-guidance
branch
from
December 4, 2026 16:30
6140a6a to
4a9e43c
Compare
The language-model form reports every saved model to the welcome screen. Editing an existing service therefore showed the Added-N hint and the new-row markers, implying the user had just added models and must pick one. Pass the edit flag through finishModelSetup so an edit returns to the language list without the addition guidance. Split the multi-model guidance journey into its own gate test so it can run against earlier revisions without the full first-run setup, and cover an unavailable kept harness plus the default runtime on a fresh project in first_run.mjs. Co-Authored-By: Claude Code <noreply@anthropic.com>
…anguage list An edit save with one usable model connected and advanced to step 2, overwriting the chosen assistant, and an edit after a multi-model save left the added-model hint and markers behind. Return after an edit before the single-model path and clear the added-model guidance. Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two first-run setup defects and two follow-up findings from the first review round:
runtime: "default"back to the draft, so chat ran on Default instead of the harness the user had just picked. The draft save also validated the harness status of the wrong runtime.New · pick to continuemarkers appeared even though the user had not added anything.finishModelSetupnow receives the edit flag and returns to the neutral language list after an edit.Linked issue
Fixes #556Fixes #559Labels
type:bug,area:canvas,area:harness,area:i18nTest plan
1d429709:node tests/browser/first_run.mjsagainst an isolated fixture API with a Vite dev server and again against the production build (vite build+vite preview, thepreviewSafemanifest entry): passed. Journeys cover [bug] 首启向导保存语言模型时把已选 harness 静默重置为 Default #556 (pick Codex → Back → save one language model → draftruntimeis stillcodex,modelSelections.agentupdated; explicit OpenCode pick switches the runtime; an unavailable kept harness reports the assistant-unavailable alert and leaves the draft oncodex), the default runtime on a fresh project, and [bug] 首启向导:一次添加多个语言模型后缺少下一步指引 #559 (save two language models → hint andNew · pick to continuemarkers shown → agent selection unchanged → pick a new row → step 2).node tests/browser/first_run_added_models.mjs(new gate test) on the same dev server and production build: passed. It isolates the multi-model guidance (hint text, two markers, focus on the first added id, unchanged-then-updatedmodelSelections.agent) and three edit paths: a paused saved service → "Edit service" → save → no hint and no markers; an edit after a fresh multi-model save clears the stale hint and markers; a single saved service edit stays on the language list and keeps the previously pickedmodelSelections.agent.npm test: 1113 passed, 0 failed.npm run check:i18n: 3857 keys, 0 problems.npm run check:browser-locale: 103 pages, 0 problems.npm run check:browser-manifest: OK, 111 entries.tsc --noEmit: clean.83b142f0, built from source (vite build+vite preview) with the isolated fixture. Because these test files are introduced by this PR, the current versions were copied into a clean83b142f0worktree; nothing else in that worktree was changed.first_run.mjsfails attests/browser/first_run.mjs:212withAssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 'default' !== 'codex'.first_run_added_models.mjsfails attests/browser/first_run_added_models.mjs:98, waiting for the "Added 2 language models..." hint that the base does not render.4a9e43c5,first_run_added_models.mjsfails attests/browser/first_run_added_models.mjs:128withExpected values to be strictly equal: 1 !== 0(the Added-N hint is present after an edit).a5a2c176, the extendedfirst_run_added_models.mjs(applied to that worktree, served by the Vite dev server with the isolated fixture) fails at line 160 withExpected values to be strictly equal: 1 !== 0(the stale hint survives an edit). A probe script reproduced both defects on the same SHA: after editing the paused servicestaleHintwas 1 andstaleMarkerswas 2; after editing the single paused service the wizard advanced (advanced1,stayed0) andmodelSelections.agentchanged from059ad3d6…tocc68fcde…. The logs and screenshots are in the evidence below; at1d429709the same probe reportsstaleHint0,staleMarkers0,advanced0,stayed1, and an unchanged agent.1d429709(run 47392989081):static,browser (voice), andbrowser (assistant)passed. The isolated lane and the frontend/desktop failures are described below.CI status and attribution
The failures on this tip are not caused by this diff and are not the base's state either; they are dependency drift in the wheel-verification environment.
frontend,desktop / macos,desktop / windowsbuild a fresh venv from the packagedopendirectorwheel (.github/workflows/release-checks.yml, "Verify installed wheel without Node.js" and the packaged smoke tests). In run 47392989081 this venv resolvedfastapi 0.165.1withopentelemetry-api 1.46.0and failed withTypeError: get_logger() takes 1 positional argument but 3 positional arguments (and 1 keyword-only argument) were givenatfastapi/telemetry/_asgi.py:332. The base run 47344640055 and the previous-head run 47376634219 used the same job and the samefastapi 0.165.1but resolvedopentelemetry-api 1.45.3, and passed.pyproject.tomldeclaresfastapi>=0.115,<1, the wheel metadata leavesopentelemetry-apiunpinned, andrequirements.txtpins older versions, so the drift comes from the fresh resolution, not from this change.browser (isolated): the lane ran 35 of 36 workflows green, includingfirst_run.mjsandfirst_run_added_models.mjs. The only failure iscanvas_toolbar_topbar.mjs:125, a 15 s timeout waiting for.cw-node-toolbar-anchor button— the known red tracked by [test] canvas: clear the tool rail when seeding the toolbar drag #686, also red on the base at83b142f0. This PR does not touch toolbar code.Evidence that it works
Tested at head
1d429709, at the previous headsa5a2c176and4a9e43c5, and at83b142f0. All runs used an isolated creation fixture; assistant runtimes and/api/model-configswere model doubles, not real providers.Reproduction for #556/#559: open a fresh project with
?setup=welcome, choose "Use an existing harness" → Codex, go Back, choose "Set up a language model", fetch and save models.Reproduction for the edit paths: open the language list with a saved service that is paused, choose "Edit service", and save.
Before (
83b142f0):After the harness and multi-model fixes (
4a9e43c5):New · pick to continuemarkers appear on the added rows; picking one advances to step 2.Edit path, first round: clicking "Edit service" on the paused
edit-bservice and saving at4a9e43c5still shows the Added-N hint and marks both rowsNew · pick to continue:At
a5a2c176the same save returns to the neutral list; the paused service is the entry point and no hint or marker remains, in both locales. Focus movement to the first added row is asserted by the test viadocument.activeElement.dataset.firstRunAgent; the recording shows the rows and the step change but does not visibly render a focus ring:Play the first-round recording at a5a2c176
Edit path, second round (the two defects fixed in
1d429709). Ata5a2c176, editing the paused service after a fresh multi-model save left the hint and both markers, and editing the single paused service jumped to "Choose how to create" and replaced the picked agent:Play the before-fix recording at a5a2c176
The extended gate test failing at a5a2c176 (line 160,
1 !== 0)Probe output at a5a2c176:
staleHint1,staleMarkers2,advanced1,stayed0, agent changedAt
1d429709both edits stay on the neutral language list with no hint or markers, and the previously picked agent is unchanged:Play the after-fix recording at 1d429709
Probe output at 1d429709:
staleHint0,staleMarkers0,advanced0,stayed1, agent unchangedProvider verification
/assistant/runtimes, the harness status endpoints,/api/model-configs, and/api/model-configs/discover. Saving language models used the real isolated creation API with a local base URL. No credentials appear in the diff.Bilingual UI
firstRun.pickAddedModelandfirstRun.modelJustAddedinen-US/firstRun.tsandzh-CN/firstRun.ts.check:i18nandcheck:browser-localepass, and the screenshots show both languages at the previous head and the final head.Review
83b142f0, heada5a2c176— WITHHOLD (required Release checks not green on that SHA for reasons outside the diff); no actionable defect found by the self-review.83b142f0, heada5a2c176— REQUEST CHANGES. Findings: (1) a single-model edit auto-advanced to step 2 and overwrote the agent selection; (2) the PR body attributed the frontend/desktop failures to the base, which the run logs contradict; (3) a stale Added-N hint survived an edit; plus low findings on the wizard having no path back to Default after choosing a harness (out of scope), the failing-before evidence being narrative-only, and the focus-ring claim not being visible in the recording. Findings 1–3 are fixed in1d429709; the CI attribution and focus wording are corrected above; the failing-before logs are now attached; the Default path is out of scope for [bug] 首启向导保存语言模型时把已选 harness 静默重置为 Default #556/[bug] 首启向导:一次添加多个语言模型后缺少下一步指引 #559.83b142f0, head1d429709— scores and remaining gaps recorded below once both reviews of this candidate complete.1d429709cannot be green because of the wheel-venv dependency drift above; the isolated lane inherits only the [test] canvas: clear the tool rail when seeding the toolbar drag #686 toolbar red.🤖 Generated with Claude Code