Skip to content

Conversation

@raymyers
Copy link
Contributor

@raymyers raymyers commented Dec 4, 2025

Summary

This PR adds a simple command line flag --check-browser to the OpenHands Agent Server that tests browser functionality by attempting to render about:blank. This is meant to make issues like #1327 easier to catch.

Changes

  • Added --check-browser command line flag to openhands-agent-server/__main__.py
  • Implements browser functionality test that:
    • Registers browser tools
    • Creates a BrowserToolExecutor in headless mode
    • Attempts to navigate to about:blank
    • Returns appropriate exit codes (0 for success, 1 for failure)
    • Provides clear error messages on failure

Usage

# Test browser functionality
python -m openhands.agent_server --check-browser

# Use in deployment scripts
if python -m openhands.agent_server --check-browser; then
    echo "Browser functionality OK"
else
    echo "Browser functionality FAILED"
    exit 1
fi

# Docker health check
HEALTHCHECK CMD python -m openhands.agent_server --check-browser

- Add command line flag --check-browser to test browser functionality
- Tests if browser can render about:blank page
- Exits with code 0 on success, 1 on failure
- Useful for deployment verification and health monitoring

Co-authored-by: openhands <[email protected]>
@raymyers
Copy link
Contributor Author

raymyers commented Dec 4, 2025

/usr/local/bin/openhands-agent-server --check-browse

# ...
INFO     [bubus] 🗣️ EventBus_a4e1b38e🟢(⏳ 1 | ▶️ 1 | ✅ 15 ➡️ 31 👂).dispatch(BrowserStoppedEvent) ➡️ BrowserStoppedEvent#fce1 (#1 pending)
Browser check passed: Successfully rendered about:blank

Exits with 0.

sudo rm /usr/bin/chromium
/usr/local/bin/openhands-agent-server --check-browser
Browser check failed: Chromium is required for browser operations but is not installed.

To install Chromium, run one of the following commands:
  1. Using uvx (recommended): uvx playwright install chromium --with-deps --no-shell
  2. Using pip: pip install playwright && playwright install chromium
  3. Using system package manager:
     - Ubuntu/Debian: sudo apt install chromium-browser
     - macOS: brew install chromium
     - Windows: winget install Chromium.Chromium

After installation, restart your application to use the browser tool.
litellm/llms/custom_httpx/async_client_cleanup.py:66: DeprecationWarning: There is no current event loop

exits with 1

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.

3 participants