feat(operate): unify network capture + implement CDP consoleMessages#816
Merged
feat(operate): unify network capture + implement CDP consoleMessages#816
Conversation
6 tasks
- operate open: start session capture before navigation (catches initial requests) - operate network: prefer readNetworkCapture() over JS interceptor - CDPPage: implement consoleMessages() via Runtime.consoleAPICalled Part of #810
…pture Daemon and CDP capture entries use responseStatus/responseContentType/ responsePreview (not status/contentType/responseBody). Fix the normalization in operate network to match the actual entry shape from extension/src/cdp.ts.
- Register Runtime.exceptionThrown handler to capture uncaught exceptions as error-level messages (most valuable diagnostic signal) - 'error' filter now returns both console.error() and warning/exception entries, matching typical severity-based logging semantics
b9780e7 to
117cb58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
operate open: start session capture before navigation (catches initial requests that JS interceptor misses)operate network: preferreadNetworkCapture()over JS__opencli_netinterceptor, with fallbackconsoleMessages()via CDPRuntime.consoleAPICalledevent bufferingDetails
operate open (
src/cli.ts):page.startNetworkCapture?.()beforepage.goto()startNetworkCaptureis not availableoperate network (
src/cli.ts):page.readNetworkCapturefirst and normalizes entries to match existing shape__opencli_netJS interceptor when session capture is unavailableCDPPage consoleMessages (
src/browser/cdp.ts):Runtime.enable+Runtime.consoleAPICalledlistener on first callDesign principle
All consumers follow the same rule: prefer session capture → fallback to legacy path. This ensures consistency across operate, explore, and future diagnostic consumers.
Test plan
operate open <url>+operate networkshould show captured requests including initial page loadPart of #810 (PR B). Depends on PR A for full CDP coverage, but works independently with daemon Page.