Feature/western bandicoot - #2
Conversation
… Revised the format for meeting summaries and discussions to emphasize detail and clarity. Increased maximum output tokens from 16,384 to 65,536 for improved content generation.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughОновлено системний промпт ChangesОновлення Gemini-конфігурації
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
PR Summary by QodoExpand Gemini meeting-summary prompt and raise max output tokens
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
| mediaResolution: 'MEDIA_RESOLUTION_LOW', | ||
| temperature: 0.3, | ||
| maxOutputTokens: 16384 | ||
| maxOutputTokens: 65536 |
There was a problem hiding this comment.
Обрізана відповідь приймається як повна
Коли довга зустріч і новий детальний промпт вичерпують maxOutputTokens, Gemini може повернути частковий текст із завершенням через ліміт. Поточний шлях перевіряє лише непорожній текст, тому користувач отримає успішний конспект, який може обірватися до рішень, доручень або відкритих питань.
There was a problem hiding this comment.
Pull request overview
This pull request updates the Gemini summarization prompt to generate a much more detailed, structured Ukrainian meeting summary, and increases the generation output token limit to reduce truncation for long recordings.
Changes:
- Refactors
GEMINI_PROMPTto require a longer, topic-structured Markdown summary with explicit guidance on capturing concrete details. - Increases
generationConfig.maxOutputTokensto allow longer responses.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| mediaResolution: 'MEDIA_RESOLUTION_LOW', | ||
| temperature: 0.3, | ||
| maxOutputTokens: 16384 | ||
| maxOutputTokens: 65536 |
Code Review by Qodo
1. Неврахований розмір відповіді
|
| generationConfig: { | ||
| mediaResolution: 'MEDIA_RESOLUTION_LOW', | ||
| temperature: 0.3, | ||
| maxOutputTokens: 16384 | ||
| maxOutputTokens: 65536 | ||
| } |
There was a problem hiding this comment.
1. Неврахований розмір відповіді 🐞 Bug ☼ Reliability
Збільшення maxOutputTokens до 65536 (разом із промптом на «дуже довгий» конспект) може генерувати надвеликий текст, який далі без обмежень передається в multipart-аплоад Google Doc та у локальний фолбек через data: URL. Це може призводити до помилок збереження/завантаження або пікових витрат памʼяті при формуванні multipart body/URL.
Agent Prompt
### Issue description
У `Gemini.geminiGenerate()` піднято `maxOutputTokens` до 65536, що разом із новим промптом «пиши довго й детально» збільшує верхню межу розміру конспекту. Далі цей текст без перевірок розміру віддається в `GDrive.createDriveDoc()` (multipart body з повним текстом) або у фолбек `chrome.downloads.download()` через `data:text/plain,...encodeURIComponent(text)`; обидва шляхи чутливі до великих payload.
### Issue Context
- Конспект генерується у service worker та зберігається в Drive як Google Doc (multipart upload).
- При помилці Drive використовується локальне завантаження через `data:` URL.
### Fix Focus Areas
- gemini.js[86-105]
- background.js[165-176]
- gdrive.js[74-97]
### Proposed fix (guidance)
1) Ввести верхню межу на розмір результату перед збереженням (наприклад, по байтах/символах) і:
- або зменшити `maxOutputTokens` до безпечного значення,
- або, якщо текст перевищує поріг, ділити його на частини (кілька документів/файлів) чи робити стислий варіант.
2) Зробити фолбек-завантаження без `data:` URL (щоб не інлайнити мегабайти в URL):
- формувати `Blob([text], {type:'text/plain'})`, отримувати URL через `URL.createObjectURL(...)` і передавати його в `chrome.downloads.download`, після чого викликати `URL.revokeObjectURL`.
3) Для Drive-варіанту розглянути альтернативу multipart для великих текстів (наприклад, завантаження як `.txt/.md` через resumable upload або інший механізм, який не потребує тримати весь multipart body в памʼяті одним блоком).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="gemini.js">
<violation number="1" location="gemini.js:103">
P2: With `maxOutputTokens: 65536` and a prompt demanding maximum detail, long meetings may hit the token limit. When this happens, the Gemini API returns partial text with `finishReason: "MAX_TOKENS"` rather than an error. The current code only checks for non-empty text, so a truncated summary (potentially cut off before decisions, tasks, or open questions) will be saved as if it were complete. Consider checking `candidate.finishReason` and either warning the user or appending a note that the output was truncated.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| mediaResolution: 'MEDIA_RESOLUTION_LOW', | ||
| temperature: 0.3, | ||
| maxOutputTokens: 16384 | ||
| maxOutputTokens: 65536 |
There was a problem hiding this comment.
P2: With maxOutputTokens: 65536 and a prompt demanding maximum detail, long meetings may hit the token limit. When this happens, the Gemini API returns partial text with finishReason: "MAX_TOKENS" rather than an error. The current code only checks for non-empty text, so a truncated summary (potentially cut off before decisions, tasks, or open questions) will be saved as if it were complete. Consider checking candidate.finishReason and either warning the user or appending a note that the output was truncated.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At gemini.js, line 103:
<comment>With `maxOutputTokens: 65536` and a prompt demanding maximum detail, long meetings may hit the token limit. When this happens, the Gemini API returns partial text with `finishReason: "MAX_TOKENS"` rather than an error. The current code only checks for non-empty text, so a truncated summary (potentially cut off before decisions, tasks, or open questions) will be saved as if it were complete. Consider checking `candidate.finishReason` and either warning the user or appending a note that the output was truncated.</comment>
<file context>
@@ -92,7 +100,7 @@
mediaResolution: 'MEDIA_RESOLUTION_LOW',
temperature: 0.3,
- maxOutputTokens: 16384
+ maxOutputTokens: 65536
}
})
</file context>



Summary by cubic
Reworked
gemini.jsprompt to produce a highly detailed, well-structured Ukrainian meeting summary and increased output length to avoid truncation on long recordings. Improves clarity, completeness, and consistency of generated notes.maxOutputTokensfrom 16,384 to 65,536.Written for commit b261f84. Summary will update on new commits.
Summary by CodeRabbit
Greptile Summary
Цей PR робить Gemini-конспект значно детальнішим.
maxOutputTokensдо 65536.Confidence Score: 4/5
Шлях генерації конспекту потребує виправлення для часткових відповідей Gemini.
gemini.js
Important Files Changed
Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile