Skip to content

Fix confirmed runtime bugs found in the codebase audit #94

Closed

Description

@lanyue-llk

Each item below should become its own small PR with a regression test.

Confirmed

  • Rainbond readiness never accepts 4xx. harness/environments/webarena/rainbond.py:578 _wait_site intends to accept 200 <= status < 500. But urlopen raises HTTPError (a URLError/OSError subclass) for 4xx, and the except clause catches it and retries. A site answering 404 is never treated as ready, so the wait times out.
  • Unbounded process.wait() after a best-effort kill. In harness/web_fetch/providers/headless.py:790-799, terminate_owned_process_tree() returns False and leaves the worker alive when ps fails (providers/base.py:20-35). The process.wait() that follows has no timeout, so the run can hang forever. providers/moli.py:693 has the same pattern.
  • Browser Use resume differs from a fresh run. In harness/browser_use/runner.py:614-629, resume skips attempt 2 when the stored primary attempt is unsupported. A fresh run (:648) only stops on score == 1.0, so it does retry. Interrupted and uninterrupted cohorts therefore record different call counts. Pick one rule and apply it on both paths.
  • Failed attempts lose timing. In harness/browser_use/runner.py:264-320, agent_run_ms and evidence_finalize_ms are only set on the success path, so a failed attempt records 0 ms of agent time.
  • Cleanup errors are swallowed. In harness/browser_use/runner.py:320-331, the HAR/trace stop exception is dropped silently instead of being appended to cleanup_errors.
  • Three P50/P95 definitions. lexbench_webfetch.metrics.percentile uses nearest rank, while harness/web_fetch/wcxb_scoring.py:78 and harness/lexbench/report.py:323 interpolate linearly. So "P95" means different things in different reports, and the WCXB copy raises IndexError on an empty list. Use the upstream definition everywhere.
  • Public WebArena report hides audit failures. harness/trajectory_replay/public_webarena/report.py:56-63 catches ResultAuditError and renders "unavailable" instead of failing closed.

Suspected (verify first)

  • harness/web_search/review.py:787-813: a KeyError/TypeError from validate_result skips the kill and leaves the process registered in active. Use try/finally.
  • harness/trajectory_replay/remote_execution.py:252 _wait_cdp spins without sleeping on non-200 responses.
  • Bind-port-0-then-close TOCTOU races in catalog_runner.py:717, remote_execution.py:1069 and browser_use/backend.py:111.
  • browser_use/runtime.py creates a new docker.from_env() client per call and never closes it.
  • environments/webarena/har.py:420 keys requests by id(request), which can be reused after garbage collection.
  • tiktoken.get_encoding runs at import time (trajectory_replay/runner.py:40, public_webarena/runner.py:61), which may need network access.
  • assert is used for runtime preconditions (browser_use/runtime.py:589).
  • trajectory_replay/webarena_replay.py:741 uses locals().get(...) and calls the private service._submit.

Part of the refactor roadmap: #87

Activity

  1. added
    bug
    refactor
    on Oct 29, 2026
  2. lanyue-llk commented on Nov 3, 2026

    @lanyue-llk
    ContributorAuthor

    Resolved by #124, #125, #127, #140. Remaining work is tracked in #152.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrefactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions