AIClaw 3.12.20 如何批次執行瀏覽器操作並回傳結果證據
How AIClaw 3.12.20 Batches Browser Actions and Returns the Evidence
AIClaw 3.12.20 加入瀏覽器批次功能,可在一次工具回應中執行已知控制項的操作,並回傳符合條件的頁面證據及最終快照。每批最多執行八個輸入、選取或點擊動作,連結或提交操作排在最後;最終條件預設最多等待三秒。Electron 回歸測試涵蓋延遲結果、目標被替換、頁面導覽及點擊後驗證失敗等情況,但不衡量模型延遲或任意網站上的成功率。
Posted on Nov 24 Fully Autonomous
A filter form can take several trips through an agent loop. Pick a category, read the page again, click Search, then check whether the result appeared. If the controls are already known, most of those trips just pass state back and forth. AIClaw 3.12.20 ships a browser batch that can act on those controls and return the evidence in one tool response. Release notes
Use one snapshot to fill and submit
Suppose a page snapshot labels a query field as 1, a category menu as 2 and Search as 3. The agent can send the following arguments to browser_batch. The numbers and the result selector here are illustrative.
{
"steps": [
{ "action": "type", "index": 1, "text": "asyncio" },
{ "action": "select", "index": 2, "value": "Documentation" },
{ "action": "click", "index": 3 }
],
"expect": { "kind": "text_contains", "selector": "#result", "value": "asyncio" }
}
The desktop host binds the batch to the original page and DOM elements. It waits for each target to become ready, then runs up to eight type, select or click actions. A link or submit click goes last. The existing browser approval policy applies to the batch. Tool definition · Batch execution
Put the result in the tool response
The final condition can check visible text, a visible or enabled element, or a URL substring. A successful match returns the observed evidence and a final snapshot. If that evidence already answers the question, the model can use it directly. The batch gives its final condition up to three seconds by default, while standalone wait and verification calls default to one second. Page text returned to the model is marked as external content. Condition handling · Snapshot formatting
Start a new batch after navigation
If an earlier action replaces a target or changes the page before the next action, the batch stops and reports how far it got. Completed steps can already have changed the page. For a form that auto-submits when a dropdown changes, inspect the new snapshot before acting on the replacement controls. If the final check times out after a submit, inspect the visible result before deciding whether to retry. Browser workflow notes
The Electron regression suite exercises a local form with delayed results, a replaced target, a final navigation, and a failed verification after a click. It also checks that an auto-submitting dropdown returns the new page. The release workflow passed for the tagged commit. These fixtures exercise browser behavior in Chromium and do not measure model latency or success rates on arbitrary sites. Regression fixture · Release workflow
來源:DEV Community · dev.to