豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

feat: include stack trace in 'get_console_message' tool#740

Merged
OrKoN merged 1 commit intomainfrom
stack-trace-console-message
Jan 20, 2026
Merged

feat: include stack trace in 'get_console_message' tool#740
OrKoN merged 1 commit intomainfrom
stack-trace-console-message

Conversation

@szuend
Copy link
Copy Markdown
Contributor

@szuend szuend commented Jan 8, 2026

This is the stack trace of the console message itself. If the argument is an Error object or an "Error.stack" like string we don't do anything special (yet).

The stack trace is source mapped if source maps are available.

The function matches the target ID of the console message to the SDK.Target of DevTools. The only oddity is that DevTools works in a lazy manor: It creates stack traces upfront and as source maps come in, stack traces get updated. This does not work for the MCP server. Instead, we wait for script parsed events and source maps to attach before creating the stack trace. Since this could take potentially a while, we guard it with a time out.

@szuend szuend force-pushed the stack-trace-console-message branch from 96df988 to c869965 Compare January 8, 2026 12:49
@szuend szuend force-pushed the stack-trace-console-message branch 2 times, most recently from 31bb922 to 1fd2f86 Compare January 20, 2026 06:57
@szuend szuend requested a review from OrKoN January 20, 2026 07:02
@szuend szuend marked this pull request as ready for review January 20, 2026 07:02
Comment thread src/DevtoolsUtils.ts Outdated
Comment thread src/DevtoolsUtils.ts Outdated
Comment thread src/DevtoolsUtils.ts
This is the stack trace of the console message itself. If the
argument is an Error object or an "Error.stack" like string we
don't do anything special (yet).

The stack trace is source mapped if source maps are available.

For now, this only works for console messages of the main page
target as puppeteer doesn't tell us yet from which target a
console message is coming from.
@szuend szuend force-pushed the stack-trace-console-message branch from 1fd2f86 to 72ddc1f Compare January 20, 2026 08:36
@OrKoN OrKoN enabled auto-merge January 20, 2026 09:58
@OrKoN OrKoN added this pull request to the merge queue Jan 20, 2026
Merged via the queue into main with commit a3a0021 Jan 20, 2026
31 of 33 checks passed
@OrKoN OrKoN deleted the stack-trace-console-message branch January 20, 2026 10:03
github-merge-queue bot pushed a commit that referenced this pull request Jan 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.14.0](chrome-devtools-mcp-v0.13.0...chrome-devtools-mcp-v0.14.0)
(2026-01-27)


### 🎉 Features

* add a skill for using chrome-devtools-mcp
([#830](#830))
([aa0a367](aa0a367))
* add background parameter to new_page tool
([#837](#837))
([d756888](d756888))
* allow skipping snapshot generation for input tools
([#821](#821))
([4b8e9f2](4b8e9f2))
* include stack trace in 'get_console_message' tool
([#740](#740))
([a3a0021](a3a0021))
* support device viewport and user agent emulation
([#798](#798))
([a816967](a816967))
* support filePath for network request and response bodies
([#795](#795))
([6d0e4ca](6d0e4ca))


### 🛠️ Fixes

* handle beforeunload dialogs in navigations
([#788](#788))
([9b21f8b](9b21f8b))
* improve error handling for console messages
([#844](#844))
([dc43ede](dc43ede))
* improve error reporting when retrieving the element
([#845](#845))
([f7dd003](f7dd003))
* improve performance tool description
([#800](#800))
([aa9a176](aa9a176))
* increase timeouts for long text input
([#787](#787))
([a83a338](a83a338))
* make request and response handling more robust
([#846](#846))
([695817f](695817f))
* re-use node ids across snapshots
([#814](#814))
([a6cd2cd](a6cd2cd))


### 📄 Documentation

* add a mention of evals into contributing.md
([#773](#773))
([9a31ac7](9a31ac7))
* document how to add extensions to gemini-cli
([#834](#834))
([0610d11](0610d11))
* update auto-connect docs
([#779](#779))
([a106fba](a106fba))
* Update README.md to include a link to Android debugging
([#783](#783))
([6e52e66](6e52e66))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants