stagehand-python@4.2.0a0.dev1537: fix: verify cached local Chrome debug port before trusting it ( 2542)
Stagehand (Python dev pre-release) fixes an issue where local Chrome attachment could fail due to stale browser connection IDs in cached DevToolsActivePort files.
Why this signal matters
Browserbase Stagehand released pre-release version stagehand-python@4.2.0a0.dev1537, fixing an issue where local browser discovery trusted stale DevToolsActivePort files. Previously, when a Chrome instance exited improperly and a subsequent instance reused the same debugging port with a different target ID, Stagehand checked only whether the port was listening. This resulted in connection failures (404 or connection resets) when attempting to use the outdated browser target ID. The fix validates cached targets against Chrome's live /json/version response, discards mismatched stale candidates, normalizes host differences (such as localhost vs 127.0.0.1) by matching URL paths, and falls back to live endpoint discovery.
Actionable summary
Stagehand-python 4.2.0a0.dev1537 resolves a connection bug where stale browser target IDs in DevToolsActivePort led to 404/reset errors by validating cached targets against /json/version before connecting.
- Agent usefulness
- 82/100
- Confidence
- 96%
- Canonical data
- JSON + Markdown
What builders should check
- Upgrade to stagehand-python@4.2.0a0.dev1537 (or subsequent stable releases) if experiencing 404 or connection reset errors during local Chrome discovery and auto-connect workflows.