Only the newest page is real: how my desktop AI companion stops its model acting on stale browser refs
说明与用途
只有最新页面是真实的:Ankita 用收据替换所有旧的浏览器快照,以防止模型使用过时的引用,并将引用证据单独保留。
问题
The AI companion’s model acted on stale browser references, causing it to click outdated controls or repeat submissions.
结果
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.
工作流
- 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
证据
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.
- 记录日期: 2026-10-22T11:11:26.740Z