Skip to content

fails after manually closed shell.exe: Browser not launched. Call launch first. #386

@zhzLuke96

Description

@zhzLuke96

Issue Description

When chrome-headless-shell.exe is manually closed, agent-browser enters a broken state and cannot recover automatically.

OS: windows 10

Steps to Reproduce

agent-browser open example.com

This command starts chrome-headless-shell.exe.
If I manually close this process (I expected this to behave the same as running agent-browser close), then any subsequent command fails, with no useful error information to indicate what went wrong.

Example:

$ agent-browser open example.com
✗ Browser not launched. Call launch first.

At this point, agent-browser is essentially unusable.

Workaround

Running the following command resolves the issue:

$ agent-browser close
✓ Browser closed

Expected Behavior

Since the browser process has already exited, agent-browser should be able to detect this state automatically and recover by itself (e.g. internally calling close or resetting its state), instead of remaining in an error state with misleading messages.

Currently, because there is no clear error context or diagnostic information, it’s very difficult to locate the root cause from the user/agent side.

I believe agent-browser should handle this situation more gracefully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions