Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions browser/agent-harness/cli_anything/browser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,25 @@ Run: `npx @apireno/domshell --version` (first run downloads the package)
- Ensure Chrome is running
- Install DOMShell extension from Chrome Web Store
- Check that DOMShell is enabled in Chrome
- Verify `DOMSHELL_TOKEN` matches the token used by the running DOMShell server

### Commands hang on first use
First `npx` call downloads DOMShell package (10-50 MB). Subsequent calls are faster. Use `--daemon` mode for persistent connection.

If the server is unreachable or auth token is wrong, MCP calls now fail with timeout instead of hanging forever.
Set the per-tool-call timeout (seconds) via:

```bash
export CLI_ANYTHING_BROWSER_MCP_TIMEOUT=20
```

Session initialization (spawning `npx`/`domshell-proxy` and completing the MCP handshake)
can legitimately take longer than a regular tool call, so it has its own timeout:

```bash
export CLI_ANYTHING_BROWSER_MCP_INIT_TIMEOUT=120
```

## Architecture

This CLI follows the [CLI-Anything harness methodology](https://github.com/HKUDS/CLI-Anything/tree/main/cli-anything-plugin/HARNESS.md):
Expand Down
2 changes: 1 addition & 1 deletion browser/agent-harness/cli_anything/browser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
Accessibility Tree exposed through DOMShell's MCP server.
"""

__version__ = "1.0.0"
__version__ = "1.0.1"
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def repl():
global _repl_mode
_repl_mode = True

skin = ReplSkin("browser", version="1.0.0")
skin = ReplSkin("browser", version="1.0.1")
skin.print_banner()

pt_session = skin.create_prompt_session()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ The CLI provides clear error messages for common issues:
- **npx not found**: Install Node.js from https://nodejs.org/
- **DOMShell not found**: Run `npx @apireno/domshell --version`
- **MCP call failed**: Install DOMShell Chrome extension
- **MCP timeout / hanging calls**: Verify `DOMSHELL_TOKEN`, ensure DOMShell server is running, and optionally tune timeouts via `CLI_ANYTHING_BROWSER_MCP_TIMEOUT` (default: 20s, per tool call) and `CLI_ANYTHING_BROWSER_MCP_INIT_TIMEOUT` (default: 120s, session initialize)

Check `is_available()` return value before running commands.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

import pytest
from unittest.mock import AsyncMock, MagicMock, patch
from unittest.mock import AsyncMock, patch

from cli_anything.browser.core.session import Session
from cli_anything.browser.core import page, fs
Expand Down
Loading
Loading