Skip to content

Environment browser view: a page's new tab or pop-up closes when nobody views it (F39 point 9, DEV-6646) - #250

Merged
immakermatty merged 1 commit into
mainfrom
agent/DEV-6646-view-page-tabs
Oct 6, 2026
Merged

immakermatty merged 1 commit into
mainfrom
agent/DEV-6646-view-page-tabs

Conversation

@immakermatty

Copy link
Copy Markdown
Contributor

Status: ready for review. Head eb6f86a235a76a281fbebecb0baeaf20942f1a05, base main 6ab3503b (#242, released as v0.1.8-rc.38).

Plan: HumanAndMachine-ai/mission-control-data:v3 data/mission-control/plans/2026/10/DEV-6646-environment-browser-and-desktop.yaml, task-2026-10-06-502. Decision F39 point 9.

Why

#242 closes a remote tab after the grace only when the view opened it (or a tab it opened opened it). A tab or pop-up that a page in an agent's window opens (any target=_blank link the agent follows, an OAuth pop-up) was never closed once nobody viewed it. On a pilot day such windows pile up in the Environment's memory; each Chrome window costs tens of MB on an 8 GiB Environment. Root decision 0191 point 11 asks for less: a person's closed tab closes the remote one after a short grace "if no agent uses it".

What changes

  • src/browser/people/hub.ts. A tab that a page opens counts as the view's to close:
    • it closes 30 s after its last viewer leaves, or after 10 minutes when nobody ever views it;
    • it never closes while an agent-browser session is bound to it (an agent that works in the new tab binds its session to it);
    • an agent's own window is never closed by the view.
  • docs/decisions.md: F39 point 9 says so.
  • tests/environment-browser-view.test.ts: a regression where an agent's window opens two tabs and a session is bound to the second. The first closes after the grace; the second and the agent's window stay. Without the change it fails.

What does not change

Tabs the view opens, the grace lengths, the binding check, and everything else of F39.

Verification

  • tests/environment-browser-view.test.ts: 26/26 twice. The new test fails 25/26 without the change.
  • bun run lint and bun run typecheck pass.

Rollout

This rides in the next prerelease (v0.1.8-rc.39), which goes to the pilot Environment alone, together with rc.38's view, once its lane is free tonight.

🤖 Generated with Claude Code

…dy views it (F39 point 9, DEV-6646)

The view closed only the tabs it had opened itself (and what those opened).
A tab or pop-up that a page in an agent's window opened stayed open
forever once nobody looked at it, and with every page's `target=_blank`
such windows piled up in the Environment's memory. Root decision 0191
point 11 asks for less: a remote tab closes after a short grace "if no
agent uses it".

A tab a page opened now counts as the view's to close:
- 30 s after its last viewer leaves, or after 10 minutes when nobody ever
  views it;
- never while an agent-browser session is bound to it (an agent that
  works in the new tab binds to it);
- never an agent's own window.
A regression test proves an unviewed page tab closes while a bound one
and the agent's window stay; it fails without the change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@agentrozjedemeai agentrozjedemeai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@immakermatty Approved on exact head eb6f86a235a76a281fbebecb0baeaf20942f1a05. The page-opened target enters the existing own-tab grace lifecycle regardless of opener provenance; the agent original window is not added, and bound targets are excluded before close. F39 point 9 and the regression reflect that boundary. In an isolated checkout: environment-browser-view tests 26/26 twice, lint and typecheck pass; git diff --check clean. All live CI checks complete successfully or are explicitly skipped; no unresolved threads. This is a focused approval, not a release/merge instruction.

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.

2 participants