fix(core): honor v3 piercer debug option
Summary
- Make
installV3ShadowPiercerderiveDEBUGfromopts.debug ?? falseinstead of hardcoding it totrue. - Add regression coverage for omitted
debugstaying silent and for idempotent reinstalls updating the stored debug state.
Why
V3ShadowPatchOptions.debug is currently ignored, so piercer install/attachShadow logs emit even when debug is omitted or false. This makes the option ineffective.
Fixes #1996.
Tests
pnpm --filter @browserbasehq/stagehand run gen-version✅pnpm --filter @browserbasehq/stagehand run build-dom-scripts✅pnpm --filter @browserbasehq/stagehand run build:esm✅pnpm --filter @browserbasehq/stagehand test:core packages/core/dist/esm/tests/unit/v3-shadow-piercer-debug.test.js✅ (Vitest: 1 file, 2 tests)pnpm exec vitest run --config vitest.esm.config.mjs dist/esm/tests/unit/v3-shadow-piercer-debug.test.js✅ (Vitest: 1 file, 2 tests)pnpm exec prettier --check packages/core/lib/v3/dom/piercer.runtime.ts packages/core/tests/unit/v3-shadow-piercer-debug.test.ts✅pnpm exec eslint packages/core/lib/v3/dom/piercer.runtime.ts packages/core/tests/unit/v3-shadow-piercer-debug.test.ts✅pnpm --filter @browserbasehq/stagehand run typecheck✅pnpm changeset status --since origin/main✅
Compatibility / risk
- Default
installV3ShadowPiercer()is quiet unlessdebug: trueis provided, matching the option semantics. - Existing idempotent installs still reuse state and now correctly update that state's debug flag from
opts.debug. - No dependency changes or public API shape changes.
🦋 Changeset detected
Latest commit: 7c062e64aa4feed4b1b4d038d98646037a5791e5
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 5 packages
| Name | Type |
|---|---|
| @browserbasehq/stagehand | Patch |
| @browserbasehq/browse-cli | Patch |
| @browserbasehq/stagehand-evals | Patch |
| @browserbasehq/stagehand-server-v3 | Patch |
| @browserbasehq/stagehand-server-v4 | 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
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. Approving the latest commit mirrors it into an internal PR owned by the approver. If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.
Friendly follow-up: this is still waiting on approval of the latest external contributor commit so CI can run. The current head remains scoped to the v3 piercer debug option path, includes a changeset, and the automated review reported no issues. Happy to adjust anything maintainers want changed.
Friendly follow-up: this is still waiting on approval of the latest external contributor commit so CI can run. The branch remains scoped to honoring the v3 piercer debug option, includes the changeset, and the automated review did not find issues. Happy to adjust anything maintainers want changed.