Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent not closing intermediate tabs #260

Open
ashimgupta39 opened this issue Feb 9, 2025 · 3 comments
Open

Agent not closing intermediate tabs #260

ashimgupta39 opened this issue Feb 9, 2025 · 3 comments

Comments

@ashimgupta39
Copy link

Issue Description
The agent is expected to close intermediate tabs before opening new ones, but the tabs are not actually being closed. This results in multiple unused tabs remaining open, potentially leading to performance issues and resource leaks.

Reproduction Steps-

  1. Run the agent with multiple tabs opening in sequence.
  2. Observe that intermediate tabs are not being closed.

Expected Behavior-
The agent should close all but the last opened tab before proceeding to the next one.

Actual Behavior-
Tabs remain open.

@vvincent1234
Copy link
Contributor

Are you using the function of run agent or deep research? Is your computer Windows or MacOS?

@ashimgupta39
Copy link
Author

I am using run agent on MacOS.

@FelipeMoreiraRamos
Copy link

I think there is no action for closing tabs. You can implement your own like this

@self.registry.action('Close current tab', requires_browser=True)
async def close_current_tab(browser: BrowserContext):
    await browser.close_current_tab()
    msg = f'❌ Closed current tab.'
    logger.info(msg)
    return ActionResult(extracted_content=msg, include_in_memory=True)

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

No branches or pull requests

3 participants