Skip to content

Commit 5f89ac3

Browse files
committed
fix(cli): only follow logs if agent is starting when using ssh
1 parent 70046ea commit 5f89ac3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

cli/cliui/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func Agent(ctx context.Context, writer io.Writer, agentID uuid.UUID, opts AgentO
132132
}
133133

134134
stage := "Running workspace agent startup scripts"
135-
follow := opts.Wait
135+
follow := opts.Wait && agent.LifecycleState.Starting()
136136
if !follow {
137137
stage += " (non-blocking)"
138138
}

cli/cliui/agent_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,9 @@ func TestAgent(t *testing.T) {
258258
},
259259
},
260260
want: []string{
261-
"⧗ Running workspace agent startup scripts",
262-
"ℹ︎ To connect immediately, reconnect with --wait=no or CODER_SSH_WAIT=no, see --help for more information.",
261+
"⧗ Running workspace agent startup scripts (non-blocking)",
263262
"Hello world",
264-
"✘ Running workspace agent startup scripts",
263+
"✘ Running workspace agent startup scripts (non-blocking)",
265264
"Warning: A startup script exited with an error and your workspace may be incomplete.",
266265
"For more information and troubleshooting, see",
267266
},

0 commit comments

Comments
 (0)