Repository navigation
fix: dictation clean-up survives a cold local model (1.45.1, D-010) - #6
Open
nkeating-cmd wants to merge 2 commits into
Open
nkeating-cmd wants to merge 2 commits into
nkeating-cmd wants to merge 2 commits into
Conversation
Clean-up failed whenever the local Ollama model was not loaded and took over 30 s to load (twice on 23 Oct on the main laptop; one cold load measured 108 s with 3 GB of RAM free). The 30 s request limit also had to cover the load, and giving up cancelled the request, which makes Ollama abort the half-finished load, so every retry started from zero. - The clean-up runs as its own task. A dictation waits at most 30 s at the cursor (unchanged), then pastes the words as spoken, shows "Pasted as spoken - see History" on the pill, and lets the clean-up finish; the result is filed on the History entry only if it still has none. History retry and Notes wait for the answer. - Dictation requests to Ollama may run 300 s; a pre-warm 300 s (was 120 s, under the slowest load seen). - A clean-up dictation starts loading the Ollama model when recording starts (no transcript text sent), so the load runs while you speak. - Log rotation keeps four earlier files instead of deleting the log. - Version 1.45.1; README, D-010, L-014. Tests: cleanup_wait_tests (5), late_clean_up_fills_only_an_empty_entry, dictation_and_warm_outlive_a_slow_cold_load, and a live test (live_cold_dictation_survives_the_cursor_wait: cold model answered 35.0 s after sending, one load, no abort). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EXpf5AYj4BYHJqpHxqLNp2
An independent review of f5b87a7 found 3 Major and 8 Minor issues. Major - M1: only a local Ollama clean-up may finish late. Cloud and custom providers have their own 30 s client limit, so a late result could never arrive; they are waited for as before (can_finish_late). The pill now says "Pasted as spoken - clean-up continues", which is true when it shows. - M2: the pre-warm loads only a model that is not loaded at all (warm_if_cold), at a context with room for about 4,000 characters of dictation (PREWARM_TRANSCRIPT_CHARS), so the request reuses that load instead of loading the model a second time. - M3: measured, not assumed. With about 3 GB RAM free, a cold load running alongside slowed transcribing a 30 s clip by 0.2-0.3 s (2.55-2.86 s alone, 2.77-3.17 s with the load; two runs each). Recorded in D-010 as an accepted cost. Minor - The pill mentions the late clean-up only when there is a History entry for it to land on. - A late result is filed only while the entry still holds the words it cleaned (a Retry may have re-transcribed it), and whitespace-only clean-ups count as empty, as they do on the History page. - History stores the per-app routed prompt that was actually used. - Doc comment restored to update_post_processed_text. - README and D-010 say what the code does (Ollama only). Tests: 292 passed; only_ollama_clean_up_may_finish_late, the_prewarm_leaves_room_for_a_dictation, and a re-transcribed-entry case in late_clean_up_fills_only_an_empty_entry. Live cold test: answered 16.2 s after sending, one load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EXpf5AYj4BYHJqpHxqLNp2
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.
What
Kōrero 1.45.1: dictation clean-up no longer fails when the local Ollama model has to load first. Decision D-010 (
docs/DECISIONS.md), lesson L-014.actions::CURSOR_WAIT, unchanged).customproviders keep their own 30 s client limit and are waited for as before (can_finish_late).prewarm_cleanup_model→warm_if_cold). No transcript text is sent. The context leaves room for about 4,000 characters of dictation, so the request reuses that load.DICTATION_LIMIT, was 30 s). A pre-warm may run 300 s (was 120 s).KeepSome(4), about 2.5 MB) instead of deleting the log at each 500 KB rotation.Why
On 23 Oct, two clean-ups on the main laptop failed at 30.1 s (13:47 and 14:17). Ollama's log shows each request gave up while the model was still loading. Kōrero's log shows
loaded=None, then "The local model didn't finish its answer within 30 s".No fixed limit at the cursor covers every load, and each give-up also threw away the half-loaded model.
Independent review
A separate agent reviewed
f5b87a7, briefed to assume it was wrong. It found no Critical, 3 Major and 8 Minor issues. All were fixed inb7000f9or recorded as accepted costs in D-010.Evidence (main laptop, Windows)
cargo check --locked: pass. The two warnings are already onmain.cargo test --locked --lib: 292 passed, 0 failed, 9 ignored (live tests). New tests:cleanup_wait_tests(7), includinggiving_up_at_the_cursor_does_not_cancel_the_clean_up,only_ollama_clean_up_may_finish_lateandthe_prewarm_leaves_room_for_a_dictation;late_clean_up_fills_only_an_empty_entry;dictation_and_warm_outlive_a_slow_cold_load.live_cold_dictation_survives_the_cursor_wait(gemma4:12b, starting cold): passed twice, answered 35.0 s and 16.2 s after sending. Each time Ollama loaded once and aborted nothing; the old 30 s limit fails the first.bun test unit-tests104 pass;tsc0 errors; ESLint 0 errors (17 warnings already onmain); Vite build OK.cargo denyadvisories identical tomain);--ignore-cr-at-eol.Bet: fix (not a product bet, so the
docs/PRODUCT.mdgate doesn't apply).Not in this PR
customprovider (LM Studio and similar) has neither the late path nor a pre-warm.shipstep after merge.🤖 Generated with Claude Code
https://claude.ai/code/session_01EXpf5AYj4BYHJqpHxqLNp2