You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LogFileWriter lowercases camelCase CDP console levels, so console.group/time/profile entries do not round-trip #1143
[Diplomat, Opus 5]: Found while verifying #1123 (the docs fix for #912), whose new test is the first place in the repo that enumerates the full Runtime.consoleAPICalled.type set.
LogFileWriter.write uppercases the level onto the flat line, and parseFlatLine (packages/tool-server/src/utils/debugger/log-file-writer.ts:245) recovers it with levelRaw.toLowerCase().trim(). That inverse is lossy for every CDP level that is not all-lowercase.
Driving the real writer over all 18 CDP console types, 5 fail to round-trip:
The other 13 (log, debug, info, error, warning, dir, dirxml, table, trace, clear, assert, profile, count) survive.
Why it matters
createConsoleLogServer (js-runtime-debugger.ts:82, chromium-js-runtime-debugger.ts:66) replays the backlog through readAll() and then streams live entries straight off consoleAPICalled. A client that connects mid-session therefore sees "startgroup" for a console.group() that happened before it attached and "startGroup" for the identical call after - two different level strings for the same console API.
readFiltered({ level }) has the same hole (a filter for the canonical startGroup matches nothing), though today it has no production caller - only tests.
The existing regression test test/debugger/log-file-writer-level.test.ts states the contract as "The level must round-trip exactly for levels of any length", which these 5 falsify; its cases all happen to be lowercase.
Activity