Skip to content

fix(cli): stop sending the retired hidden input to tabs/windows - #2418

Open
Athul Nambiar (athul-22) wants to merge 1 commit into
browseros-ai:mainfrom
athul-22:fix/cli-drop-retired-hidden-input
Open

fix(cli): stop sending the retired hidden input to tabs/windows#2418
Athul Nambiar (athul-22) wants to merge 1 commit into
browseros-ai:mainfrom
athul-22:fix/cli-drop-retired-hidden-input

Conversation

@athul-22

Copy link
Copy Markdown
Contributor

Summary

browseros-cli open is broken on every code path because the CLI still sends the hidden input that the server retired.

Both tool schemas are #[serde(deny_unknown_fields)] and pages.newPage rejects the option explicitly, so the call fails before a tab is ever opened:

CLI path sends server response
opentabs action=new "hidden": false Invalid arguments for tabs: hidden: unknown field `hidden`
open --window Nbrowser.pages.newPage(url, { hidden, … }) hidden: false pages.newPage: hidden is no longer supported
window createwindows action=create "hidden": false Invalid arguments for windows: hidden: unknown field `hidden`

The retirement is intentional and pinned by the server's own tests — retired_hidden_inputs_are_rejected and tab_and_window_schemas_omit_hidden_controls in crates/browseros-mcp/src/tests.rs. Only the Go CLI was left behind.

Fix

Drop the hidden argument and the --hidden flag from open and window create, per the rule in apps/cli/CLAUDE.md:

MCP tool names are the contract. A command only shapes args; the server owns the tool. Keep command tool names and arg keys in sync with the compact MCP surface.

This also fixes #2162

open --json was reported as returning {"url":"…"} with no page. That was a symptom, not a second bug — tabs action=new already returns { "page": <id> } (tools/tabs.rs), and openResult already maps it (cmd/open.go). The field was missing only because the call never succeeded. With hidden gone, open --json emits the documented shape again:

{"page":123,"url":"https://example.com"}

which is what cmd/llm_txt.md tells agents to rely on:

page=$(browseros-cli open --json https://example.com | jq -r .page)
browseros-cli -p "$page" snapshot

Changes

  • cmd/open.go — remove hidden from openTabsToolArgs and openInWindowCode; drop the --hidden flag
  • cmd/window.go — remove hidden from window create; drop the --hidden flag
  • cmd/tool_mapping_test.go — update the two mapping tests, plus a guard asserting openInWindowCode never re-introduces hidden
  • cmd/llm_txt.md, README.md, CHANGELOG.md — drop the stale --hidden references

Verification

Per apps/cli/CLAUDE.md, run from apps/cli/:

gofmt -l .     # clean
go vet ./...   # clean
go build ./... # ok
go test ./...  # all packages pass

--hidden is gone from both help outputs:

$ browseros-cli open --help
Flags:
      --bg           Open in background
  -h, --help         help for open
      --window int   Window ID to open in

Noted, not addressed

browseros-cli window activate <id> (cmd/window.go) sends action: "activate", but WindowsAction intentionally omits Activate ("so MCP callers cannot steal window focus"), so that subcommand is dead too. Removing a user-facing command felt like a maintainer call rather than part of this fix — happy to fold it in or open a separate issue, whichever you prefer.

Fixes #2161
Fixes #2162

The server retired the `hidden` input, but the CLI still sent it. Both
tool schemas use `deny_unknown_fields` and `pages.newPage` rejects the
option outright, so every `open` code path failed:

- `open` -> `tabs` action=new sent `hidden` -> "Invalid arguments for
  tabs: hidden: unknown field `hidden`"
- `open --window N` -> `browser.pages.newPage(url, { hidden, ... })` ->
  "pages.newPage: hidden is no longer supported"
- `window create` -> `windows` action=create sent `hidden` -> "Invalid
  arguments for windows: hidden: unknown field `hidden`"

Drop the `hidden` arg and the `--hidden` flag from `open` and
`window create`, matching the compact MCP surface the CLI is meant to
track. `tabs` action=new already returns `{ "page": <id> }`, so
`open --json` emits the documented `page` field again once the call
succeeds.

Fixes browseros-ai#2161
Fixes browseros-ai#2162
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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

@athul-22

Copy link
Copy Markdown
Contributor Author

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

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.

open --json does not return .page despite llm-txt contract browseros-cli open fails because tabs rejects the hidden argument

1 participant