feat(browser): prefer suggested tab targets

This commit is contained in:
Peter Steinberger
2026-04-25 00:35:08 +01:00
parent acb10cd21c
commit 82020bd787
12 changed files with 90 additions and 14 deletions

View File

@@ -120,10 +120,11 @@ openclaw browser focus docs
openclaw browser close t1
```
`tabs` returns the raw `targetId` plus a stable `tabId` such as `t1`. You can
also assign a label with `open --label`, `tab new --label`, or `tab label`.
`focus`, `close`, snapshots, and actions accept the raw `targetId`, `tabId`,
label, or a unique target-id prefix.
`tabs` returns `suggestedTargetId` first, then the stable `tabId` such as `t1`,
the optional label, and the raw `targetId`. Agents should pass
`suggestedTargetId` back into `focus`, `close`, snapshots, and actions. You can
assign a label with `open --label`, `tab new --label`, or `tab label`; labels,
tab ids, raw target ids, and unique target-id prefixes are all accepted.
## Snapshot / screenshot / actions

View File

@@ -513,8 +513,10 @@ Compared to the managed `openclaw` profile, existing-session drivers are more co
- **Dedicated user data dir**: never touches your personal browser profile.
- **Dedicated ports**: avoids `9222` to prevent collisions with dev workflows.
- **Deterministic tab control**: target tabs by raw `targetId`, stable `tabId`
handles such as `t1`, or labels you assign with `open --label` / `tab label`.
- **Deterministic tab control**: `tabs` returns `suggestedTargetId` first, then
stable `tabId` handles such as `t1`, optional labels, and the raw `targetId`.
Agents should reuse `suggestedTargetId`; raw ids remain available for
debugging and compatibility.
## Browser selection