Skip to content

fix(logging): preserve transport and worker log context - #543

Merged
debugmcpdev merged 2 commits into
debugmcp:mainfrom
debugmcpdev:fix/transport-worker-logging
Aug 28, 2026
Merged

fix(logging): preserve transport and worker log context#543
debugmcpdev merged 2 commits into
debugmcp:mainfrom
debugmcpdev:fix/transport-worker-logging

Conversation

@debugmcpdev

Copy link
Copy Markdown
Collaborator

Description

Fixes #533 and #534.

  • attaches the shared file transport to the deprecated SSE command's CLI logger before its first lifecycle message, matching HTTP behavior
  • maps worker stderr prefixes (DEBUG, INFO, WARN/WARNING, and ERROR) to the corresponding server logger level
  • keeps indented and structural continuation lines with the preceding diagnostic while leaving fresh unprefixed output at error level
  • prefixes bootstrap and worker-entry lifecycle diagnostics so normal startup output is not reported as an error
  • preserves the bounded, sanitized captured stderr buffer byte-for-line as before

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Test improvement

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented hard-to-understand classification behavior
  • My changes generate no new warnings
  • I have added tests that prove the fixes are effective
  • New and existing unit tests pass locally with my changes
  • No downstream publication is required

Testing

pnpm run build
pnpm run test:unit                    # 230 files, 4,273 tests
pnpm run test:integration             # 8 passed / 2 skipped; 23 passed / 5 skipped
pnpm run lint
pnpm run check:personal-paths
git diff --check

Dogfooding through the source dev proxy also covered both transports:

  • SSE lifecycle/deprecation output appeared in the requested --log-file
  • a real JavaScript debug flow (breakpoint, locals, evaluation, continue, output, close) produced 294 worker-stderr records with no normal startup/debug record promoted to error

Test configuration: Windows x64, Node.js 24.14.1, pnpm 10.33.0

Related Issues


Reviewer: @debugmcp

Attach the SSE CLI logger's shared file transport before its first lifecycle message, and classify worker stderr using explicit levels while retaining continuation context and the original captured buffer.

Closes debugmcp#533

Closes debugmcp#534

Signed-off-by: JF <john.franklin@gmail.com>
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants