Skip to content

security(transcribe): cap chunk count to bound Whisper cost/output - #374

Closed
mikerivera33 wants to merge 1 commit into
Panniantong:mainfrom
mikerivera33:followup/bound-transcription
Closed

security(transcribe): cap chunk count to bound Whisper cost/output#374
mikerivera33 wants to merge 1 commit into
Panniantong:mainfrom
mikerivera33:followup/bound-transcription

Conversation

@mikerivera33

Copy link
Copy Markdown

transcribe() looped over every chunk with no limit, so a multi-hour or hostile source ran up unbounded Whisper API spend and flooded the agent context. Caps at MAX_CHUNKS (~4h) and appends a clear truncation marker. Test asserts the cap bounds the number of Whisper calls.

🤖 Generated with Claude Code

transcribe() looped over every chunk with no limit, so a multi-hour or hostile
source ran up unbounded Whisper API spend and flooded the agent context. Cap at
MAX_CHUNKS (~4h) and append a clear truncation marker when exceeded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Panniantong

Copy link
Copy Markdown
Owner

感谢指出转录 chunk 数量会放大成本。merged #577 已加入文件大小、三小时时长、chunk 总量和临时目录边界,并覆盖回归测试,因此关闭。

@Panniantong Panniantong closed this Aug 6, 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.

2 participants