Open Bug 2081630 Opened 1 month ago Updated 1 month ago

[firefox-devtools-mcp] Improve the output and filters of list_console_messages

Categories

(Developer Infrastructure :: Firefox MCP, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

Details

User feedback on list_console_messages. All the changes are in ConsoleEvents (src/firefox/events/console.ts) and in the tool.

  1. Tab of each message
  • Messages do not say which tab they come from. ConsoleEvents only stores source.realm, an opaque id shown as [realm]. BiDi already sends source.context in log.entryAdded.
  • Proposal: store the context, show the tab id on each message, and add a filter for one or more tabs. We could consider showing only the selected tab by default.
  1. Order
  • The buffer keeps up to 1000 messages, and slice(0, limit) returns the oldest ones. The most recent messages are usually the most useful. list_network_requests and list_downloads already show the newest first.
  • Proposal: show the newest messages first.
  1. Level filter
  • level matches exactly, so level=warn does not return errors.
  • Proposal: treat level as a minimum severity.
  1. Logged objects
  • console.warn("careful", { level: 2 }) shows as careful Object(1). That is the text summary built by Firefox. The server keeps the serialized args but never outputs them, not even with format=json.
  • Proposal: render the arguments as compact JSON (for example with remoteValueToNative), up to a size limit.
  1. Stack traces
  • Uncaught errors show no file or line. BiDi sends stackTrace for these entries, but the server drops it.
  • Proposal: show the top frame as file:line:column, and include the full stack in JSON output.
  1. Read only new messages
  • Only the time-based sinceMs filter exists, so an agent cannot reliably continue where its last call stopped.
  • Proposal: give each message a sequence number, and add an after parameter. Bug 2081601 (report new console errors in tool responses) may need the same kind of id.
See Also: → 2081631
You need to log in before you can comment on or make changes to this bug.