Skip to content

fix(cli): align MCP tool calls with compact browser tools - #1311

Closed
kingdomad (kingdomad) wants to merge 2 commits into
browseros-ai:mainfrom
kingdomad:bugfix/cli-tool-names
Closed

kingdomad (kingdomad) wants to merge 2 commits into
browseros-ai:mainfrom
kingdomad:bugfix/cli-tool-names

Conversation

@kingdomad

Copy link
Copy Markdown

PR Description

Summary

Updates the BrowserOS CLI to call the MCP server's current compact browser tool surface instead of legacy tool names that are no longer registered. Commands that no longer have a server-side equivalent now fail explicitly with a clear unsupported message instead of attempting a missing MCP call.

Main changes

  • Remaps CLI browser actions to compact tools such as tabs, navigate, act, snapshot, read, grep, screenshot, pdf, download, tab_groups, windows, wait, evaluate, and upload.
  • Updates page resolution and output formatting to handle the tabs tool's pages[] structured output.
  • Preserves CLI file output behavior for screenshots and PDFs by writing returned data or generated files to the requested local path.
  • Adds a contract test that blocks reintroducing legacy browser tool names in CLI CallTool calls.
  • Adds output coverage for formatting the active page from compact tabs output.
  • Updates CLI README architecture notes to reference current tool names and unsupported command groups.

Risk / Review focus

  • Some legacy CLI commands now report unsupported because the current MCP server has no equivalent tool: bookmarks, history, dialog handling, and info.
  • Element-based commands now convert numeric CLI element IDs to snapshot refs like e12; reviewers should check compatibility with existing CLI usage expectations.
  • drag and focus remain unsupported because the compact MCP surface does not expose equivalent element-based behavior.

Validation

cd packages/browseros-agent/apps/cli
go test ./...

The BrowserOS server no longer registers legacy browser tool names, so update the CLI to target the compact tool surface and argument shapes. Commands without a current MCP equivalent now fail explicitly instead of calling missing tools.
@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@github-actions

github-actions Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

@kingdomad

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

# Conflicts:
#	packages/browseros-agent/apps/cli/README.md
#	packages/browseros-agent/apps/cli/cmd/bookmark.go
#	packages/browseros-agent/apps/cli/cmd/click.go
#	packages/browseros-agent/apps/cli/cmd/dialog.go
#	packages/browseros-agent/apps/cli/cmd/dom.go
#	packages/browseros-agent/apps/cli/cmd/eval.go
#	packages/browseros-agent/apps/cli/cmd/file_actions.go
#	packages/browseros-agent/apps/cli/cmd/fill.go
#	packages/browseros-agent/apps/cli/cmd/history.go
#	packages/browseros-agent/apps/cli/cmd/info.go
#	packages/browseros-agent/apps/cli/cmd/interact.go
#	packages/browseros-agent/apps/cli/cmd/nav.go
#	packages/browseros-agent/apps/cli/cmd/open.go
#	packages/browseros-agent/apps/cli/cmd/pages.go
#	packages/browseros-agent/apps/cli/cmd/screenshot.go
#	packages/browseros-agent/apps/cli/cmd/scroll.go
#	packages/browseros-agent/apps/cli/cmd/snap.go
#	packages/browseros-agent/apps/cli/cmd/text.go
#	packages/browseros-agent/apps/cli/cmd/wait.go
#	packages/browseros-agent/apps/cli/cmd/window.go
#	packages/browseros-agent/apps/cli/mcp/client.go
#	packages/browseros-agent/apps/cli/output/printer.go
Vasilev Dmitrii (gHashTag) pushed a commit to gHashTag/BrowserOS that referenced this pull request Sep 4, 2026
The swarm sat at zero bees of four while the tick refused with "nothing to
choose" against 22 candidates and reported `claimed: 11`.

stateOfDispatch had no case for 'failed'. It fell through to the bottom and
returned 'awaitingReview', which QueenDelegationPolicy.claimOnIssue counts as a
LIVE claim. So a dispatch set to 'failed' - the state the policy's own comment
calls the one that most obviously means 'do this again' - held its issue instead
of releasing it.

The function could already PRODUCE that state two lines below, for a send-back
that outlived its idle floor, and did not recognise what it produced.

Measured 2026-09-04: five dispatches were set to 'failed' to return their issues
to the pool (browseros-ai#1133, browseros-ai#1175, browseros-ai#1216, browseros-ai#1240, browseros-ai#1311). All five stayed in 'claimed'
across four consecutive rounds. Every worker slot idle, fourteen real deficits
the author could not file against because each already had an issue - one of the
held ones. Work existed and was locked by the row recording its release.

'cancelled' is included for the same reason: it is a dead state and the registry
treats it as free.

Six new assertions in send-back-lease.test.ts, including the three that must NOT
be swept up by it (accept, sendBack, and an unfinished dispatch), and one
proving the case ignores the lease entirely - a failure is a failure at zero
idle and above the ceiling, because nothing about it waits for a clock.

173 pass, 0 fail across the queen suite.
Vasilev Dmitrii (gHashTag) added a commit to gHashTag/BrowserOS that referenced this pull request Sep 4, 2026
…e cause was fixed (#111)

* feat(loop): publish the instruments the cron has been running all night

These have existed only on one laptop. `git status` on the supervisor branch
showed every one of them as untracked, which is the same defect this loop keeps
finding in the swarm it supervises: work that exists and cannot be seen. 63 bee
branches and 1321 files once sat in a container with 2 pushed.

Twenty-one files, no dependencies, no network in the calibration run:

  heal.mjs             eleven steps in a fixed order; four act, seven read
  loop.mjs             state, the age-based lock, the append-only ledger, the dashboard
  reap lease           free the volume, then the path fences
  push-work close-done make finished work visible, then clear it from the pool
  stale-escalations    retire an escalation whose stated cause no longer reproduces
  clocks fields        two defect classes that each cost an outage, checked every round
  fp-check coverage    the checkers, run against material the WORLD calls good
  verdict-audit        what the swarm claims, against what it actually pushed
  judge-packet         assemble the unauditable for a judge; assembles, never judges
  brief-gate author    refuse an unworkable brief; file from a measured deficit
  snapshot trend       the readings, and whether a series has enough points to slope
  selftest             43 cases, every one proving the negative first

Three rules are written into them and into the README:

  A checker never shown FAILING has not been tested. Six false accusations
  shipped in one night while synthetic fixtures agreed with the checkers that
  wrote them.

  Unreadable is not clean. A step that cannot reach its evidence reports ??,
  never ok - which is the only reason the first stale-escalation run did not
  retire six escalations on a probe that had failed to compile.

  A clock may only release what a clock can settle.

Runtime is gitignored: state.json, ledger.jsonl, the lock, packets/, state/ and
the rendered dashboards are produced by a run and mean nothing off the machine
that produced them. No credential appears in any file; every database reference
is process.env.DATABASE_URL, read inside the container.

* fix(queen): a verdict that says failed was read as awaiting review

The swarm sat at zero bees of four while the tick refused with "nothing to
choose" against 22 candidates and reported `claimed: 11`.

stateOfDispatch had no case for 'failed'. It fell through to the bottom and
returned 'awaitingReview', which QueenDelegationPolicy.claimOnIssue counts as a
LIVE claim. So a dispatch set to 'failed' - the state the policy's own comment
calls the one that most obviously means 'do this again' - held its issue instead
of releasing it.

The function could already PRODUCE that state two lines below, for a send-back
that outlived its idle floor, and did not recognise what it produced.

Measured 2026-09-04: five dispatches were set to 'failed' to return their issues
to the pool (browseros-ai#1133, browseros-ai#1175, browseros-ai#1216, browseros-ai#1240, browseros-ai#1311). All five stayed in 'claimed'
across four consecutive rounds. Every worker slot idle, fourteen real deficits
the author could not file against because each already had an issue - one of the
held ones. Work existed and was locked by the row recording its release.

'cancelled' is included for the same reason: it is a dead state and the registry
treats it as free.

Six new assertions in send-back-lease.test.ts, including the three that must NOT
be swept up by it (accept, sendBack, and an unfinished dispatch), and one
proving the case ignores the lease entirely - a failure is a failure at zero
idle and above the ceiling, because nothing about it waits for a clock.

173 pass, 0 fail across the queen suite.

---------

Co-authored-by: Dmitrii Vasilev <trackgmedernj@hotmail.com>
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