Skip to content

search: per-request budgets in code; quality mode redefined - #15

Merged
all-caps-dev merged 1 commit into
masterfrom
quality-mode
Nov 1, 2026
Merged

all-caps-dev merged 1 commit into
masterfrom
quality-mode

Conversation

@all-caps-dev

Copy link
Copy Markdown
Owner

Kaneo Fleet ItzCrazyKns#345 item 1. Measured 2026-11-01 on the 2-core 4 GB box: unbounded quality mode took 238 to 666 s per question, read 80 to 144 pages, ran up to 25 iterations and was OOM-killed on one question.

  • src/lib/agents/search/budgets.ts: RequestBudget on the session (maxFetches, maxBrowserFetches, maxSearchCalls, maxResearchMs), per mode: speed 0/0/1/30 s, balanced 12/3/4/90 s, quality 24/6/8/180 s. Env overrides VANE_BUDGET__, read once. executeSearch and Scraper.scrape decrement; the research loop stops on time or search calls and proceeds to the gap round and writer; one budget.exhausted trace event per budget.
  • Quality: iterations 25 -> 6, pages per search 10 -> 8, evidence budget x1.5 kept, up to two gap rounds (second only if the first found gaps and new sources arrived). Quality prompts lose "exhaust your budget", "leave no stone unturned", "up to 10 tools"; new rule: three independent sources, look for one conflicting source, stop.
  • Scraper: PDFs, downloads and media never go to the browser fallback; browser skipped once its budget is spent (thin HTTP text kept).
  • scrape_url (a page the user named, max 3) is not budgeted.

tsc clean, vitest 198 passed (23 new), prettier clean. docs/EVAL.md "Budgets", WORKING.md updated.
Follow-up: GAP_CHECK_BUDGET_MS is still 60 s, so slow quality runs skip both gap rounds; raise for quality if the eval shows it matters.

Quality mode on the 2-core 4 GB box took 238 to 666 s per question with
80 to 144 page fetches and was OOM-killed. Budgets are now enforced in
code for every mode (src/lib/agents/search/budgets.ts, overridable via
VANE_BUDGET_<MODE>_<NAME>): fetches, browser fetches, search calls and
research time, carried on the session as a RequestBudget.

- Quality: 6 iterations (was 25), 8 pages per search (was 10), up to two
  gap rounds, prompt asks for three independent sources plus one
  conflicting source, then stop.
- Scraper: never sends a PDF or other download to the browser; skips the
  browser once maxBrowserFetches is spent.
- Trace: budget.exhausted event, research span stoppedBy and budgetUsed.
- Docs: EVAL.md Budgets section, WORKING.md quality paragraph.
@all-caps-dev
all-caps-dev merged commit 6f2394a into master Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants