Skip to content

feat(stt): manage speech models in a table with download, select and remove - #17624

Open
Pearcekieser wants to merge 1 commit into
kirodotdev:mainfrom
Pearcekieser:feat/voice-settings-model-table
Open

Pearcekieser wants to merge 1 commit into
kirodotdev:mainfrom
Pearcekieser:feat/voice-settings-model-table

Conversation

@Pearcekieser

@Pearcekieser Pearcekieser commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: In Settings > Voice > Speech-to-Text, a user can see every local speech model's size and state, and download, select or remove each one from one place.

The Model row is a dropdown. It shows the state of the selected model only, and a Download button appears only when that model is missing. A user cannot see which other models are on disk, cannot fetch a model without first selecting it, and cannot delete one. Models run from 78 MB (tiny) to 1.6 GB (large-v3-turbo), so a user who tried the large one has to delete files under <data home>/models/whisper/ by hand to get the space back. A transfer of an unselected model is also invisible: the panel shows progress only for the selected model.

Why it matters

The space cost is real and the only remedy today is a shell command in the gateway's data directory. Without a list of what is installed, a user also cannot tell which models the next selection will download.

Not a goal

What changed (motivation → approach → change)

A user can now manage the speech models from Settings instead of the data directory, and the panel says what each model costs and whether it is on disk.

Before After
dropdown, selected model's state only one row per catalog model: name, size, Selected / Installed / Not downloaded, live progress; a failed download or a refused Remove gets a full-width row under that model
Download only for the selected model Download on any missing row; every Download waits while one transfer runs
no removal Remove on installed, unselected rows, behind a confirmation that names the size

The new route DELETE /api/stt/models/{name} in src/kiro_crew/dashboard/handlers/core.py looks the name up in the catalog, so an alias, a filename or a traversal is a 404 and never becomes a path. ModelStore.remove in src/kiro_crew/stt/models.py deletes only models_dir() / model.filename; every catalog filename is one plain component, which a test pins, so the delete cannot name another directory. A symlink at that path is unlinked as a link, never followed. It refuses with 409 and a code instead of changing anything else: the configured model, aliases included (stt_model_selected); a model that work still reads (stt_model_in_use): a live voice session keeps the model it started with after the user selects another, and a batch transcription fixes its model before the upload and transcode awaits. A removed file would make that work re-download it, or fail offline and lose the audio. Both take a ModelClaim from src/kiro_crew/stt/models.py (LocalSession until finish has decoded or cancel runs, POST /api/stt/transcribe for the whole request, _transcribe_local for the Slack path, and a meetings audio import from its config snapshot until the transcript is back, so a split import keeps its model across every segment; the transcribe route, the meetings import, Slack voice memos and channel attachments all take it through transcribe.local_model_claim, which claims only for the local provider), and ModelStore.remove refuses a claimed model in the same synchronous step as the unlink. The route also checks before releasing anything. Claims sit in a weak set, so a holder dropped without releasing cannot pin a model; the model resident in the recogniser (stt_model_in_use), matched on the residency key's full path and never the file name, because a custom model may sit in a subfolder under a catalog file name (sub/ggml-small.bin) and is then the user's own selected model; the model a load is reading: WhisperEngine.ensure_loaded claims its own model before its first await, so the claim check refuses it (stt_model_in_use), and a native build that outlived its timeout, which keeps reading after that call returns, is refused by its path (stt_model_loading, matched on WhisperEngine.building_path); a load or download of another model does not block; and the model being downloaded (stt_model_downloading). A deselected model is often still resident, because only the idle sweep unloads it (600 s by default). Removing it is the table's main use, so the route first releases it with the new WhisperEngine.release_if_resident, under the load and decode locks the way idle eviction takes them, and re-reads the selection after that await; stt_model_in_use then answers only a model something put back. While any load is running the route skips that release, because it would wait on the load lock for a whole first download; the model then answers a retryable stt_model_in_use, and #20713 plans to drop the release step. ModelStore.remove refuses on the store's transfer record (ModelStore._transfers), not on the display status, and a second ensure for a model whose transfer is still running, for example after its caller was cancelled, joins that transfer under asyncio.shield instead of starting a second writer; the record clears when the transfer completes. No await sits between the remaining checks and the unlink, so no load or download can start in the gap.

SttModelTable in website/src/pages/settings/SttModelTable.tsx marks the row the status endpoint resolves the configured model to, so an old medium config shows large-v3-turbo as Selected; the download prompt and the CPU-slowness warning follow the same resolved name, so a medium config on a CPU-only build now gets the warning large-v3-turbo always had. Every row has a state badge: Installed, Not downloaded, or progress. The old dropdown showed no line for an installed selected model, and the table keeps that, adding no reassurance line under it; the per-row Installed state is what lets a user see what is on disk, which is the point of the table. Each refusal code maps to a sentence that says what to do, shown under the row it was for. When the selected model is not on disk yet, the download prompt is a row under that model, not a line below the table. A failed download says in plain words that it stopped and to choose Download now again; the gateway's reason rides in the agent hand-off. The row button reads Select, the same word as the Selected badge. The selected row never offers Remove and adds no standing line explaining why; trying to remove the configured model through the API returns the stt_model_selected sentence. At most two buttons per row. The table uses the shared table-striped class, and each model's rows carry that model's stripe, so a failure or refusal row stays on its model's band instead of shifting the stripes below it. Below sm each row stacks its parts (name and size, then the status badges, then the buttons) and the column header is hidden: at 320px the pane is 288px wide, and in German the "Nicht heruntergeladen" badge beside a "Jetzt herunterladen" button pushed the buttons 74px past the edge. The new client call is api.sttDeleteModel in website/src/api/client/voice.ts. website/scripts/settingsExtract.ts indexes the table as the stt.model setting, so the settings registry and its deep link are unchanged.

VoicePanel in website/src/pages/settings/VoicePanel.tsx now loads SttSettings with lazy() behind a Suspense skeleton. The table pushed the SettingsPage chunk to 503.9 KB against the Bundle Size Gate's 500 KB default. With the split, SettingsPage builds at 492.25 kB and the speech-to-text card is its own 40.57 kB chunk, fetched only when the Voice tab opens. Settings deep links still reach stt.* controls because useSettingHighlight waits for late elements.

Backwards compatibility

Compatible: GET /api/stt/status, POST /api/stt/prepare and the stt.model config key are unchanged; the new route only adds a way to delete a file the user could already delete by hand.

Removes nothing: the Model dropdown is replaced by a table that writes the same stt.model key, keeps the label, hint and configKey, and the registry entry for voice.model is byte-identical. The retired model_option catalog key had no other reader.

Tests

  • test/test_stt_model_delete.py, 68 tests: a model claimed by a batch transcription, or claimed during the release, is refused stt_model_in_use, and ModelStore.remove refuses a claimed model itself; the transcribe route and the local batch path hold the claim for the whole request and drop it after; a deselected model a live session still uses is refused stt_model_in_use without being released, and removed once that session is cancelled; a session started during the release also refuses it; a finished or garbage-collected session does not pin its model; a deselected model still resident (the idle sweep has not run) is released and removed; one something put back during the release is refused stt_model_in_use; one selected again during the release is refused stt_model_selected; a non-resident model releases nothing; release_if_resident drops only the named file and waits for a running decode; a selected, resident custom model at sub/ggml-small.bin is neither released nor touched when small is removed, and release_if_resident leaves it loaded; removal of an installed unselected model and only its file; a second removal is a no-op; refusals for the configured model, a configured alias, the resident model, a model a load is reading (through its claim) or an overrun build is still reading (by path), and the downloading model; a load of another model does not block removal; a download of another model does not block; exact catalog names only, with alias, filename, traversal and case variants all 404 and untouched; an app claim is 403; the route is registered; WhisperEngine.loading and WhisperEngine.building_path for an idle engine, a held load lock and a load past its timeout; a pending prewarm refuses removal of its model and a cancelled load releases its claim; the store resets a stale ready status and removes a symlink without its target; every catalog path is one file directly in the models directory.
  • test/test_meetings_audio_import.py, 3 new tests: a local-provider import holds its model claim through the duration probe and the split, for a split that succeeds and one that fails, and drops it after; a cloud-provider import claims nothing. Both local cases fail without the route's claim.
  • website/src/test/SttSettings.modelTable.test.tsx, 17 tests: the shared striped-table class, and a notice row on its model's stripe with the stripes below it unshifted; every row's state; an alias selects the resolved row; no Remove on the selected row and no standing hint; the selected row offers Download when its model is missing; a failed download renders on its own full-width row with a plain sentence and keeps Download; a refusal renders under its row; at most two buttons per row; Select writes stt.model; Download fetches without selecting; one transfer holds every Download; Remove confirms with the size, deletes, and re-reads status; cancel deletes nothing; each 409 code shows its sentence.
  • Existing panel tests now address the table instead of the dropdown: SttSettings.modelDownloadDisclosure, SttSettings.surface, SttSettings.decoder. ApiClient.refactor.surface pins the new client key; destructiveConfirm records why the two confirm keys need no quoting.

test_a_resident_model_is_not_released_during_another_load fails with not engine.loading removed from the release guard in core_stt_status.py. While any load holds the load lock, a resident model is refused stt_model_in_use at once instead of waiting on that lock for a whole download.

Catalog keys under pages.settings.sttSettings.model_* are translated in all 12 shipped languages in website/src/i18n/locales/, with en-XA.json regenerated and a translator note for the Select button in website/src/i18n/en.context.json. src/kiro_crew/docs/configuration.md, docs/system-specs/modules/stt-streaming.md, docs/system-specs/modules/learn-cron-dashboard.md and docs/feature-map/README.md describe the route and the table.

Manual verification

End to end in a disposable pod on an earlier head (before the deselected-model release, which the unit tests above cover), with sparse files of the exact catalog sizes planted under the pod's models/whisper (no real model downloaded), stt.model=base:

Request Result
DELETE /api/stt/models/small 200 removed: true, file gone, status shows small not present
same again 200 removed: false
DELETE /api/stt/models/base 409 stt_model_selected, file kept
medium, ggml-small.bin, ..%2Fconfig.json 404
no token 403

Not exercised in the pod: stt_model_in_use, stt_model_loading and stt_model_downloading, which need a real whisper load or a live transfer; the unit tests above cover them. A browser pass against the pod stopped at its first-run onboarding, so the screenshots come from website/capture/voice-settings.tsx (shipped SttSettings, API stubbed) in Chromium.

Screenshots / video

The Custom model row, added by the rebase onto #14918. These frames come from main's website/scripts/capture-stt-custom-model.mjs, which serves the real built SPA from this head with the API stubbed. The Custom row is always the last row of the table. It has no size, and while it is not selected its only action is Select, with no Download or Remove.

Custom row, not selected, a catalog model in use

Custom selected while its file is missing from the speech models folder. The row has no actions, the status reads "Model file problem" and the reason shows under the file name field:

Custom selected, file missing

Custom selected with its file in place, shown as Selected and Installed:

Custom selected, file present

The frames come from website/capture/voice-settings.tsx (shipped SttSettings with the API stubbed). The wide frames are from an earlier head, before the table was striped; this head changes nothing else in the wide layout. The 320px, 390px and German 820px frames are from this head and show the stripes. The two refused-Remove frames are from this head too: website/capture/voice-settings.tsx takes &refuse=stt_model_in_use to stub the 409, and they show the current text, "Voice input is still using this model. Try again when it finishes."

At 320px in German, before and after (the GPT narrow-viewport finding). A check in the capture script measured every table button ending at 394px in a 320px window before, and inside the window after:

Before, from an earlier head, with the model name broken at its hyphens and the button label wrapping:

before, German 320px, a model not downloaded

After, on this head:

after, German 320px, a model not downloaded

German 320px idle, before and after, and German at 820px

Before, from an earlier head:

before, German 320px, idle

After, on this head:

after, German 320px, idle
after, German 820px

Before, dark (main's dropdown):

before

After, dark:

after

After, a transfer of an unselected model running (main showed nothing for it):

after downloading

After, Remove confirmation:

after confirm

After, a refused Remove (stubbed 409 stt_model_in_use), on a row under that model, with the Ask the agent hand-off:

after refused
after refused narrow

After, a failed download on its row, at 390px:

after failed narrow

After, the selected model not yet downloaded, with the download prompt on the row under it (German, 820px):

after selected missing

Failed download at full width, narrow table, light theme, and main during the same transfer

after failed
after narrow
after light
before downloading

Related Issues

Closes #17602

Review items deferred from this PR, one issue each:

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@Pearcekieser
Pearcekieser requested a review from a team as a code owner October 7, 2026 07:01
@Pearcekieser
Pearcekieser requested a review from buluoray October 7, 2026 07:01
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 7, 2026
@Pearcekieser
Pearcekieser force-pushed the feat/voice-settings-model-table branch from cdeb2c1 to a9a4d59 Compare October 7, 2026 07:46
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of fe272ffbe71a1f20fee4512833f1463842ca263d via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. Users get back up to 1.6 GB without a shell command, and the delete takes only a catalog name, so a request can never turn into a filesystem path.

Notes

  • The removal is guarded by seven pieces of state that depend on each other: claims, claim_any, _accepting, _transfers, _removals, building_path, and release_if_resident. That is a lot to keep in sync for a rare manual action. A simpler rule would cost very little: refuse with a retryable 409 while any STT load, transfer or claim is live. Each future STT caller would then not have to remember to claim its model.
  • The description was cut off at ## Backwards compatibility, so I could not check the list of affected readers against the code.

[DESIGN-REVIEWED] fe272ff

Description read

[DESCRIPTION-READ] b5eafe111dfadf5d6534f034b561a09693c414a74eb1cebe6858dc5db787aa61

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 72c034169700cdfe7bb63e539d7fd4c6d46694c5 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: the table, Remove and the deselected-model release each remove a harm the description names. The opt-in claim system on every transcription path costs more than the narrow race it closes.

Notes

  • Item 5 — oversized: the race only exists when a model is not selected, not resident and not downloading, yet something read it moments before the click. The protection is opt-in, and the spec admits it: "Code that does neither gets no error". So every future model reader must learn to take a claim, and nothing fails when one forgets. Subtraction: delete ModelClaim, claim_any, claimed_stt_snapshot and local_model_claim, and the wraps that use them. Those are 3 claimed_stt_snapshot sites (audio_import.py, messaging/attachments.py, slack/events_voice.py), local_model_claim in core_stt_speech.py, and the claims in stt/session.py, WhisperEngine.ensure_loaded and _transcribe_local. Keep the selected, resident, building_path and _transfers refusals, and let that rare race re-download.

What this change ships

Inventory (9 items) — 8 justified

Intent: let a user see, download, select and remove local speech models from Settings instead of the data directory. ADDITION.

  1. The Model dropdown is replaced by a table with one row per model, showing size and state — justified
  2. Download is offered on any missing row, and every Download waits while one transfer runs — justified
  3. Remove, behind a confirmation, on installed unselected rows (DELETE /api/stt/models/{name}) — justified
  4. Each refusal code is shown as a sentence on the row it was for — justified
  5. In-flight sessions, batch, Slack and meetings transcriptions claim their model, which blocks removal — oversized
  6. Remove first releases a deselected model still held in memory — justified
  7. A second download of a model that is already transferring joins it instead of starting a second writer — justified
  8. The status endpoint returns configured_model; the Selected row and the CPU warning follow the resolved name — justified
  9. The STT card on the Voice tab loads lazily behind a skeleton (bundle gate) — justified

[FIRST-PRINCIPLES-REVIEWED] 72c0341

Description read

[DESCRIPTION-READ] 6ed298968e524709ecf3376b8212a6e804968d98d9a0879e0d82e7bbcc18f1d0

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of fe272ffbe71a1f20fee4512833f1463842ca263d via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. The screenshots show every new table state, but nobody has read them cold: this lane has no blind reader. Pushing the branch to this repository would get one.

Notes

  • Screenshot 15 (phone width, failed download): "Ask the agent" in the error row seems to run to the right edge. Screenshot 14's refusal row wraps inside the width, so this may only be the image crop. Re-take the shot uncropped at 320px to confirm the link isn't clipped.
  • Screenshot 03: the Custom row uses the same "Installed" badge as downloaded models, but the user put that file there by hand. A separate label such as "File found" would tell the two cases apart.
  • model_remove_in_use / model_remove_loading: these refusals only appear after the user has confirmed "Remove the {{name}} model?", so they confirm and are then turned down. If the status endpoint can report that a model is in use, show it on the row or disable Remove before the dialog opens.

[UX-REVIEWED] fe272ff

Description read

[DESCRIPTION-READ] 14a14e5b9d21b13235fb7322a34d9980cce448c244839d51ef297617a0019a85

That sha256 names everything this verdict read: the PR description, plus the 22 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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed fe272ffbe71a1f20fee4512833f1463842ca263d via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

Notes:

  • While an existing model file is being hash-verified (_accepting), the delete refusal uses stt_model_downloading, so the Remove error says the model "is downloading". It is transient and the user can retry, but stt_model_in_use or a verification code of its own would be more accurate.

[OPUS-REVIEWED] fe272ff

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed fe272ffbe71a1f20fee4512833f1463842ca263d via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] fe272ff

@Pearcekieser

Pearcekieser commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=ec7d7961be59

  • Three words for one action.

fixed in fa3bd9c: the row button reads "Select" ("Select {{name}}" for its accessible name), matching the "Selected" badge and the hint "select another model first", in all 12 languages.
The evidence gaps are closed in the description: a refused Remove (stubbed 409 stt_model_in_use), a failed download at 390px, and a selected model not yet downloaded, all captured at this head. The 390px failure frame showed the error wrapping one word per line in the status cell, so the failure now renders in a full-width row under its model; the test "shows a failed download on its own full-width row" pins it.

@Pearcekieser

Pearcekieser commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=6b1de615f2e3

  • Item 7: Installed badge on every on-disk row.

rebutted: the goal is that a user can see each model's installation state (#17602: "understand each model's state from settings"). A table row needs a state; without Installed, an installed selected row would show only "Selected" and read the same as a selected model that is not on disk.
The recorded decision was against a separate reassurance LINE under the dropdown for the ordinary case. The table keeps that: no line appears under it for an installed selected model. In fa3bd9c the test comment in SttSettings.modelDownloadDisclosure.test.tsx states this instead of the old wording.

@Pearcekieser

Pearcekieser commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=b265d3e80576

  • Item 9: CPU warning follows the resolved name.

accepted as described: a medium config loads large-v3-turbo, so the slow-on-CPU warning applying to it is correct. The description now states it.

@Pearcekieser
Pearcekieser force-pushed the feat/voice-settings-model-table branch from a9a4d59 to fa3bd9c Compare October 7, 2026 08:16
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 7, 2026
@Pearcekieser

Pearcekieser commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=12977fcca565

  • A guard that can never fire, presented as protection.

fixed in 2865c06: the branch and MODEL_REMOVE_OUTSIDE are removed. Confinement now rests on what holds by construction: the path is models_dir() / model.filename, and the new parametrized test test_every_catalog_path_is_one_file_directly_in_the_models_dir pins that every catalog filename is one plain component directly in that directory.
The description and docs/system-specs/modules/stt-streaming.md say that instead of claiming a redirect guard.

@Pearcekieser

Pearcekieser commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=86e05a4c8cfc

  • Item 6: the outside-store refusal has no reachable input.

fixed in 2865c06: removed, as above; the test that reached it only by monkeypatching model_path is replaced by the catalog-path invariant test.

@Pearcekieser

Pearcekieser commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=9eebae47fd57

  • The removal refusal is shown away from its row.

fixed in 2865c06: a refused or failed Remove renders in a full-width row directly under the model it was for, the same shape as the failed-download row. The refusal test asserts the notice sits inside stt-model-small-remove-error; the description attaches it at 820px and 390px.

@Pearcekieser

Pearcekieser commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=2c8aa6fc69d9

  • The failed-download row shows raw diagnostics.

fixed in 2865c06: the row says "The download stopped before it finished. Select Download now to try again." (new key, 12 languages; the old download_failed_reason key had no other reader and is removed). The gateway's reason goes into the agent hand-off report as its detail.

@Pearcekieser

Pearcekieser commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=1e4cecfe0caf

  • Suggestion: hint always visible.

fixed in 2865c06: the "select another model first" hint shows only when the selected model is installed, the one case it explains; the selected-not-downloaded test asserts it is absent there.

@Pearcekieser
Pearcekieser force-pushed the feat/voice-settings-model-table branch from fa3bd9c to 2865c06 Compare October 7, 2026 10:21
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 7, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main 09e4e0b as 90311b8 to clear a conflict in website/src/i18n/en.context.json that arrived after readiness passed on 6a8f445. Main had appended entries, so I kept them all and put this PR's model_use key after them. The range-diff changes only that file. Locally the backend file list passes 1,627 tests, the comment-history gate passes against the merge-base, and tsc, i18n and vitest (194) are clean.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Disabled Download buttons give no reason while another model downloads.

    acknowledged, deferred, as on de83cb6 and 1c780aa. The disabled state comes from the one-transfer-at-a-time rule; the reason belongs with the active-transfer field in /api/stt/status, which is the planned follow-up for the Download-row notes.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Attachments 04 and 06 show the old German wrapping.

    acknowledged, kept. They are the deliberate before frames for the narrow-layout fix, each captioned in the description as from an earlier head and placed next to its after frame (05, 07) from this head.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • The table's Status column header repeats the panel's Status row.

    acknowledged, not changed here. Renaming model_table_status touches the string in every locale file; I will fold it into the Download-row follow-up rather than reset readiness for a label.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Delete safety depends on every transcription caller claiming its model; keep the ensure_loaded claim as the backstop.

    agreed, kept. The ensure_loaded claim stays, and the spec paragraph for the route now states the rule for new callers.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Item 6 is oversized: defer the claim registry.

    acknowledged, kept, as on 6c7daa5, 68da741 and 6a8f445. Without the claims, a removal during a session or import makes its next load re-download the file, or fail offline and lose the audio; GPT raised that window as blocking on earlier heads. A maintainer can weigh the trade.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Item 6 duplicate: _transcribe_local claims again inside transcribe_audio.

    acknowledged, kept. The inner claim covers a future transcribe_audio caller that does not claim, which is the gap the Design lane names; a claim on an already-claimed model costs one weak-set entry.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Item 7 rides along: the ensure join under shield.

    acknowledged, kept. It came with the transfer record that GPT's blocking finding on 89d6caa required; without the join, a second ensure after a cancelled caller starts a second writer to the same path. The description now names it.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main 122005d as 0e59705 to clear another conflict in website/src/i18n/en.context.json that arrived after readiness passed on 90311b8. Main had appended entries, so I kept them all and put this PR's model_use key after them. The range-diff changes only that file, plus a context shift in learn-cron-dashboard.md where this PR still adds only the delete route. Locally the backend file list passes 1,627 tests, the comment-history gate passes against the merge-base, and tsc, i18n and vitest (194) are clean.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main 477c91a as fe90dfc to clear another conflict in website/src/i18n/en.context.json that arrived after readiness passed on 0e59705. Main had appended entries, so I kept them all and put this PR's model_use key after them. The range-diff changes only that file. Locally the backend file list passes 1,627 tests, the comment-history gate passes against the merge-base, and tsc, i18n and vitest (194) are clean.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main a6f3cc5ce5 as 95176a0be2 to clear a conflict in website/src/i18n/en.context.json. Main reworded components.crewMode.ultra_ms_now; I kept main's wording and put this PR's model_use key after it. The range-diff against fe90dfcf9d shows only that file changed. Lint, line cap, comment-history, 1,627 backend tests, tsc, i18n check and the 194 SttSettings/settingsCoverage vitest cases all pass locally.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD for human review (policy-sensitive), reviewed at 95176a0.

Both r134 blockers are fixed. The spec paragraph now states the claim rule for new code that reads a model. The description now matches the code: an overrun build is refused by WhisperEngine.building_path (L423), and a load of another model does not block. Every check is green, every AI lane passes, and #20713 to #20722 cover the deferred items.

What still blocks:

  1. Merge conflict. GitHub reports the branch conflicting with main again, in website/src/i18n/en.context.json.
  2. Maintainer sign-off. DELETE /api/stt/models/{name} deletes a model file from disk, and Voice settings: manage local speech models in a table (download, select, remove) #17602 is tier:T3 without triaged. A maintainer has to review the delete path and approve the table design.

AI findings judged non-blocking:

I read the source and CI; I did not run any PR code.

— crew-pr-reviewer (r137)

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main 8742abf8d0 as 43e76ca766 to clear conflicts in docs/feature-map/README.md and website/src/i18n/en.context.json. Main added display rows above the voice row and left that row unchanged, so I kept its rows and restored this PR's voice row. In the context file I kept main's new entries and added model_use after them. I also removed the unused export { SttModelTable } from SttSettings.tsx, which r137 listed as First Principles item 9. Lint, line cap, comment-history, the backend files (1,646 passed), tsc, i18n check and the 194 SttSettings/settingsCoverage vitest cases pass locally.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Pushed c4729e51ce to fix the Bundle Size Gate on 43e76ca766. The SettingsPage chunk built at 503.9 KB against the 500 KB default; main alone is under it, and this PR's table pushed it over. VoicePanel.tsx now loads SttSettings with lazy() behind a Suspense skeleton, so SettingsPage builds at 492.25 kB and the speech-to-text card is its own 40.57 kB chunk. Locally the bundle gate passes (995 chunks within budget), the chunk-cycle gate finds no cycles, and tsc and 836 Settings, voice and STT vitest cases pass. The Security Scope Review failure on 43e76ca766 was a generate job that never finished, so no leg ran; the new push re-runs it.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main 254c8518d2 as 2305679181 to clear a conflict in website/src/i18n/en.context.json. Main appended entries after this PR's anchor; I kept them and added model_use after them. The range-diff against c4729e51ce shows only that file changed. Lint, line cap, comment-history, 1,669 backend tests, tsc, i18n check, 245 SttSettings, settingsCoverage and voice-panel vitest cases and the bundle gate (1,001 chunks within budget) pass locally.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main 405155bdbd as 35bb7bc370 to clear a conflict in website/src/i18n/en.context.json. Main appended entries after this PR's anchor; I kept them and added model_use after them. The range-diff against 2305679181 shows only that file changed. Lint, line cap, comment-history, 1,677 backend tests, tsc, i18n check, 245 SttSettings, settingsCoverage and voice-panel vitest cases and the bundle gate (1,007 chunks within budget) pass locally.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 35bb7bc37058112f372b2d4fb06a60f60917ead4, reserved for human review.

This head rebases 95176a0 (our r137) onto newer main and makes two small changes: it removes the unused export { SttModelTable }, and it loads SttSettings with lazy() behind a Suspense skeleton so the Settings chunk stays under the bundle gate (VoicePanel.tsx). The delete path and the model store are unchanged from r137. The branch now merges cleanly with main. Design, First Principles, Opus and GPT pass at this head; UX passed on the previous head.

What still blocks:

  1. Maintainer sign-off. DELETE /api/stt/models/{name} deletes a model file from disk, and Voice settings: manage local speech models in a table (download, select, remove) #17602 is tier:T3 without triaged. A maintainer has to review the delete path and approve the table design.
  2. CI is still running. Backend Tests (Linux and Windows), Frontend Tests and E2E are queued or in progress on this head, and PR Readiness is pending.

AI findings judged non-blocking:

  • First Principles item 6: the claim inside _transcribe_local is redundant with the outer claims. A redundant claim is harmless; removing it is a simplification.
  • First Principles item 7: release_if_resident is interim code until Speech models: drop the resident-model refusal and release_if_resident from DELETE #20713, which already tracks dropping it.
  • Design notes: the claim layer is large for one button, and a shielded transfer cannot be cancelled. Neither is a defect today, since there is no cancel button.

I read the source and CI; I did not run any PR code.

— crew-pr-reviewer (r145)

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main d10a48b0fa as 19c186020e. This clears the conflict and picks up #29458, the main-side fix for the test_decisions_end_to_end failure that turned Backend Tests (3.12, 5) red on 35bb7bc370.

Two files needed changes:

  • website/src/i18n/destructiveConfirm.test.ts conflicted because main and this PR both added entries to CONFIRM_OPERAND_KEY_EXEMPTIONS. I kept main's entry and added this PR's model_remove_confirm_title and model_remove_confirm_body after it.
  • website/src/test/SttSettings.customModelGuard.test.tsx gained a test in fix(frontend): mark picker rows busy and seed stt rows during render #20646 that looks for the model combobox. This PR replaces that combobox with the model table, so the test never found it. It now looks for the table. Moving the config seed back into an effect still makes it fail, so it guards what it was written for.

website/src/i18n/en.context.json also conflicted again, and I added model_use after main's new entries as before.

Lint, line cap, comment-history, 1,678 backend tests, tsc, i18n check, 892 Settings, STT and destructiveConfirm vitest cases and the bundle gate (1,021 chunks within budget) pass locally.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Pushed a8a14d779f, rebased onto main 53fbe49e74, to fix the Flake Pattern Ratchet on 19c186020e. Main added check K19 in #30029 after my previous base. It flags a test that passes a non-zero literal as a timeout or other duration. It counted 9 sites in test/test_stt_model_delete.py, a new file here, and 2 sites this PR added to test/test_meetings_audio_import.py.

  • The seven WhisperEngine(idle_evict_secs=60, timeout_secs=30) builds no longer pass timeout_secs. None of those tests exercises the timeout, and the engine default is 300 s.
  • The new fake config in the meetings test uses FALLBACK_TIMEOUT_SECS from kiro_crew.testing.wait, as the rule asks.
  • Three monkeypatch.setattr calls carry # flake-ok: because they replace audio_exceeds_secs and batch_duration_cap_secs, which are functions with seconds in their names, not durations. Main already has the same shape 4 times in that file.

Await Fast Gate, Coverage Gate and PR Readiness were red on 19c186020e only because Fast Gate failed on the ratchet and skipped the heavy jobs. The ratchet passes locally against 53fbe49e74, and so do lint, black, line cap, comment-history, 1,754 backend tests, tsc, i18n check, 890 vitest cases and the bundle gate.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main 942ab8b155 as fe272ffbe7 to clear a conflict in website/src/i18n/en.context.json. Main appended entries after this PR's anchor; I kept them and added model_use after them. The range-diff against a8a14d779f shows only that file changed, and main has not changed the flake ratchet since the K19 fix.

GPT 6.1 Review was incomplete on a8a14d779f because its "Fetch authentic diff" step failed before the review started. This push runs it again.

Lint, black, line cap, comment-history, the flake ratchet, 1,754 backend tests, tsc, i18n check, 890 vitest cases and the bundle gate (1,021 chunks within budget) pass locally.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at fe272ff, reserved for human review.

This head rebases 35bb7bc (our r145) onto main. The range-diff changes only tests and i18n context: the flake-ratchet K19 fixes in test/test_stt_model_delete.py and test/test_meetings_audio_import.py, and SttSettings.customModelGuard.test.tsx now looks for the model table instead of the old combobox. The delete path and the model store are unchanged from r145, and I found no defect in them. Every check on this head is green or skipped, and every AI lane passes.

What still blocks:

  1. Maintainer sign-off on the delete route. DELETE /api/stt/models/{name} is a new route that deletes a model file from disk (models.py#L686-L706). That class of change is reserved for a person.
  2. Design sign-off. Voice settings: manage local speech models in a table (download, select, remove) #17602 is tier:T3 without triaged, so a maintainer must approve the table design.

AI findings judged non-blocking:

  • Design and First Principles item 6: the claim layer is large for one button. It is a simplification question, not a defect.
  • UX notes (320px clip check, "Installed" on the Custom row, in-use refusals after the confirm dialog): cosmetic, for the design sign-off.
  • Opus note: a removal during verification says "downloading". The refusal is correct and can be retried; only the wording is off.

Our earlier change request (54f4231) can be dismissed once a maintainer approves. I read the source and CI; I did not run any PR code.

— crew-pr-reviewer (r146)

@buluoray

buluoray commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]:

Reviewed at fe272ff.

Both points from the last request-changes are fixed on this head. The spec now states the claim rule for new model readers, and the description now matches the building_path refusal. The rest of the range-diff since 54f4231 is the rebase plus the flake-ok test annotations.

The delete path holds up. The name only ever selects a catalog entry. ModelStore.remove refuses a transfer, a verification and a claim in the same synchronous step as the reservation. _unlink_model_file checks the parent directories are real and never follows a link at the leaf. I reverted the claim check in remove, the building_path refusal, the _transfers refusal and the selected-model refusal one at a time. Each revert turns at least one test in test/test_stt_model_delete.py red. CI is 91 passed, 11 skipped, 0 failed on this head, and every AI lane passes.

Non-blocking follow-ups:

  1. The Testing section says "The loading refusal test fails with the engine.loading check removed." That is no longer true. With not engine.loading and removed from the release guard in core_stt_status.py (L408), all 67 tests still pass. That guard is now the only engine.loading read, and it keeps a delete from waiting on the load lock for a whole first download of another model. A test that holds the load lock and checks the delete answers stt_model_in_use without blocking would pin it. Please also fix the sentence.
  2. Speech models: a download of another model should not refuse removal as stt_model_loading #20714 is mostly done by this head: another model's load or download no longer refuses removal as stt_model_loading (L423 matches only this model's path). Only the "Try again in a few seconds" wording of model_remove_loading is left. Narrowing that issue after merge would keep the follow-up list accurate.
  3. The SttModelTable docstring (L96) still says "Use plus Download or Remove". The button reads Select now.

AI lane notes on this head, none blocking: Design's single-refusal idea would block removal during a live dictation session. First Principles item 6 overlaps the planned #20713. UX's three notes are cosmetic. Opus's "is downloading" wording during verification is retryable.

The linked issue is tier T3 and this adds a route that deletes files on disk, so I am leaving the approval to a maintainer.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

All three follow-ups are fixed in a local commit, 6507e6ebd3, which goes out with the next push this PR needs. Main has conflicted with this branch every few hours, so that push should come soon. Until then I am not pushing a passed fork PR for non-blocking notes alone, because each push restarts CI and the review lanes.

  1. A new test, test_a_resident_model_is_not_released_during_another_load, has the engine report a load in progress while the model is resident. It checks that the delete answers stt_model_in_use and never calls the release. It fails with not engine.loading removed from the guard at L408, and it is the only test in the file that does. The Testing section will name it in place of the stale sentence, and the count goes to 68.
  2. I will narrow Speech models: a download of another model should not refuse removal as stt_model_loading #20714 to the model_remove_loading wording after merge.
  3. The SttModelTable docstring now says "Select plus Download or Remove".

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

This PR is ready for maintainer review. It replaces the speech-model dropdown in Voice settings with a table that can download, select and remove models. It adds DELETE /api/stt/models/{name}, which deletes a model file from disk. Issue #17602 is tier:T3 and not triaged, and a route that deletes files is reserved for a person, so the automated reviewers have left the approval to a maintainer.

Where review stands on fe272ffbe7:

  • Every CI check and every AI review lane passes.
  • crew-pr-reviewer r146 found no defect in the delete path or the model store and holds the PR only for human review. It says its earlier change request on 54f4231 can be dismissed once a maintainer approves.
  • buluoray's review reverted each removal refusal one at a time, and every revert turned a test red.

Two decisions need a maintainer:

  1. Sign-off on the delete route. The name only selects a catalog entry, so an alias, a file name or a path gets a 404. Removal is refused for the selected model, a model a session or batch job has claimed, a resident model the release could not drop, a download or verification in progress, and a file a native build is still reading. The route is in src/kiro_crew/dashboard/handlers/core_stt_status.py and the store in src/kiro_crew/stt/models.py.
  2. Approval of the table design for Voice settings: manage local speech models in a table (download, select, remove) #17602. Screenshots of every row state are in the description.

The branch conflicts with main again, in an import list in src/kiro_crew/dashboard/handlers/core.py. The rebase, 72c0341697, keeps main's new _transcribe_while_connected import beside this PR's _stt_transcribe. It goes out at the next CI slot together with the three follow-ups from buluoray's review, and it changes nothing in the delete route or the model store. Non-blocking follow-ups are tracked in #20713 to #20722.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Voice settings: manage local speech models in a table (download, select, remove)

5 participants