Skip to content

[Claimed #3423] [fix]: report cached browser start failures in browse doctor - #3439

Merged
shrey150 merged 3 commits into
mainfrom
external-contributor-pr-3423
Nov 10, 2026
Merged

shrey150 merged 3 commits into
mainfrom
external-contributor-pr-3423

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Mirrored from external contributor PR #3423 after approval by @shrey150.

Original author: @kenneshagarg
Original PR: #3423
Approved source head SHA: 4c4bcfa62a31868364139ab8a1e7f1df1c464dfe

@kenneshagarg, please continue any follow-up discussion on this mirrored PR. When the external PR gets new commits, this same internal PR will be marked stale until the latest external commit is approved and refreshed here.

Original description

why

When a session's browser fails to start, every browse command errors but browse doctor still reports all [ok]. DriverSessionManager keeps the failure for retry backoff, but status() doesn't expose it, so doctor can't tell a failed start from a daemon that hasn't started a browser yet. Root cause identified by @DevChiniwala in #3359.

Addresses part of #3359: this fixes the false all-clear from browse doctor, not the underlying ECONNREFUSED, which I haven't reproduced with a managed local browser.

what changed

  • status() now includes initError while a failed start is cached. it's absent otherwise, so existing status output doesn't change.
  • browse doctor reports the failure in the existing row for the session's target (browser, browserbase, or cdp), with the first line of the error, and puts the full error in --json details. it doesn't launch Chrome or retry the failed start.
  • no Fix: line, since the right fix depends on the cause.

I put this in status() rather than an explicit launch probe so doctor stays read-only. happy to change that if you'd prefer a probe.

test plan

  • driver-foundation.test.ts: a real DriverSessionManager with a rejected launch reports initError from status() without launching again, and reports none before any attempt.
  • doctor.test.ts: for each target kind, initError produces a fail verdict and exactly one row for that component, with the first-line message, the full error in details, and the rendered [fail] line. a running daemon without a failed start adds no component row.
  • both new tests fail without the source change.
  • ran the built CLI: browse open against a closed CDP port, then browse doctor, which printed [fail] cdp last start failed: Failed to open CDP WebSocket and exited 1.
  • pnpm check passes. CLI tests: 557 passed, 1 failed. that failure, cli-surface.test.ts > prints browse root help, also fails without this change. check-changesets also fails on main because of the existing agent-discoverability-metadata.md.

🤖 Generated with Claude Code


Summary by cubic

Fixes browse doctor reporting all [ok] when a session's browser failed to start, so the failure is no longer hidden. The daemon now exposes the cached start failure through status().initError, and browse doctor renders a [fail] in the session's target row (browser, browserbase, or cdp) with the first line of the error; the full error appears in --json details. The check is read-only and doesn't relaunch or retry the failed start. Addresses part of #3359.

Written for commit 4c4bcfa. Summary will update on new commits.

View guided diff

kenneshagarg and others added 3 commits November 8, 2026 22:46
DriverSessionManager keeps the last init failure for retry backoff, but
status() did not expose it, so browse doctor reported a daemon whose
browser failed to start the same as one that had not started yet.

Addresses part of #3359.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Show the cached start failure in the existing component row for the
session's target (browser, browserbase, or cdp) instead of always adding
a separate browser row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:mirrored An internal mirrored PR currently exists for this external contributor PR. labels Nov 10, 2026
@changeset-bot

changeset-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5a67965

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
browse Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

This mirrored PR has been merged into main. The original external PR #3423 is now completed.

@shrey150 shrey150 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI green. Verified end to end: a failed start now replaces the target's doctor row (browser / browserbase / cdp) instead of adding a duplicate. Thanks @kenneshagarg!

@shrey150
shrey150 merged commit 2fe947c into main Nov 10, 2026
19 checks passed
@shrey150
shrey150 deleted the external-contributor-pr-3423 branch November 10, 2026 22:50
@github-actions github-actions Bot added external-contributor:completed The mirrored PR has been merged and the external contributor flow is complete. and removed external-contributor:mirrored An internal mirrored PR currently exists for this external contributor PR. labels Nov 10, 2026
shrey150 pushed a commit that referenced this pull request Nov 13, 2026
Release Browse independently of the Stagehand SDKs. Merging this PR
publishes the CLI from the merged commit.

## 0.11.4

### Patch Changes

- [#3426](#3426)
[`f93e6d1`](f93e6d1)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Report an
error when an active browser session disconnects during command startup
instead of automatically starting a replacement.

- [#3379](#3379)
[`73fdba0`](73fdba0)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - remove
unused deepmerge dependency

- [#3330](#3330)
[`dc8eb40`](dc8eb40)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - bump zod to
4.6.6

- [#3289](#3289)
[`aa67fee`](aa67fee)
Thanks [@shrey150](https://github.com/shrey150)! - Add `--stagehand`
flag to `browse cloud extensions upload`.

- [#3439](#3439)
[`2fe947c`](2fe947c)
Thanks [@github-actions](https://github.com/apps/github-actions)! - Make
`browse doctor` fail and show the cause when the session's last browser
start failed

- [#3400](#3400)
[`ce298c6`](ce298c6)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Add token
validation to internal local Functions runtime requests

- [#3408](#3408)
[`6a56cbb`](6a56cbb)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Fix Windows
package-manager command launching for Functions and templates, and
terminate child processes when skill installation times out.

- [#3391](#3391)
[`3fbda6b`](3fbda6b)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Validate
daemon directory locations before connecting to a session.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
aryansahai22 added a commit to aryansahai22/stagehand that referenced this pull request Nov 15, 2026
…ch the fix hint to the target's doctor row
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:completed The mirrored PR has been merged and the external contributor flow is complete. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants