Stream stdout/stderr to the logger for every transport mode - #32
Open
m-messer wants to merge 1 commit into
Open
Conversation
Introduce `LogPipe` utility to read and log newline-delimited data streams, improving diagnostic consistency across stdout and stderr handling. Refactor worker and supervisor logic to leverage `LogPipe` for cleaner code and enhanced logging behavior.
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
worker.LogPipehelper), instead of being buffered silently and only surfaced as a single blob when the process exits non-zero. This applies uniformly to all transport modes (rpc/stdio, rpc/ipc, rpc/http, rpc/ws, rpc/tcp, file) since they all shareProcessWorker.Start.stdio(ipc,http,ws,tcp) now also pipe and log the worker's stdout, which was previously discarded to/dev/nullsince nothing read it.stdiotransport intentionally still leaves stdout untouched, since it's the literal JSON-RPC channel and logging it would corrupt the protocol framing.LogPipehelper instead of its own ad hoc buffer-and-dump-at-EOF logic, so behavior (and diagnostics) are consistent across adapters.Test plan
go build ./...go vet ./...go test ./internal/execution/worker/... ./internal/execution/supervisor/...(includingTestWorker_CapturesStderr, confirming theExitEvent.Stderrcontract is unchanged)RpcConfig.Transportand the file adapter with--log-level debug, confirm stdout/stderr lines appear in logs (except stdout understdiotransport, which must remain protocol-only)