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(the reviewed code; later merges bring only main changes):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.de608775), re-ran on that head:tsc --noEmitclean,npm test1113 passed, both browser tests passed on the dev server, andcheck:i18n,check:browser-locale, andcheck:browser-manifestwere green.1f670c02(merges currentmainat104cd9ed; the merge brings only main files, 26 changed, and the PR's own code is unchanged since1d429709):tsc --noEmitclean,npm test1114 passed,check:i18n3859 keys / 0 problems,check:browser-manifest112 entries gate=39,check:browser-locale102 pages / 0 problems, and bothfirst_run.mjsandfirst_run_added_models.mjspassed against the isolated fixture API and dev server.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'(log).first_run_added_models.mjsfails waiting for the "Added 2 language models..." hint that the base does not render (line 98 in the test copy attached to the base run, line 99 in the current test) (log).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.1f670c02(run 47401497494): every lane passed —static,python(23m12s),frontend,browser (isolated)(10m20s),browser (assistant),browser (voice),desktop / macos,desktop / windows, and the aggregatechecks / checks; thetestsworkflow and CodeQL are green too.Earlier CI failures and their resolution
At the previous head
1d429709(run 47392989081),frontend,desktop / macos, anddesktop / windowsbuilt a fresh venv from the packaged wheel and resolvedfastapi 0.165.1withopentelemetry-api 1.46.0, failing infastapi/telemetry/_asgi.py;browser (isolated)also had the known #686canvas_toolbar_topbar.mjs:125timeout. Both causes were fixed onmain(wheel metadata pin and toolbar fix). On the final head1f670c02, merged withmainat104cd9ed, every lane passes in run 47401497494, including both desktop jobs andbrowser (isolated).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 unchangedThe hint and marker rendering is unchanged between
4a9e43c5and1f670c02; the later commits modify onlyfinishModelSetup, theonSavedcallback, and the edit-path focus reset. Screenshots 04/05 show that rendering, and the tip's gate test asserts the hint, both markers, first-row focus, and the unchanged-then-updated agent.Provider 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— WITHHOLD (required Release checks red on this SHA from the wheel-venv dependency drift and the known [test] canvas: clear the tool rail when seeding the toolbar drag #686 toolbar red), 93/100, no actionable defect.83b142f0, head1d429709— WITHHOLD, 93/100, no actionable defect; recommended updating onto current main, which contains [bugfix] packaging: cap opentelemetry-api<1.46 to avoid FastAPI ASGI TypeError #691 (opentelemetry-api<1.46) and [test] canvas: clear the tool rail when seeding the toolbar drag #686.104cd9ed(origin/mainwhen the reviews ran;mainhas since advanced to42c5dc39with [ci] python: parallelize suite across three shards and isolate native CLI regressions #692, a CI test-sharding change only, and the PR's diff against42c5dc39is the same 9 files, +338/−26), head1f670c02:1d429709/4a9e43c5; the tip is byte-identical forWelcomeScreen.tsxand both test files, and the tip's CI ran both), simplicity 3/3 (no added comments).check:i18nis 3859 keys / 0 problems andcheck:browser-manifest112 entries / gate=39,mergeStateStatusis CLEAN, and the PR files are byte-identical between1d429709and1f670c02.1d429709/4a9e43c5, not the tip; the reviewed component and tests are byte-identical at the tip and the tip's CI executed both tests. The full Python suite,npm run build, and the other browser lanes were not run locally; Release checks on the tip are green.🤖 Generated with Claude Code