fix: one canonical browser-selection resolution for serve, gateway, and doctor #151
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.45) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 295 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.340
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #151"
general
weight: 0.35
sasan1200
Problem
After #136 the stdio gateway composes its worker factory eagerly at startup. On any install without
AUTOMATION_RUNTIME_BROWSER_SELECTIONexported, the fail-closed default (exact Firefox, no enrolled profile) makes the gateway exit before answeringinitialize— agent hosts report a dead server, while pre-#136 the same install ran managed Chromium. Root cause: each entry point resolved browser selection differently (env-only, or not at all).Changes
firefox_companion::selection::resolve_browser_selection: single resolution order shared bybobby serve, the MCP gateway, andbobby doctor— env var override → persisted<config-dir>/bobby-browser/browser-selection.json→ built-in default. Present-but-malformed sources fail closed.bobby enroll-firefox-profilepersists the selection atomically (0600) at enrollment instead of instructing an env export. Enroll once; all entry points resolve it with no shell wiring.bobby doctorreports which source resolved (env / persisted path / default), closing the class of bug where doctor validates a path the gateway never uses.run_doctorrefactor into a structuredDoctorReportwith render/exit split and extracted pure checks — it was the one genuinely untested high-degree hotspot from the graph audit (the other six flagged hotspots already had direct or by-design coverage, verified by reading the test tree).Verification
run_doctortests (malformed config, malformed selection, satisfiable config).cargo testgreen on firefox-companion (25), bobby-browser (39), mcp-gateway (52); clippy, fmt, andcargo check --workspace --all-targetsclean.mcp-handshake(43 tools), and the gateway binary answersinitialize+tools/list. With nothing configured, serve/gateway/doctor fail closed with the identical actionable error.