Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Feature]: Add preview_close so agents can release collaborative browser tabs #8886

Closedsolomonneas(GitHub profile, opens in a new tab) opened this issue 1 comment

Summary

Add a preview_close tool so an agent can release a collaborative browser tab it created. There is currently no way to close a tab from the MCP surface.

Problem

The preview toolkit exposes 14 tools (preview_open, preview_status, preview_navigate, preview_snapshot, preview_click, preview_type, preview_press, preview_scroll, preview_wait_for, preview_evaluate, preview_resize, preview_set_appearance, preview_recording_start, preview_recording_stop). None of them closes a tab.

preview_open defaults to reuseExistingTab: true, so ordinary use stays on one tab and the gap is easy to miss. But the documented way to work with more than one page at a time is reuseExistingTab: false, and every tab created that way persists for the lifetime of the server. An agent that opens a second tab to compare two pages, or that is told to isolate a flow from the user's current tab, has no way to clean up after itself. The tabs accumulate silently across a long session.

The asymmetry is the awkward part: the tool surface can create unbounded state but cannot release any of it. The human can close a preview panel in the UI, so the capability exists; it is just not reachable from the agent side.

Proposed behavior

preview_close({ tabId })
  • tabId optional, defaulting to the agent session's current tab, matching every other tool in the family.
  • Closing a tab that is already gone should be a no-op success rather than an error, so cleanup paths do not need to guard.
  • Return the remaining tab list, or at least the new current tab, so the agent knows what it is pointed at afterward.

A narrower alternative that would also solve the accumulation problem: have tabs created with reuseExistingTab: false be scoped to the thread and torn down when the thread ends.

Notes

Version 0.0.38-nightly.20260831.1236. Found while auditing the preview tools; unlike #3713, #3714, and #3717 this one is a missing capability rather than a defect, and it is low severity on its own. Filing it separately so it is not lost inside those reports.

  1. Closing this: I filed it as an issue before reading CONTRIBUTING, which reserves issues for bug reports and directs feature requests to Ideas discussions. Moved to #8887. Sorry for the noise.

Sign in to join this conversation.