Skip to content

Add watchdogs for hanging runtime paths#48

Open
exe-dev-github-integration[bot] wants to merge 1 commit into
mainfrom
hang-watchdog-fixes
Open

Add watchdogs for hanging runtime paths#48
exe-dev-github-integration[bot] wants to merge 1 commit into
mainfrom
hang-watchdog-fixes

Conversation

@exe-dev-github-integration
Copy link
Copy Markdown
Contributor

@exe-dev-github-integration exe-dev-github-integration Bot commented Jun 3, 2026

Summary

  • add LLM request-open and stream-idle watchdogs
  • bound MCP stdio writes/responses and respect cancellation at the MCP tool boundary
  • add Python worker default timeout, bounded request writes, stale response filtering, and stderr nulling
  • add browser/CDP connect deadline and browser tool outer timeout/cancel guard
  • thread real cancellation through compaction
  • reject non-regular files in apply_patch/view_image before blocking reads/writes

Verification

  • git diff --check
  • cargo fmt --check -p browser-use-agent -p browser-use-browser -p browser-use-llm -p browser-use-python-worker
  • cargo test -p browser-use-llm -p browser-use-agent -p browser-use-python-worker -p browser-use-browser
  • uv run --with pytest python -m pytest -q

Note: branch was rebuilt on rewritten latest main and is one commit over origin/main.


Summary by cubic

Adds watchdogs and real cancellation across LLM, MCP, browser, and Python worker paths to prevent hangs and surface timeouts clearly. Also tightens file safety in apply_patch and view_image.

  • New Features

    • LLM (browser-use-llm): request open timeout (120s) and stream idle timeout (300s) with clear transport errors.
    • MCP stdio (browser-use-agent): bounded notification send, per-request reply timeout, and timed error replies on unknown methods.
    • Browser tool (browser-use-agent, browser-use-browser): outer watchdogs for command/execute/observe/cancel, cancel-aware blocking task, and CDP connect deadline (10s).
    • Python worker (browser-use-python-worker): default tool timeout (120s), bounded request writes with kill/restart on write hang, stale-response filtering, and stderr nulled.
    • Compaction (browser-use-agent): caller cancellation is threaded into summarize with backoff respecting cancel.
  • Bug Fixes

    • apply_patch and view_image: reject non-regular files before IO; view_image enforces inline size limit up front.
    • Tests cover connection/idle timeouts, cancel-first behavior, and special-file rejection.

Written for commit d948195. Summary will update on new commits.

Review in cubic

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.

1 participant