Skip to content

[Hermes][Browser tests][1/n] Prevent real Chrome launch in retry test - #266

Merged
OmarB97 merged 1 commit into
mainfrom
fix/browser-test-no-real-chrome-20260712
Jul 12, 2026
Merged

[Hermes][Browser tests][1/n] Prevent real Chrome launch in retry test#266
OmarB97 merged 1 commit into
mainfrom
fix/browser-test-no-real-chrome-20260712

Conversation

@OmarB97

@OmarB97 OmarB97 commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Why

test_browser_manage_connect_default_local_retries_after_launch still mocked the retired boolean try_launch_chrome_debug helper after the gateway switched to the structured launch_chrome_debug API. Running the test therefore launched a real detached Google Chrome with a pytest-temporary profile; repeated test runs opened windows, stole focus, and surfaced the fixture text partial answer complete on the live desktop.

What changed

  • Mock hermes_cli.browser_connect.launch_chrome_debug, the symbol the gateway actually imports.
  • Return ChromeDebugLaunch(launched=True) so the test exercises the production structured result contract without starting an OS process.
  • Production browser behavior is unchanged; this is a regression-test isolation repair.

How to review

Read the single hunk in tests/test_tui_gateway_server.py and compare it with tui_gateway/server.py where _browser_connect imports and calls launch_chrome_debug. Confirm the replacement mock matches that call and preserves the existing retry assertions.

Evidence

Before the fix, the machine accumulated eight detached Chrome roots with command lines containing pytest-of-obaradei/.../test_browser_manage_connect_de2/hermes_test/chrome-debug; another unfixed run created PID 14501 at 2026-07-12 13:40:05 PDT and a later run created another orphan five minutes later. After the fix, both the exact test and the adjacent browser-connect slice completed with test_chrome_before=none and test_chrome_after=none.

Verification

  • scripts/run_tests.sh tests/test_tui_gateway_server.py -k test_browser_manage_connect_default_local_retries_after_launch -> 1 passed, 0 failed.
  • scripts/run_tests.sh tests/test_tui_gateway_server.py -k browser_manage_connect -> 16 passed, 0 failed.
  • Process-set assertion around both runs -> no Google Chrome process with a pytest test_browser_manage_connect_de profile was created.
  • git diff --check -> passed.

Risks / gaps

  • Accepted risk, no follow-up: only a stale test mock changes; production launch code is untouched.
  • Already-running agents on old checkouts can still launch one final orphan until their current test loop is stopped or updated. Immediate local cleanup and live-loop tracing are tracked in MeshBoard task hermes-browser-connect-test-no-real-chrome-20260712.
  • No follow-up needed: upstream delivery uses a separate clean branch based on NousResearch/hermes-agent:main because the fork and upstream currently have no merge base; this fork PR intentionally contains only the fork-main version of the same one-hunk repair.

Collaborators

Participants:

  • @OmarB97 — operator on ko-mac
  • GPT-5 Codex — OpenAI, interactive implementation lane

Process:

  • Time to finish: about 25 minutes
  • Iteration: 1 of 1
  • Lead reviewer: MeshBoard peer-review lane (exact-head review pending)

Task context:

  • Task: hermes-browser-connect-test-no-real-chrome-20260712
  • Size: S · Risk: medium · Priority: High

Related work:

  • Diff review: hermes-browser-connect-test-no-real-chrome-20260712-review
  • Upstream PR: opened from clean upstream branch after this fork mirror

@OmarB97
OmarB97 merged commit 28f371d into main Jul 12, 2026
19 of 28 checks passed
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