← Back to PRs

#16091: feat(browser): lower default snapshot size to 10K with progressive hints

by kmixter open 2026-02-14 08:18 View on GitHub →
agents stale size: S
## Summary - Lower `DEFAULT_AI_SNAPSHOT_MAX_CHARS` from 80K to 10K to reduce context consumption - When truncation occurs, append a context-aware hint suggesting `mode="efficient"` (compact ARIA role-tree) or increasing `maxChars` - Set `truncated` flag in route post-hoc truncation for role snapshots - Add descriptions to snapshot schema fields so the model understands its options ## Motivation Large AI snapshots (up to 80K chars) consume excessive context window. Lowering the default to 10K and progressively teaching the model about `mode="efficient"` and `maxChars` gives the best of both worlds: rich AI snapshots by default, with clear guidance when pages are too large. ## Test plan - [ ] Snapshot a small page — should return full AI snapshot (no truncation hint) - [ ] Snapshot a large page (e.g. Wikipedia "United States") — should truncate at ~10K with hint about `mode="efficient"` and `maxChars` - [ ] Snapshot with `mode="efficient"` on a large page — hint should only suggest `maxChars`, not re-suggest efficient mode - [ ] Snapshot with explicit `maxChars=50000` — should return larger snapshot - [ ] `pnpm build` passes 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Most Similar PRs