fix(bot-desktop): floor the browser selection on the profile's Chromium version #135947
All Vouch review confidence checks passed
Residual risk 0.34 = Change Risk (0.57) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 601 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.383
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #135947"
general
weight: 0.35
PRATHAMESH75
What does this PR do?
hermes updateprovisions the PM tool environment, which exportsAGENT_BROWSER_EXECUTABLE_PATHpinned to the PM Chromium (currently 145).tools/bot_desktop/browser.py::executable()honors that variable first, so after an update the Bot Desktop launches an older Chromium than the one that last wrote its persistent user-data-dir — and Chromium SIGTRAPs (rc -5) opening a jar written by a newer build, right after opening the DevTools endpoint, which the browser tool reports asCDP response channel closedon every profile.This PR floors the selection on the profile:
executable()accepts the profile's user-data-dir, and when the chosen binary's major version is lower than the version Chromium recorded in<user-data-dir>/Last Version, the bundled/system finders are consulted for a build that can still open it (the pre-update selection path: the newest Playwright Chromium in~/.cache/ms-playwright). The floor applies to the explicit pin and to every fallback candidate alike:Last Versionyet (first run) or an unprobeable binary → never blocks a launch, and no version probe runs at all without profile knowledge.The binary version probe runs
<exe> --version(argument list, no shell) once per path vialru_cache.Related Issue
Fixes #135932
Type of Change
Changes Made
tools/bot_desktop/browser.py:executable()takes an optional keyword-onlyprofileand applies the version floor; new helpers_chromium_major(cached--versionprobe),_profile_chromium_major(Last Versionparser),_opens_profile(fail-open comparison).tools/bot_desktop/browser.py:dock_launch()andenv_for_agent()pass the profile's user-data-dir so the dock and the agent get the same floored selection.tools/bot_desktop/runtime.py: the status probe'sbrowserfield reports the floored selection too.tests/tools/test_bot_desktop_browser.py: adapt twoexecutablemocks to the new keyword-only parameter.tests/tools/test_bot_desktop_browser_executable_guard.py: new — the fallback contract, the keep/stand cases, first-run profiles, theLast Versionparser and the real--versionline parse.How to Test
1.
python -m pytest tests/tools/test_bot_desktop_browser_executable_guard.py tests/tools/test_bot_desktop_browser.py tests/tools/test_bot_desktop_runtime.py tests/tools/test_local_env_bot_desktop.py -q→ Observed result: 42 passed, 7 skipped, 0 failed (the 7 skips are pre-existing host-dependent skips).2. The guard tests fail on
upstream/main(the keyword and helpers do not exist there) and pass with this change.3.
python scripts/check --base upstream/main→ Observed result:scripts/check: 11 checks, ok.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passpython scripts/checkpasses (the blocking lint and code-health checks CI runs)Documentation & Housekeeping
docs/, docstrings) — docstrings onexecutable()and the new helpers document the floorcli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/ALast Versionreads useutf-8-sig, the--versionprobe pinsencoding="utf-8", errors="replace"