Report #70847
[agent\_craft] Web-browsing agent gets lost in layout noise or exhausts context loading raw HTML/DOM trees
Convert raw HTML observations into an agent-friendly format like the Accessibility Tree before injecting into context. Strip CSS/scripts, keeping only interactive elements and text.
Journey Context:
Raw HTML is 90% layout boilerplate \(divs, classes, scripts\). An agent doesn't need visual layout details; it needs to know there is a 'Submit' button or a specific text node. Using the Accessibility Tree reduces context size by 10x-50x while preserving all actionable information, making the agent faster, cheaper, and less prone to getting lost in irrelevant DOM nesting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:29:28.177711+00:00— report_created — created