Repository navigation
High LLM turn count due to frequent snapshot calls when using agent-browser skills
#2373
Replies: 1 comment
|
I measured this on 0.39.4 with a same-model A/B: Claude Sonnet 5.5 (high), the same prompt and 8 read-only tasks on SPA dashboards, a CRM, docs, GitHub and Notion, 4 runs each, all against one CDP-attached Chrome with
The gain came from fewer turns, not smaller snapshots. On SPAs the agent in A often read the page before it rendered and spent turns looking again; on static pages (docs, GitHub) A and B were the same. In my own agent sessions over two weeks, 31% of turns only observed and 1,044 fixed Would an opt-in "act, settle, then snapshot" mode fit the project, e.g. |
Uh oh!
There was an error while loading. Please reload this page.
Issue: High LLM turn count due to frequent
snapshotcalls when usingagent-browserskills (Windows 11, LangChain E2E agent)Summary
I migrated a local E2E test agent from LangChain + MCP Playwright tools + LLM to
agent-browserskills to reduce prompt/token size.While token usage improved, I observed a significant increase in LLM tool-interaction turns, and logs show a large portion of those turns are
snapshotcalls.I’d like to ask whether there is room for improvement on the
agent-browserside (or recommended best practices) to reduce the number of explicitsnapshotrequests required by the LLM—e.g., returning an updated element reference tree automatically after UI actions.Background
I originally used MCP Playwright as the browser automation toolset. To reduce token consumption, I switched browser automation to
agent-browser skills.Environment
agent-browser:^0.26.0(npm dependency)agent-browser(skill-driven CLI usage)What I changed
agent-browser ...commands according toagent-browser skills get core.Metrics (same cases + same environment)
I ran ~150 test cases under the same environment and compared the total number of LLM invocations/tool-interaction turns.
Observation
From execution logs, roughly ~30% of the tool calls are
snapshotduring theagent-browserrun.I understand why
snapshotis required:@eNrefs) can become stale after navigation or DOM updates.However, in practice this causes a large increase in the number of LLM turns, which has a direct impact on:
Question / Request
Is there an approach (or a planned feature) to reduce the number of explicit
snapshotcalls required by the LLM?For example:
Auto-snapshot after action commands
open,click,fill,select,press, etc., return an updated snapshot / ref tree automatically.Optional mode/flag to return refs
Best-practice guidance
All reactions