feat: group identical consecutive console messages in list_console_messages#1938
Closed
masamaru0513 wants to merge 2 commits intoChromeDevTools:mainfrom
Closed
feat: group identical consecutive console messages in list_console_messages#1938masamaru0513 wants to merge 2 commits intoChromeDevTools:mainfrom
masamaru0513 wants to merge 2 commits intoChromeDevTools:mainfrom
Conversation
…ssages Group consecutive messages with the same type and text, displaying a count suffix (e.g. [20 times]) similar to Chrome DevTools' console grouping behavior. Grouping is applied before pagination so the grouped count accurately reflects the total items. - Add groupConsecutive() static method to ConsoleFormatter - Add toStringGrouped()/toJSONGrouped() for count-aware formatting - Add optional count field to ConsoleMessageConcise interface - Apply grouping in McpResponse before pagination Fixes ChromeDevTools#904
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Extend console message grouping to include lastId so that consumers can access the last message in a group via get_console_message. Also require argCount to match for grouping, preventing false grouping of messages with different argument counts. - Add lastId field to grouped output (string and JSON) - Add argCount equality check in groupConsecutive() - Add unit tests for grouping, toStringGrouped, toJSONGrouped Fixes ChromeDevTools#904
907f3ed to
aad515d
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
Group consecutive identical console messages in
list_console_messages, similar to Chrome DevTools' console grouping behavior.Fixes #904
Changes
ConsoleFormatter.groupConsecutive()static method that groups consecutive messages with the same type, text, and argument counttoStringGrouped()/toJSONGrouped()for count-aware formattinglastIdto grouped output so consumers can access the last message in a group viaget_console_messageKey design decisions
McpResponsebefore callingpaginate().lastIdfield: Enables consumers to access any message in a group. The first message'smsgidis the group's ID, andlastIdgives the range.argCountmatching: Prevents false grouping of messages with the same text but different argument counts.Output example
Testing
tests/formatters/ConsoleFormatterGrouping.test.ts