Skip to content

Feature/western bandicoot - #2

Merged
vaulttec-dev merged 2 commits into
mainfrom
feature/western-bandicoot
Jun 30, 2026
Merged

vaulttec-dev merged 2 commits into
mainfrom
feature/western-bandicoot

Conversation

@vaulttec-dev

@vaulttec-dev vaulttec-dev commented Jun 30, 2026 •

Copy link
Copy Markdown
Owner

Summary by cubic

Reworked gemini.js prompt 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.

  • Refactors
    • Overhauled prompt structure: explicit sections, topic subheaders, exhaustive detail guidelines, and context-rich decisions/tasks.
    • Increased maxOutputTokens from 16,384 to 65,536.

Written for commit b261f84. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Підсилено форматування згенерованих відповідей: вони тепер структуровані в Markdown із чіткими розділами для підсумку, перебігу обговорення, рішень, завдань і відкритих питань.
    • Збільшено максимальну довжину відповіді, тож можна отримувати значно детальніші підсумки без обмеження на короткий виклад.

Greptile Summary

Цей PR робить Gemini-конспект значно детальнішим.

  • Розширено український промпт для повнішого опису перебігу зустрічі.
  • Додано вимогу структурувати обговорення за темами.
  • Збільшено maxOutputTokens до 65536.

Confidence Score: 4/5

Шлях генерації конспекту потребує виправлення для часткових відповідей Gemini.

  • Новий промпт просить модель писати довго й детально.
  • Довгі записи можуть вичерпати бюджет відповіді.
  • Частковий результат зараз може виглядати як успішний повний конспект.

gemini.js

Important Files Changed

Filename Overview
gemini.js Оновлено промпт Gemini та збільшено бюджет відповіді для детальніших конспектів.

Fix All in Cursor

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

… 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.
Copilot AI review requested due to automatic review settings June 30, 2026 19:40
@vaulttec-dev
vaulttec-dev merged commit 3bdbcc0 into main Jun 30, 2026
1 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 580f1ec2-f424-486f-a263-b9b2dfbd3539

📥 Commits

Reviewing files that changed from the base of the PR and between f21355f and b261f84.

📒 Files selected for processing (1)
  • gemini.js

📝 Walkthrough

Walkthrough

Оновлено системний промпт GEMINI_PROMPT у gemini.js: уточнено структуру Markdown-відповіді з розділами та посилено вимоги до повноти викладу без скорочень. Також збільшено maxOutputTokens з 16384 до 65536 у функції geminiGenerate.

Changes

Оновлення Gemini-конфігурації

Layer / File(s) Summary
Промпт та лімітитоксенів
gemini.js
Текст GEMINI_PROMPT переформульовано з чіткішими розділами (короткий підсумок, перебіг обговорення, ухвалені рішення, завдання, відкриті питання) та вимогою максимальної деталізації без скорочень; maxOutputTokens у geminiGenerate збільшено з 16384 до 65536.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

Кролик пише довгий лист,
Токенів стало більше враз —
Шістдесят п'ять тисяч слів,
Жодне рішення не пропаде!
🐰📝✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/western-bandicoot

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Expand Gemini meeting-summary prompt and raise max output tokens

✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Restructure the Gemini prompt to produce longer, topic-grouped Ukrainian meeting minutes.
• Add clearer guidance for summary, decisions, tasks, and open questions.
• Increase Gemini max output tokens to support more complete transcripts and notes.
Diagram

graph TD
A["Meet recording blob"] --> B["geminiUploadFile()"] --> C{{"Gemini Files API"}} --> D["fileUri"] --> E["geminiGenerate()"] --> F{{"GenerateContent API"}} --> G["Markdown minutes"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Make maxOutputTokens configurable per request/user setting
  • ➕ Controls cost/latency by using higher limits only when needed
  • ➕ Easier to tune for different meeting lengths
  • ➖ Adds UI/config plumbing and validation
  • ➖ More states to test and support
2. Chunked summarization pipeline (segment + merge)
  • ➕ Avoids very large single responses and model hard limits
  • ➕ More robust for very long recordings
  • ➖ More implementation complexity (chunking, stitching, dedupe)
  • ➖ May lose global context across segments without careful design

Recommendation: The current approach is appropriate if the primary goal is richer, single-pass minutes generation. Consider making maxOutputTokens configurable if cost/latency becomes an issue, or move to chunked summarization for very long recordings that may exceed practical single-response limits.

Files changed (1) +15 / -7

Enhancement (1) +15 / -7
gemini.jsExpand meeting-minutes prompt and raise Gemini output token limit +15/-7

Expand meeting-minutes prompt and raise Gemini output token limit

• Reworks the embedded Ukrainian Markdown template to enforce a more detailed structure (topic subheadings, richer summary/decisions context, clearer open-questions wording). Increases generationConfig.maxOutputTokens from 16,384 to 65,536 to support longer outputs.

gemini.js

Comment thread gemini.js
mediaResolution: 'MEDIA_RESOLUTION_LOW',
temperature: 0.3,
maxOutputTokens: 16384
maxOutputTokens: 65536

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Обрізана відповідь приймається як повна

Коли довга зустріч і новий детальний промпт вичерпують maxOutputTokens, Gemini може повернути частковий текст із завершенням через ліміт. Поточний шлях перевіряє лише непорожній текст, тому користувач отримає успішний конспект, який може обірватися до рішень, доручень або відкритих питань.

Fix in Cursor

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_PROMPT to require a longer, topic-structured Markdown summary with explicit guidance on capturing concrete details.
  • Increases generationConfig.maxOutputTokens to allow longer responses.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gemini.js
mediaResolution: 'MEDIA_RESOLUTION_LOW',
temperature: 0.3,
maxOutputTokens: 16384
maxOutputTokens: 65536
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Неврахований розмір відповіді 🐞 Bug ☼ Reliability
Description
Збільшення maxOutputTokens до 65536 (разом із промптом на «дуже довгий» конспект) може генерувати
надвеликий текст, який далі без обмежень передається в multipart-аплоад Google Doc та у локальний
фолбек через data: URL. Це може призводити до помилок збереження/завантаження або пікових витрат
памʼяті при формуванні multipart body/URL.
Code

gemini.js[R100-104]

          generationConfig: {
            mediaResolution: 'MEDIA_RESOLUTION_LOW',
            temperature: 0.3,
-            maxOutputTokens: 16384
+            maxOutputTokens: 65536
          }
Evidence
Код явно підвищує ліміт токенів виходу та одночасно вимагає максимально деталізований конспект,
після чого передає отриманий текст у multipart body для створення Google Doc або інлайнить текст у
data: URL для локального завантаження — обидва шляхи масштабуються лінійно з розміром тексту та не
мають жодних перевірок/лімітів.

gemini.js[7-41]
gemini.js[86-116]
gdrive.js[74-97]
background.js[165-177]
gdrive.js[48-50]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### 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


Grey Divider

Qodo Logo

Comment thread gemini.js
Comment on lines 100 to 104
generationConfig: {
mediaResolution: 'MEDIA_RESOLUTION_LOW',
temperature: 0.3,
maxOutputTokens: 16384
maxOutputTokens: 65536
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread gemini.js
mediaResolution: 'MEDIA_RESOLUTION_LOW',
temperature: 0.3,
maxOutputTokens: 16384
maxOutputTokens: 65536

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

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