From 2fd0880f9aeec5b57f78f7d2caa24047cdd18b02 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Mon, 17 Aug 2026 06:13:45 +0000 Subject: [PATCH] fix(tunnel): stop double-wrapping credentials-server JSON logs The credentials-server command run over SSH (devsy internal agent container credentials-server) always logs structured JSON on stderr, like other devsy internal agent subcommands. Its stderr was wired to log.Writer(log.LevelDebug), which wraps each captured line as an opaque string under the local logger's own format, nesting one log record inside another. Switch to log.PipeJSONStream(), the existing mechanism already used for the same shape of problem in ssh-server and container-tunnel (pkg/tunnel/container.go, cmd/workspace/ssh.go): it parses each JSON line and re-emits it at its original level and message. --- pkg/tunnel/services.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/tunnel/services.go b/pkg/tunnel/services.go index cb86ac54c..b85052a0b 100644 --- a/pkg/tunnel/services.go +++ b/pkg/tunnel/services.go @@ -209,8 +209,11 @@ func runServicesIteration( errChan: errChan, }) - writer := log.Writer(log.LevelDebug) - defer func() { _ = writer.Close() }() + writer, writerDone := log.PipeJSONStream() + defer func() { + _ = writer.Close() + <-writerDone + }() command := buildCredentialsCommand(ctx, opts)