Skip to content

feat: open a session browser the agent can drive - #585

Closed
DiegoSGbr wants to merge 9 commits into
lichdotdev:mainfrom
DiegoSGbr:origin/feature/browser-tab
Closed

DiegoSGbr wants to merge 9 commits into
lichdotdev:mainfrom
DiegoSGbr:origin/feature/browser-tab

Conversation

@DiegoSGbr

Copy link
Copy Markdown
Contributor

A session can open a real Chromium of its own — not a tab inside lich — that the agent drives while you watch.

Right-click a session card → Browser tab. That window is the same page lich browser and the browser_* MCP tools inspect, click, type, press named keys and screenshot. It is a second process on the machine (chromium.FindBrowser: system Chrome/Edge/…, never lich-shell), with its own user-data-dir. Closing it does not quit lich; closing the card kills the sidecar.

Why a sidecar

lich's UI is already Chromium in --app mode. Embedding another page (iframe / webview / CDP on the UI process) would expose the RPC token and the app chrome. docs/browser-tab.md is the decision record.

What the agent gets

  • browser_open / navigate / reload / back / forward / scroll / list / close
  • browser_info — URL, title, visible text, interactive nodes (index + box). Form values never leave the page; agents see filled / checked
  • browser_click / browser_type / browser_press — real mouse and key events, not element.click(). Press is named keys only (Enter, Tab, Escape, arrows, …); text still goes through type
  • browser_screenshot — writes a PNG path; bytes stay off the transcript
  • URL allowlist: http, https, about:blank only

Human entry: context menu after Pin. Agent-first browser_open is headless until someone opens Browser tab, then the headed window is reused.

Providers

Claude Code and Codex see the tools at spawn. Crush and oh-my-pi once the plugin registers the server. opencode does not get MCP registration for them — lich browser still works in that PTY. Documented in docs/ceilings.md.

Out of v1

  • evaluate (arbitrary JS in the page)
  • wait_for_*, persistent profiles, iframe / multi-tab follow-through

Test plan

  • gofmt clean on touched Go; go vet ./...; go build
  • go test on internal/browser, internal/cli, internal/chromium, internal/rpc, internal/terminal
  • MCP tools/list includes browser_press with required key
  • task dev → right-click a session card → Browser tab opens a headed Chrome/Edge at about:blank
  • From the session: lich browser open https://example.com, info, click/type/press Enter, screenshot
  • Closing the card closes the sidecar; closing the sidecar leaves lich running

DiegoSGbr and others added 9 commits August 16, 2026 21:44
lichdotdev#570 dropped system-browser discovery for the UI window; bring FindBrowser
back for the agent sidecar only, and repair the merge damage so Browser tab
is usable again from the session card.

Co-authored-by: Cursor <cursoragent@cursor.com>
Type inserts text; Enter, Tab and Escape are UI keys and need a real
key event. browser press / browser_press cover the named set so an
agent can submit forms and dismiss dialogs the way a user would.

Co-authored-by: Cursor <cursoragent@cursor.com>
@DiegoSGbr

Copy link
Copy Markdown
Contributor Author

Closing this one. It targeted the old web window, which is gone, and the session browser now lives in #941.

@DiegoSGbr DiegoSGbr closed this Oct 25, 2026
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