Repository navigation
feat(assistant): let the assistant use a browser connected through the Lens side panel - #311
Merged
Merged
Conversation
…e Lens side panel
Server side: a side panel connects a session and listens for actions; while it's
connected, a question sent from it gets the browser_ tools (tabs, open, read,
click, type, press, import), each carried out by the side panel and waited for
in the database. Agents can do the same through POST /browser/sessions/{id}/run.
ai.browser turns it off; ai.browser_steps caps the steps of such an answer.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PhTrpdr3XSgcD91oFxAiMQ
This was referenced Oct 10, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: the assistant could only look things up in Lens and import what it was given. It couldn't do anything in the person's browser.
After: a browser's Lens side panel can connect a session to Lens. While it's connected, a question asked from that side panel gets seven
browser_tools (tabs,open,read,click,type,press,import). Each action goes to the side panel, which carries it out in the browser and sends back what happened. The tool waits for that answer in the database, so it works whichever server process holds the side panel's stream. Agents can do the same throughPOST /browser/sessions/{id}/run.This is the server half. The side panel (chat, OAuth sign-in) and the browser control itself (site permissions, asking before consequential actions, the action log) come in the next two PRs in
extensions/browser.How:
app/domain/browser.pyholds thebrowser_sessionandbrowser_actiontables,run()(writes an action and waits for its answer, honouring Stop, a closed side panel and a timeout) and the tool specs. It also has the system note: look in the archive first, treat pages as third-party text, mark consequential actions.app/api/v1/routes/browser.pyconnects and lists sessions and streams actions as SSE (> for polling). It also answers actions, runs one action for agents and ends a session. Only the session's own person reaches any of it.Toolbox(browser=…)offers the tools only for the person's own live session.browser_importchecks that the upload it gets back is the person's and is held, then hands it toimport_files, which still asks for approval.ai.browser(on) andai.browser_steps(25).Motivation and Context
Adeel asked to chat with the assistant from the browser extension and let it do tasks by controlling the browser, like the Claude browser extension: "check my email and import important attachments".
Types of changes
!in the title)Checklist:
tests/api/test_browser.py; the full backend suite passes locally: 857 passed).docs/accordingly (docs/browser-assistant.md,docs/api.md,docs/assistant.md).## UnreleasedinCHANGELOG.md: this goes in with the extension PR, when people can use it.Done questions (AGENTS.md)
POST /browser/sessions/{id}/runand the whole session API are open to API and app tokens. MCP is n/a for now: the MCP server is read-only (noted under Refine later).ai.browserandai.browser_stepsare in Settings → AI assistant, with defaults, and not in the wizard.ai.browser_stepssteps, and those calls go through the ledger as usual.openapi.jsonand the client via tooling).docs/browser-assistant.mdandDEVLOG.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01PhTrpdr3XSgcD91oFxAiMQ
Generated by Claude Code