Skip to content

Stream stdout/stderr to the logger for every transport mode - #32

Open
m-messer wants to merge 1 commit into
mainfrom
fix/debug_messages
Open

Stream stdout/stderr to the logger for every transport mode#32
m-messer wants to merge 1 commit into
mainfrom
fix/debug_messages

Conversation

@m-messer

Copy link
Copy Markdown
Member

Summary

  • Every worker's stderr is now streamed line-by-line to the logger as it's produced (via a new worker.LogPipe helper), 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 share ProcessWorker.Start.
  • RPC transports other than stdio (ipc, http, ws, tcp) now also pipe and log the worker's stdout, which was previously discarded to /dev/null since nothing read it. stdio transport intentionally still leaves stdout untouched, since it's the literal JSON-RPC channel and logging it would corrupt the protocol framing.
  • The file adapter's stdout handling was refactored to use the same shared LogPipe helper 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/... (including TestWorker_CapturesStderr, confirming the ExitEvent.Stderr contract is unchanged)
  • Manual smoke test: run a worker under each RpcConfig.Transport and the file adapter with --log-level debug, confirm stdout/stderr lines appear in logs (except stdout under stdio transport, which must remain protocol-only)

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.
@m-messer
m-messer requested a review from neagualexa August 26, 2026 14:18
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