Repository navigation
Run research helper calls on a fixed cheap model - #163
Conversation
The Ask search decision and the follow-up search queries used to run on whatever model the user picked, so a Pro user on Opus at high effort paid Opus prices for two tiny JSON calls per researched request. They now run on BACKGROUND_MODEL (Claude Haiku 5.5, low effort), one value in _shared/model-catalog.ts. The answer itself still uses the user's model, and the helper usage is still added to the parent request's row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ℹ️ Recent review info
📝 Walkthrough
Note 🎁 Summarized by CodeRabbit Free
Comment |
|
Real-app check with
All passed. Codex review (gpt-6.1-sol, high) of |
Cost fix 2 of 7 from the cost analysis.
What changes
When a request does web research, the server makes two small model calls before the answer: one decides whether an Ask question needs a web search, and one writes follow-up search queries. Until now both ran on the model the user picked. A Pro user on Claude Opus 5.5 at high effort paid Opus prices for two short JSON replies on every researched request.
Both calls now run on Claude Haiku 5.5 at low effort. The model is one value,
BACKGROUND_MODELinsupabase/functions/_shared/model-catalog.ts, with its effort next to it. The answer the user sees still comes from their chosen model. The helpers' token usage is still added to the parent request'sai_requestsrow, as before.Affected features: Generate, Attack, Brainstorm, Factoids (follow-up queries) and Ask with web search or citations (search decision plus follow-up queries). Crossfire, Sparring and streaming Ask make no research calls and are unchanged. Jev routing and ranking calls already use their own fixed model.
Things to know
modelcolumn while its token totals now mix Haiku and the user's model. The dollar cost comes from OpenRouter per call, so the total charge stays correct. Splitting it per model belongs to the cost-logging fix.Verification
npm run verifypassed locally at this head: docs check, lint, typecheck, unit tests, 356 Deno edge tests, build, service worker test, and 30 desktop Chromium smoke tests. GitHub Actions is broken repo-wide, so this is a local pass only, not a CI pass.BACKGROUND_MODELand the answer uses the requested model. It fails against the old code and passes with this change.verify-debatelab(fake provider): on an Opus account, every helper call in Generate, Attack, Brainstorm, Factoids and Ask (web search and citation mode, desktop and mobile) asked for Haiku 5.5, and every answer asked for Opus 5.5. Details in the PR comment.bd692f7: no findings.Deploying needs the
aiEdge Function redeployed; this merge alone doesn't change production behaviour.🤖 Generated with Claude Code