Repository navigation
fix(ai): load source context server-side - #66
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedNext included review available in 25 minutes. View limit detailsLimit details: You’ve used the included review currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (9)
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe client now sends active source IDs and bounded Ask context in AI requests. The Edge Function validates source selections, loads active sources for the authenticated user, and applies Crossfire source validation after loading. ChangesAI Request Flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant AIClient
participant AIEdgeFunction
participant SupabaseSources
AIClient->>AIEdgeFunction: Send selected sourceIds
AIEdgeFunction->>SupabaseSources: Load active sources for authenticated user
SupabaseSources-->>AIEdgeFunction: Return matching source rows
AIEdgeFunction->>AIEdgeFunction: Order, bound, and validate loaded sources
Note 🎁 Summarized by CodeRabbit FreeYour 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 review |
|
Comments Outside DiffThese findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
Production follow-through complete for merge
|
* fix(settings): persist preferences to the account again Since the 2026-08-19 hardening revoked INSERT on user_settings, the client's upsert was always denied, so language, output language, theme, model choices, and the custom system prompt never left the browser. The hardening grant also omitted output_language. Update the provisioned row instead and grant the missing column. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(mobile): stop toasts, Library, and Flowchart widening the page Sonner's mobile toaster overflowed by its left offset, the Library grid let a source row's min-content width stretch the card, and the Flowchart toolbar did not wrap. Each widened the phone layout viewport and pushed controls off-screen. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(e2e): drive every feature through the real local stack Add full-stack browser journeys that sign in through the real demo-code flow and exercise Auth, RLS, quota, every Edge Function, streaming, and persistence against local Supabase. Only OpenRouter is replaced, by a strict fake container reached through the new OPENROUTER_API_URL override. The case-generation test fails against the pre-#66 client, which silently dropped oversized requests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(e2e): fail the CI gate instead of skipping full-stack specs Also warm the admin and announcements functions before the browser run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci(db-gate): retry supabase start after registry rate limits Both database-tests attempts on this PR failed while pulling Supabase images from ghcr.io with toomanyrequests, before any test ran. Retry the start up to three times and stop a partially started stack between attempts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Summary
aiEdge FunctionRoot cause
The browser serialized the entire active source library and full Ask history. Real accounts could exceed the Edge Function's 200,000-byte request limit before server-side prompt bounds ran.
Verification
npm run verifyRequest body exceeds 200000 bytesresponseProduction follow-through
This changes the
aiEdge Function and frontend. No database migration is required. After merge, deploy onlyai, verify the production source-ID path, then confirm the exact merge commit on Vercel.Follow-up to #65.
Summary by CodeRabbit
Safe to merge; the remaining concern is non-blocking but should be addressed to prevent Workspace users from losing rejected drafts.
What we checked:
Summary
Merge safety
The reproduced draft-loss concern is non-blocking, but preserving rejected Workspace drafts would avoid losing user work.
Reviews (3) · Last reviewed commit: "fix(ask): reject oversized messages visi..."