Honor configured logger across the request lifecycle#40
Merged
jackcbrown89 merged 2 commits intomainfrom May 1, 2026
Merged
Conversation
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.
a37c627 to
c75a593
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
WebSocketSession.handleRequestwas replacing the configured logger with a fresh console-based one for every request, so a logger passed viaRuntimeUseServerConfig.loggerwas bypassed for the entire request — includingUploadTracker,ArtifactManager,InvocationRunner, the per-command logs, and the agent invocation'slogger.createPrefixedLogger(inner, prefix)and wraps the configured logger (falling back todefaultLogger) with the source-id prefix and redaction layers, so the user-provided logger receives every per-request line.Test plan
npm run typechecknpm test(151 passing, including two newWebSocketSession > loggertests 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.handleRequestroutes all per-request logs through the user-providedSessionConfig.logger(falling back todefaultLogger) instead of always creating a fresh console logger.Introduces
createPrefixedLogger(inner, prefix)to apply thesource_idtag while preserving the underlying logger, keeps secret redaction viacreateRedactingLogger, and adds tests verifying configured logger usage and redaction. Bumps package versions to0.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.