Repository navigation
feat(browser): let the agent read the user's own Browser tab - #2287
Merged
Merged
Conversation
…ervation Observation revisions count per tab, so two tabs can share them. An observation from one tab could then pass the currency check on another and run its refs there. Bind act and evaluate observations to the tab they were taken from.
browser_inspect takes an optional tabId to read any tab in the thread, including one the user holds. A named read never claims control and never moves the agent's current tab. The inspect tab listing now shows who holds each tab, taken from the holder the broker enforces. Readiness and guidance reflect a user hold anywhere in the thread, since that hold blocks every effect. Closes #2219
…t from missing ones
The Electron host marks every tab in a held thread as held by the user,
while the web host marks only the tab the user took. browser_inspect now
lists each tab as { tabId, active, focused, holder } and reports a user
hold on any tab for every tab, which matches the thread-wide hold the
broker enforces. The listing also drops routing fields and control epochs
the model never uses.
A named read of a listed tab on a busy host now fails as retryable
instead of claiming the tab is not open.
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.
What
Before,
browser_inspectread only the agent's current tab. While the user held any tab,browser_tabs selectwas refused, so the agent could not read a user tab that wasn't already its current tab. The inspect tab listing carried no holder, and readiness looked only at the current tab.Now:
browser_inspecttakes an optionaltabIdand reads any Browser tab in the Thread, including one the user holds. A named read never claims control and never moves the agent's current tab.{ tabId, active, focused, holder }. Holder isuser,agent, ornone. A user hold on any tab shows on every tab, matching the thread-wide hold in ADR-0029.human-controland the guidance says "do not act" while the user holds any tab in the Thread, because that hold blocks every effect.Acceptance criteria, each covered by
broker.user-tab.test.ts:Verification:
tsc --noEmitis clean in contracts, server, and web.bun run lintexits 0. The only warnings are 2 pre-existing ones in untouched scripts.Why
Users ask about "this page" while a tab they opened is in front of them. The agent should be able to read it without taking it from them (#2219, part of #2206).
Review Notes
waitandassertarebrowser_actsteps, and ADR-0029 refuses every effect while the user holds. Repeatedbrowser_inspectis the read-only way to watch state. Adding a read-only wait would need its own operation.browser_openwithHUMAN_INTERRUPTED(verified). This PR follows the ADR. Allowingopenduring a hold would need an ADR amendment.human, and the web host marks only the held tab. The toolkit projection normalizes this for the model. Making both hosts publish the same shape is a possible follow-up.STALE_TARGET_GENERATIONrefusal unless the agent first selects that tab and inspects it again. The tool description says so.docs/internals/runtime/browser-v2-rollout.mdstays accurate.Closes #2219
Need help on this PR? Tag
@codesmith-botwith what you need.