Compare commits

...

1 Commits

Author SHA1 Message Date
Ammar Bandukwala
3dceb0eef9 fix: suppress startup script logs in non-blocking SSH mode
In non-blocking mode (--wait=no), skip streaming startup script logs
while still showing the stage indicator and warnings for failures.

This eliminates log spam when using SSH via ProxyCommand or with
--wait=no, bringing behavior closer to standard SSH expectations.

Fixes #13580
2025-12-03 12:37:57 -06:00

View File

@@ -152,7 +152,13 @@ func Agent(ctx context.Context, writer io.Writer, agentID uuid.UUID, opts AgentO
sw.Log(time.Time{}, codersdk.LogLevelInfo, "==> To connect immediately, reconnect with --wait=no or CODER_SSH_WAIT=no, see --help for more information.")
}
err = func() error { // Use func because of defer in for loop.
err = func() error {
// In non-blocking mode, skip streaming logs.
// See: https://github.com/coder/coder/issues/13580
if !opts.Wait {
return nil
}
logStream, logsCloser, err := opts.FetchLogs(ctx, agent.ID, 0, follow)
if err != nil {
return xerrors.Errorf("fetch workspace agent startup logs: %w", err)