Repository navigation
Conversation
Lightning00Blade
approved these changes
Sep 11, 2025
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Feb 6, 2026
…rror objects (#902) This PR improves the `get_console_message` tool when logging `Error` objects. We use the existing `getExceptionDetails` CDP command to retrieve the structured stack trace, we'll then source map. Example: ```js try { compute(); } catch (e) { console.log('Compute failed', e); } ``` Before: ```txt ### Arguments Arg #0: Compute failed Arg #1: {} ``` After: ```txt ### Arguments Arg #0: Compute failed Arg #1: ComputeError: Invariant violation at compute (foo.ts:1:20) at <anonymous> (main.ts:2:8) Note: line and column numbers use 1-based indexing ``` --------- Co-authored-by: Alex Rudenko <[email protected]>
wolfib
pushed a commit
to wolfib/chrome-devtools-mcp
that referenced
this pull request
Mar 10, 2026
…rror objects (ChromeDevTools#902) This PR improves the `get_console_message` tool when logging `Error` objects. We use the existing `getExceptionDetails` CDP command to retrieve the structured stack trace, we'll then source map. Example: ```js try { compute(); } catch (e) { console.log('Compute failed', e); } ``` Before: ```txt ### Arguments Arg #0: Compute failed Arg ChromeDevTools#1: {} ``` After: ```txt ### Arguments Arg #0: Compute failed Arg ChromeDevTools#1: ComputeError: Invariant violation at compute (foo.ts:1:20) at <anonymous> (main.ts:2:8) Note: line and column numbers use 1-based indexing ``` --------- Co-authored-by: Alex Rudenko <[email protected]>
1 task
This was referenced Sep 22, 2026
gembitious
added a commit
to gembitious/chrome-devtools-mcp
that referenced
this pull request
Nov 16, 2026
…hromeDevTools#3408) Fixes ChromeDevTools#3406 `get_console_message` resolved an `Error` argument of a console message by sending its `objectId` to the DevTools universe's CDP session, but the `objectId` comes from the `JSHandle` that Puppeteer created on its own session. Object ids are numbered per session, so once anything wraps an object on only one of the two sessions (every `evaluate_script` does), the argument showed another message's Error and stack, or no stack and no cause. ### Change - `ConsoleFormatter.from` passes the session of the argument's handle to `SymbolizedError.fromError`, as it already passes `msg.session` for uncaught errors. `SymbolizedError` then calls `Runtime.getExceptionDetails` and `Runtime.getProperties` on that session. - The handle's `client` is used when it has a `send()` method. This does not use `instanceof CdpJSHandle`: the bundled server and the unbundled `puppeteer` package that the tests launch Chrome with have separate copies of that class. A handle without a session is resolved in the universe as before. - `SymbolizedError` only calls `send()` on the session, so its `session` parameters now take `SessionLike = Pick<CDPSession, 'send'>`. Uncaught errors still pass their `CDPSession` unchanged. What changes for users: - `get_console_message` shows each `Error` argument's own message, stack and cause, also after `evaluate_script` or anything else that wraps objects on Puppeteer's session. Before, those arguments could show the Error of another message, or lose their stack and cause. - No other tool resolves `Error` arguments: `list_console_messages` and uncaught errors print as before. ### Tests - `tests/formatters/ConsoleFormatter.test.ts`, `resolves an Error argument on the session of its handle`: an `Error` argument whose handle has a mock session is resolved with `Runtime.getExceptionDetails` on that session. Fails on `main` (the session is never called). - `tests/tools/console.test.ts`, `resolves Error arguments after evaluateHandle`: with a real browser, `evaluateHandle` wraps one object on Puppeteer's session only, then the page logs `console.error('failed', new Error('boom'))` from `logError()`. `get_console_message` must show `at logError` under `Arg ChromeDevTools#1`. Fails on `main`, which prints `Arg ChromeDevTools#1: Error: boom` with no stack. - The existing source map snapshots for `Error` arguments (`applies source maps to stack traces of Error object console.log arguments` and the `(with cause)` variant) pass unchanged. - `npm run sync`, `npm run build`, then `npm run test:no-build` as in CI: 1960 tests, 1957 pass, 3 skipped, 0 fail (macOS, Node 22.23.4, Chrome 157). Prettier and ESLint are clean for the changed files. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
No description provided.