Repository navigation
fix(extension): avoid work for suppressed CDP logs - #3326
raederhans wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 7cc1c66 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
why
Addresses the logging-overhead portion of #3239. This does not close the whole issue: Runtime/DOM setup caching and element-handle reuse are intentionally out of scope.
Suppressed records currently reach schema validation, payload serialization and log-span creation. CDP calls and unsolicited events also serialize their debug payloads before the logger can filter them.
what changed
StagehandLogger.isEnabled()check and filter suppressed records before validation/serialization/span creation. Keep the final emission check so a data getter or span processor changing the level tooffstill prevents emission.{ debug, error }loggers without a level query retain concrete-object payloads and their previous behavior.toJSONinputs do not introduce retained pending requests.test plan
Passed locally on Node 24.22.1:
main(59346d0); the extension suite again passed 1,074 tests, with extension build/typecheck and release-metadata checks passing. The compatibility run used two test workers after a parallel artifact-comparison timeout.toJSONpayloads, legacy custom loggers, scoped context, error rejection and operation-span preservation.just fmt, targeted formatting/lint, release metadata checks, Python generated-code drift/lock/ruff/type checks, andgit diff --check.socksiointo the local test environment only; no dependency manifests were changed.A deterministic 100-call mixed root/session harness measured parameter serialization 200 → 100, log spans 200 → 0, wire messages 100 → 100, and operation spans 1 → 1. These are work counts, not browser timing or end-to-end performance claims.
The full repository gates are not green in this sandbox. The docs validator cannot enumerate network interfaces; a root release test requires a blocked local
tsxIPC socket; an eval-doctor test detects the sandbox's read-only Codex home; browser suites cannot launch Chromium (socket() EPERM) and a cross-version test cannot resolve the package registry. No unrelated code was changed to work around these restrictions. The broad test run completed with 37/42 tasks passing; its temporary SDK package-install failure passed separately after correcting cache locations.Developed with AI assistance and independently reviewed by a separate AI agent. This is a draft for human review; the submitting contributor remains responsible for the change. No maintainer approval is claimed. External-contributor CI still requires the repository's normal team approval; this PR does not bypass that process.