Skip to content

Threads limited to the cores, audio buffer bounded - #8

Open
4di-hello wants to merge 1 commit into
LeanBitLab:masterfrom
4di-hello:pr/caller-check
Open

4di-hello wants to merge 1 commit into
LeanBitLab:masterfrom
4di-hello:pr/caller-check

Conversation

@4di-hello

@4di-hello 4di-hello commented Nov 30, 2026 •

Copy link
Copy Markdown

Follow-up to GHSA-5w86-5338-grv4. Thanks for the quick fix in 1.0.5! The caller check and the engine names are covered there, so I rebased this PR onto it and kept only the smaller points from the report:

  • Threads: cpuThreads from the request is limited to the number of cores.
  • Audio buffer: at most 10 minutes of audio are buffered per session, the longest fixed recording setting; an "unlimited" recording is cut there. The buffer keeps boxed samples (about 20 bytes each), so much more would run out of memory anyway; a ShortArray would be the real fix, but that touches more code.
  • isModelReady accepts only known engine names too, like getModelState and deleteModel in 1.0.5.

Compiles, unit tests pass. An independent review (Claude) pointed out that my first limit of 30 minutes would have run out of memory before it was reached, hence 10 minutes. This touches WhisperEngine.kt like #6, so whichever is merged second may need a small rebase; I can do that.

🤖 Generated with Claude Code

… known engines only

Rest of the report on top of the caller check in 1.0.5:
- cpuThreads from the request is limited to the number of cores
- At most 10 minutes of audio (the keyboard's longest fixed setting) are buffered per session; the buffer
  keeps boxed samples (about 20 bytes each), so far more would run out of memory
- isModelReady accepts only known engine names, like getModelState and deleteModel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@4di-hello 4di-hello changed the title Pr/caller check Threads limited to the cores, audio buffer bounded Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant