Skip to content

Ask reads a saved case's R2 and Conclusor paragraphs in full - #256

Merged
Programcode merged 1 commit into
mainfrom
fix/ask-full-case-summary
Oct 28, 2026
Merged

Programcode merged 1 commit into
mainfrom
fix/ask-full-case-summary

Conversation

@Programcode

Copy link
Copy Markdown
Owner

Ask (and Generate's debate context) read a saved case through a short summary that cut every R2 "backing up" paragraph and Conclusor "why we win" reason to 240 characters, and every "If they say" answer to 200, keeping only 3 answers. Since #244, those paragraphs run ~1,000-1,200 characters each, so Ask saw only their first sentence.

Change (supabase/functions/_shared/debate-context.ts)

  • Backing-up paragraphs, "why we win" reasons and "If they say" answers now reach the prompt in full. Each is held to a safety bound of 2,000 characters, and up to 8 answers are kept (R2 writes at most 8).
  • A saved case may contribute up to 12,000 characters (MAX_CASE_DIGEST_CHARS). Other result types keep their 2,500. A real 6-answer R2 (r2-case.json from Generate writes cases the way school debaters prepare them #244) comes to 9,954 characters with nothing shortened.
  • The total for all saved results in one request goes from 8,000 to 16,000 characters, so a full R2 still fits next to other results instead of being dropped whole. That's at most about 2k more input tokens per request, and only when the debate has that much saved.
  • Argument summaries, sources, chats and the other digests are unchanged. The browser preview imports the same module, so it counts the same characters.

Only ai and ai-stream import this file (checked with deno info). Both get redeployed after merge.

Checks

  • New Deno test: a 6-answer R2 keeps the end of every backing-up paragraph, answer and reason, and nothing is shortened. A huge case stays within 12,000 characters, 2,000 per paragraph and 8 answers. Other result types still cap at 2,500.
  • npm run verify passed locally: 96 + 5 unit test files, Edge 493/493, docs, lint, typecheck, build, the offline service-worker test and smoke 47/47.

The case summary cut backing-up paragraphs and why-we-win reasons to 240
characters and kept only 3 If-they-say answers at 200. They now pass in
full (2,000-character safety bound each, up to 8 answers). A case may
contribute 12,000 characters, and all saved results 16,000.
Copilot AI balanced review requested due to automatic review settings October 28, 2026 12:09

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 3409a12 and adf2fc6.

Files selected for processing: 2
  • supabase/functions/_shared/debate-context.test.ts
  • supabase/functions/_shared/debate-context.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

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

@Programcode
Programcode merged commit cb37e2d into main Oct 28, 2026
3 of 13 checks passed
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