chore: remove dead local-STT model download plumbing - #5650
chore: remove dead local-STT model download plumbing#5650JMak-Security wants to merge 2 commits into
Conversation
The "stt" capability was removed from download_asset()'s accepted capabilities (chat, vision, embedding, tts), but two leftover match arms in download_file_with_progress() in assets.rs still handled a "stt" label that can never be reached. The frontend capability union types in localAi.ts and LocalModelDebugPanel.tsx still included 'stt' as well, even though no STT download UI is rendered anywhere. The stt_state / stt_model_id fields in LocalAiStatus are untouched, since they are still legitimately set by the hosted STT dispatch path in speech.rs. Fixes tinyhumansai#5462 Signed-off-by: Jason Mak <squrrielbro@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe changes remove ChangesLocal STT download removal
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR removes unreachable local-STT download plumbing and stale type entries without changing supported downloads or hosted speech transcription, so no actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
How this change flows1 changed behaviour across 6 relationships. 5 surrounding behaviours are shown (60 graph nodes walked). 32 further behaviours left out to keep the diagram readable. flowchart LR
n0["LocalModelDebugPanelProps<br/>changed"]:::changed
n1["body"]:::impacted
n2["loadStatus"]:::impacted
n3["runtimeEnabled"]:::impacted
n4["LocalModelDebugPanel"]:::impacted
n5["ModelStatusSection"]:::impacted
n1 -->|calls| n2
n1 -->|uses| n3
n1 -->|uses| n5
n4 -->|uses| n0
n4 -->|uses| n1
n5 -->|uses| n3
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge. |
The capability union type shrank below the 100-col print width once 'stt' was removed, so prettier collapses the parameter onto one line. Signed-off-by: Jason Mak <squrrielbro@gmail.com>
Summary
Removes dead local-STT model download plumbing that issue #5462 identified.
download_asset() in �ssets.rs only accepts chat, �ision, embedding, and ts as capabilities (its match statement explicitly errors with "Unknown capability. Use one of: chat, vision, embedding, tts." for anything else). Despite that, download_file_with_progress() still had two leftover match arms handling a "stt" label that can never be reached from that entry point.
The frontend mirrored the same stale type: the capability parameter union in both �pp/src/utils/tauriCommands/localAi.ts and �pp/src/components/settings/panels/LocalModelDebugPanel.tsx still included 'stt', even though ModelDownloadSection.tsx never renders an STT download control.
What's intentionally NOT touched
stt_state / stt_model_id on LocalAiStatus (in ypes.rs) are still live — speech.rs sets stt_state = "ready" after a successful hosted STT transcription. Only the local-model-download trigger path was dead; state tracking for the hosted path is unaffected.
Changes
Testing
Traced the full call graph by hand (download_asset → download_file_with_progress, and the frontend ModelDownloadSection.tsx UI) to confirm the removed code paths are genuinely unreachable, not just unused-looking. No behavioral change for chat/�ision/embedding/ ts or for hosted STT.
Fixes #5462
Summary by CodeRabbit