Spaces:
Sleeping

dakshtaneja Claude Opus 5 commited on
Commit
7f8d928
·
1 Parent(s): b494250

pipeline: give the hedge the web, instead of skipping it

Browse files

Web queries felt broken next to ChatGPT, and the search was not why.
Measured on "bitcoin price today":

70ms bidding starts
22391ms auction resolves <- 22.3s of nothing on screen
22392ms web search starts
25264ms first token <- search + generation: 2.9s

The pipeline set run_hedge=False for any query needing search, so that
a stale ungrounded draft wouldn't flash before the search. Sound, but
it meant the queries with the longest wait showed nothing at all, while
ordinary queries had hedge tokens covering the same gap.

Now the hedge runs web-grounded instead of not running: at t=0 when the
regex knows, or restarted ~500ms in when the gate says so. And a
web-grounded hedge is allowed to win the auction, which also skips the
redundant second draft.

Same query, after: first token 22391ms -> 3864ms, total 29.8s -> 15.9s.
Non-web queries are unchanged.

Known rough edge: when the auction picks a model other than the hint,
the web hedge is discarded and the client sees two resets in quick
succession. Costs one wasted draft on those queries; hint-priority
routing means the hint model usually wins.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

3 files changed +55 -29
Files changed (3)
backend/app/pipeline.py+50-26
frontend/components/Chat.tsx+5-3
frontend/components/Markdown.tsx
Binary file (4.92 kB). View file