Skip to content

Browser-opened temporary tabs/windows should close automatically after task completion #40694

@lamkan0210

Description

@lamkan0210

Summary

After the agent finishes browser-driven tasks (for example opening pages just to inspect, fetch, or verify something), it should close those temporary browser tabs/windows by default.

Problem

Right now, browser pages opened for one-off tasks can remain open after the task is done. This causes a few issues:

  • unnecessary resource usage
  • cluttered browser state
  • user confusion, especially when many temporary tabs accumulate
  • repeated reminders from users that these windows should have been closed

Suggested behavior

Adopt a stronger default cleanup habit for browser automation:

  1. If a tab/window was opened only for a temporary automation task, close it when the task is complete.
  2. Keep only pages the user explicitly wants to continue using.
  3. Treat "open for inspection/fetch/verification" as ephemeral unless the user says otherwise.

Why this matters

For long-running assistants, cleanup is part of good operational hygiene. Closing temporary browser pages reduces resource consumption and makes the assistant feel more disciplined and reliable.

Possible implementation ideas

  • Mark automation-opened tabs as temporary by default
  • Close those tabs automatically on successful completion
  • Optionally allow a config flag to keep them open for debugging
  • Preserve only user-attached / user-owned / explicitly pinned tabs

Thanks — this would noticeably improve day-to-day usability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions