You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(browser_execute): require description field; surface as TUI title
browser_execute now takes a required 'description' parameter that mirrors the bash tool's same-named field. The TUI's BlockTool title shows it instead of the static 'Browser execute' label, giving the user a per-call summary of what the snippet does. Strong models were already writing this as a comment at the top of 'code'; an explicit slot is cheaper and renders better. Also adds a one-line note to cloud-browser.md telling the agent to surface 'liveUrl' as a markdown link if the user asks for it (markdown links in assistant replies are clickable in the TUI; tool stdout is not).
Copy file name to clipboardExpand all lines: packages/bcode-browser/skills/cloud-browser.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,12 +41,14 @@ The response carries more than the three fields above. Other fields you may want
41
41
-`recordingUrl` — playback URL for the session recording. Surface this to the user when handing back the run.
42
42
-`status`, `startedAt`, `finishedAt`, `proxyUsedMb`, `proxyCost`, `browserCost`, `agentSessionId` — observability fields, not needed to drive the browser.
43
43
44
-
The `liveUrl` is a viewer URL the user can open in their own browser to watch the cloud browser's pixels. **Print it to console** so the user can click it:
44
+
The `liveUrl` is a viewer URL the user can open in their own browser to watch the cloud browser's pixels. **Print it to console** so the user can see it:
45
45
46
46
```js
47
47
console.log("Cloud browser ready. Live view:", liveUrl)
48
48
```
49
49
50
+
If the user later asks for the link in a clickable form (e.g. "give me the live url"), surface it in your reply as a markdown link — `[Live view](<liveUrl>)` — which the TUI renders clickable. Tool stdout is not auto-linkified, but markdown in your assistant message is.
51
+
50
52
Stash `id` somewhere (a `globalThis.cloudBrowserId = id` is fine, or the snippet's return value) — you need it to stop the browser later.
"Clear, concise summary of what this snippet does in 3-7 words. Examples:\nInput: code that connects to local Chrome\nOutput: Connect to local Chrome\n\nInput: scrape product titles from current page\nOutput: Scrape product titles\n\nInput: capture a screenshot of the homepage\nOutput: Screenshot homepage",
56
+
}),
53
57
code: Schema.String.annotate({
54
58
description:
55
59
"JavaScript source. Wrapped in an async function with `session` (CDP Session) and `console` (per-call capture; same `log/error/warn/info` API) bound.",
Copy file name to clipboardExpand all lines: packages/opencode/src/tool/browser-execute.txt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ Use this tool whenever the task requires driving a real browser — automation,
4
4
5
5
Before the first `browser_execute` call of a session, you MUST read `{{SKILLS_DIR}}/BROWSER.md`. It defines the snippet model, the three connection methods (local user Chrome, isolated debug-port Chrome, Browser Use cloud browser), the workspace pattern, the `session` API surface, and gotchas. For cloud-browser specifics, also read `{{SKILLS_DIR}}/cloud-browser.md`.
6
6
7
+
Always pass a clear, concise `description` of what the snippet does in 3-7 words (e.g. "Connect to local Chrome", "Scrape product titles", "Screenshot homepage"). It surfaces in the TUI as the call's title.
8
+
7
9
Snippet scope:
8
10
9
11
- `session` — the live CDP `Session`. You call `session.connect(...)` once at the start of your work; subsequent snippets reuse the same connection. Domain methods follow `session.<Domain>.<method>(params)` and return Promises.
0 commit comments