Repository navigation
fix(models): backport the cold model list fill to 0.12.1 (batch 24) - #32112
Conversation
#31569) * fix(models): fill a cold model list without waiting for the first chat Codex and the other advertised-selection harnesses, and KAS on the engine bundle, learn their models only from a session's session/new answer. Before one runs, /api/models answers auto alone with a 200 the dashboard keeps, so the picker shows only Auto until a first message. On a cold read for the configured harness, start the deferred background session in a background task and answer at once. Its session/new fills the list through the existing capture, and a models_changed frame makes the dashboard re-read. One probe at a time, none while a background session is live, and no frame when the start fails, so a harness that advertises nothing cannot loop. Closes #31566 Closes #31280 * test: wait on the cold probe task by signal, not a 5s bound The wait-discipline ratchet refuses a short fixed wait_for in a new test file. await_until takes the task the test already holds and uses the lost-run bound instead. (cherry picked from commit 2552c90)
0e3ba3e to
928a589
Compare
GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 6.1 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- src/kiro_crew/dashboard/handlers/models_cold_probe.py:98 -- Cold-list refresh is lost before the first WebSocket connects
Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1: LOW harm. The failure needs two things to happen in order. First, False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. This change adds or alters no control, label or string. It only refetches the existing model picker's list when a [UX-REVIEWED] 928a589 Description read[DESCRIPTION-READ] 6ac77df6ef72186e910fad525d1b7409bc67e6325038bd2c8fa4e0c4b656b054 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS This is a clean Notes
[DESIGN-REVIEWED] 928a589 Description read[DESCRIPTION-READ] 3350a0d1a29dc7903ee1ee5233d04a4fc0828f6171cf51f30294b919e8c74e1c That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This is a clean backport of #31569, whose defect is reported in #31280 and #31566. Every item fixes the cold-list mechanism directly and has one emitter and one consumer. What this change shipsInventory (6 items) — 6 justifiedIntent: let a 0.12.0 user see their harness's real models in the picker after a restart or re-sign-in, without sending a chat first. This is a FIX, backported unchanged from
[FIRST-PRINCIPLES-REVIEWED] 928a589 Description read[DESCRIPTION-READ] d5f3348b256d0851fc965dc732dc357fd76a584b442b0ac9eaa137f1a4ab447f That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Problem / Motivation
Goal: Bring #31569, a model-picker fix that merged on
mainafterv0.12.0, ontorelease/0.12.0as one commit in a PR of its own, so it can be reviewed and reverted apart from the low-risk batches.Why it matters
session/new, the model picker shows only "auto" after every gateway restart or re-sign-in, until a first chat message is sent.Not a goal
main; nothing is changed only here.CHANGELOG.mdchange. Cuttingv0.12.1-rc.Nand the bare tag follow docs/build/release.md and stay with the maintainers.What changed (motivation → approach → change)
The main squash commit was cherry-picked with
-xontorelease/0.12.0@3c7bb81811, keeping its original author.2552c90918928a58916dFile line cap. The pick takes
src/kiro_crew/dashboard/handlers/agents.pyfrom 2,000 to 2,002 lines, over the 2,000-line cap thatscripts/check_file_line_cap.pyenforces.maincarries the same 2,002 lines. Nothing was trimmed by hand and no baseline row was added. This PR does not wait for the split: #32123 onmainmovesapi_effort_levelsintohandlers/agents_effort_levels.py, and once it merges it is picked into the next release batch soagents.pyon this branch goes back under the cap.No hunk was resolved by hand; the pick's added and removed lines are identical to its main commit. Every session-manager helper it calls (
_configured_bg_backend,_bg_backend_supports_runtime,get_bg_session) already exists on this branch.What it does. When
GET /api/modelsfinds no advertised models for the configured harness, it answers at once as before and starts one throwaway background session in a background task. That session'ssession/newrecords the models through the same capture a chat session uses. The session is then destroyed, and an emptymodels_changedframe tells each dashboard to read the list again.The guard. The probe is bounded so it cannot loop or pile up sessions. It does not wait for other background work to finish; it opens its own handle on the shared runtime beside it.
_bg_backend_supports_runtime), whereget_bg_sessionhands each caller its own short-lived session handle, so destroying it closes no other sessionCOLD_PROBE_COOLDOWN_SECS = 300)?backend=) keeps today's answermodels_changed, so nothing re-reads in a looptest/test_models_cold_probe.pyandtest/test_api_models_kas_bundle.pypin these, andwebsite/src/test/useWebSocket.modelListRefetch.test.tspins the dashboard's re-read onmodels_changed.builder-security checked: no new route, bind, listener or auth check. The probe runs inside the existing authenticated
GET /api/modelshandler, and themodels_changedframe carries an empty payload to dashboards already connected.Backwards compatibility
Compatible: the change is the one already merged on
main, and its own compatibility note applies unchanged./api/modelsanswers the same body as before; a cold read now also starts one bounded background probe.Removes nothing: no setting, route or behaviour that 0.12.0 accepts is removed.
Tests
Proof: not provable -- other: a backport of a main commit whose proof ran on its own PR
release/*, so the related set was run here: every touched test file plus every test file that imports a touched module or reads/api/models, 134 files, one pytest process per batch of 20,-n 0. 5405 passed, none failed.useWebSocket.modelListRefetch.test.tsplus every test that importsuseWebSocketor the app SDK index, 41 files, 370 passed.Manual verification
N/A - the fix was verified on its own main PR. The 0.12.1 RC soak is the end-to-end check.
Screenshots / video
Why no screenshot: the frontend change only re-reads the model list on a new frame; it is applied from
mainunchanged and reviewed on its own PR.Related Issues
Backport to the 0.12 line for 0.12.1 of #31569. Source issues: #31280, #31566.
Sibling sweep
Siblings: none -- the source PR carried its own sibling sweep; this PR only carries that fix.
Pattern harvest
Not generalizable: this PR only carries a fix already on
main. The source PR has its own harvest.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.