Repository navigation
fix(voice): long summaries were cut off; cap before the spoken rewrite - #84
Merged
Merged
Conversation
Two truncations, both visible on production right after #83: - `long` reply summaries stopped mid-word ("...about one hundred"): Gemini 2.5 Flash's thinking tokens count against maxOutputTokens (1024). Voice summaries now run with thinking off on 2.5 Flash (thinkingBudget 0) and a 4096 cap elsewhere; measured 0.6-1 s instead of ~3.4 s. - `normal` summaries ended in a stray "." mid-sentence: the word cap ran after speakable(), whose expansions ("5s" -> "5 seconds", versions) pushed a within-limit summary over it. Now toSpokenText caps the model's own words first and speakable() runs after; toSpokenText keeps intra-word underscores so identifiers still reach speakable(). An announcement that would outgrow one voice-audio request keeps the un-rewritten text. Also strips an echoed "Project:" label and tells the model not to use one. callGemini accepts an optional thinkingBudget. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 36 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (4)
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 |
2 of 3 tasks
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.
Summary
Two truncations, seen on production right after #83:
longreply summaries stopped mid-word ("…summaries will take about one hundred"). Gemini 2.5 Flash's thinking tokens count againstmaxOutputTokens(1024). Voice summaries now run with thinking off where the model allows it (thinkingBudget: 0on 2.5 Flash, via a new optionalcallGeminioption), and the cap is 4096 elsewhere.normalsummaries ended in a stray "." ("…especially for."). The word cap ran afterspeakable(), whose expansions ("5s" → "5 seconds", "0.25.1" → "0 point 25 point 1") pushed a summary that was within its limit over the cap. NowtoSpokenTextcaps the model's own words first, andspeakable()runs after.toSpokenTextkeeps underscores inside words, so identifiers still reachspeakable().Also strips an echoed
Project:label, and the prompts ask for the project name without one.Measured with the real model (gemini-2.5-flash, prod key)
6 summaries (short/normal/long × 2): all complete, 18–73 words, no label, 0.6–1.0 s each (was ~3.4 s with thinking).
Test plan
bun testspeakable + voiceSummary + routes/voice + ai: 183 pass (new: underscore and label handling, thinking budget per model).tsc: 34 errors both before and after this change.🤖 Generated with Claude Code