Skip to content

Honor configured logger across the request lifecycle#40

Merged
jackcbrown89 merged 2 commits intomainfrom
worktree-jb-use-given-logger
May 1, 2026
Merged

Honor configured logger across the request lifecycle#40
jackcbrown89 merged 2 commits intomainfrom
worktree-jb-use-given-logger

Conversation

@jackcbrown89
Copy link
Copy Markdown
Contributor

@jackcbrown89 jackcbrown89 commented May 1, 2026

Summary

  • WebSocketSession.handleRequest was replacing the configured logger with a fresh console-based one for every request, so a logger passed via RuntimeUseServerConfig.logger was bypassed for the entire request — including UploadTracker, ArtifactManager, InvocationRunner, the per-command logs, and the agent invocation's logger.
  • The fix introduces createPrefixedLogger(inner, prefix) and wraps the configured logger (falling back to defaultLogger) with the source-id prefix and redaction layers, so the user-provided logger receives every per-request line.
  • Bumps both packages to 0.15.1.

Test plan

  • npm run typecheck
  • npm test (151 passing, including two new WebSocketSession > logger tests verifying the configured logger receives prefixed, redacted log lines)

Note

Low Risk
Low risk: changes are limited to logging plumbing (prefixing/redaction and routing to configured logger) plus version bumps, with new tests covering expected behavior.

Overview
Ensures WebSocketSession.handleRequest routes all per-request logs through the user-provided SessionConfig.logger (falling back to defaultLogger) instead of always creating a fresh console logger.

Introduces createPrefixedLogger(inner, prefix) to apply the source_id tag while preserving the underlying logger, keeps secret redaction via createRedactingLogger, and adds tests verifying configured logger usage and redaction. Bumps package versions to 0.15.1 (Node and Python).

Reviewed by Cursor Bugbot for commit c75a593. Bugbot is set up for automated code reviews on this repo. Configure here.

WebSocketSession.handleRequest replaced the configured logger with a
fresh console-based one when a request arrived, so a logger passed via
RuntimeUseServerConfig was bypassed for the entire request — including
UploadTracker, ArtifactManager, InvocationRunner, and the agent
invocation. Wrap the configured logger with the source-id prefix and
redaction layers instead, and expose the new createPrefixedLogger helper.
@jackcbrown89 jackcbrown89 force-pushed the worktree-jb-use-given-logger branch from a37c627 to c75a593 Compare May 1, 2026 08:29
@jackcbrown89 jackcbrown89 merged commit 7bbf620 into main May 1, 2026
6 checks passed
@jackcbrown89 jackcbrown89 deleted the worktree-jb-use-given-logger branch May 1, 2026 18:10
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.

1 participant