Skip to content

fix(browser_execute): use real helper names in tool description#26

Merged
Alezander9 merged 1 commit intomainfrom
fix/browser-execute-tool-description
Apr 30, 2026
Merged

fix(browser_execute): use real helper names in tool description#26
Alezander9 merged 1 commit intomainfrom
fix/browser-execute-tool-description

Conversation

@Alezander9
Copy link
Copy Markdown
Member

Summary

The browser_execute tool description hands the LLM helper names that don't exist.

(`goto`, `click`, `type_text`, `screenshot`, `js`, `cdp`, `new_tab`, `switch_tab`,
`wait_for_load`, `page_info`, `http_get`, etc.)

But harness/src/browser_harness/helpers.py exports goto_url, click_at_xy, capture_screenshot -- not goto / click / screenshot.

Repro on a fresh v0.0.6 install: ask any model to "go to wikipedia". Both attempts fail with NameError: name 'goto' is not defined. The agent followed the tool description literally.

Fix

  • Replace the bogus names with the real ones (goto_url, click_at_xy, capture_screenshot).
  • Add ensure_real_tab to the example list (it's the canonical pre-navigation helper from SKILL.md).
  • Update the example to new_tab("https://example.com") per SKILL.md ("First navigation is new_tab(url), not goto_url(url)").
  • Update the coordinate-click reference from click(x, y) to click_at_xy(x, y).

Verification

  • Cross-checked all helper names in the description against ^def in helpers.py.
  • bun run typecheck: 5/5 passed.
  • This is a Level-2 file we already added (decisions ?1c); no UPSTREAM.md divergence needed.

Modification zone

Yellow (touches packages/opencode/src/tool/) but the file was added by browsercode (commit 46048c709), not upstream -- so no merge-conflict risk and no EXCEPTIONS.md entry.

The tool description listed `goto`, `click`, `screenshot` -- none of those
exist. The actual helpers (per harness/src/browser_harness/helpers.py)
are `goto_url`, `click_at_xy`, `capture_screenshot`. Agents followed the
description literally and got NameError on every call.

Also nudge agents toward `new_tab(url)` for first navigation per
SKILL.md, since bare `goto_url` clobbers the user's active tab.

Repro: fresh install, ask any model to "go to wikipedia". Pre-fix:
NameError: name 'goto' is not defined. Post-fix: agent uses
`new_tab("https://wikipedia.org")` directly.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@Alezander9 Alezander9 merged commit 9efebbf into main Apr 30, 2026
3 checks passed
@Alezander9 Alezander9 deleted the fix/browser-execute-tool-description branch April 30, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant