Only the newest page is real: how my desktop AI companion stops its model acting on stale browser refs
Description and use
Only the newest page is real: Ankita replaces all older browser snapshots with receipts to prevent stale reference actions, while keeping quoted evidence separately.
Problem
The AI companion’s model acted on stale browser references, causing it to click outdated controls or repeat submissions.
Outcome
Stale browser refs are eliminated by projecting only the newest snapshot to the model while preserving evidence in a separate, capped track, reducing incorrect actions and duplicate submissions.
Workflow
- Collect all browser tool calls in the request
- Identify tool replies containing page observations (ref lines or Current snapshot separator)
- Replace all but the last observation with a 512‑byte receipt, a notice that earlier observations are omitted, and any verification lines
- Exclude failed tool results from summarisation
- Capture quoted evidence separately, ensuring it is grounded and capped at 16 KB total, 16 items, 2 KB per chunk
- Attach retained quotes to the newest tool message under a header indicating they are untrusted page data
- Fingerprint pages to detect changes and avoid repeating submissions
- Enable the compaction opt‑in via BROWSER_HISTORY_COMPACTION flag
- Run unit tests to verify projection logic
Evidence
The model, quite reasonably, treats them all as live. It clicks a ref from three pages ago.
The fix I landed on is blunt: before every model call, only the newest browser observation is real.
Sixteen kilobytes total, sixteen items, two kilobytes per chunk.
- Record date: 2026-10-22T11:11:26.740Z