diff --git a/cli/cliui/agent.go b/cli/cliui/agent.go index 0ebc371891cb6..ac254955dfe6b 100644 --- a/cli/cliui/agent.go +++ b/cli/cliui/agent.go @@ -132,7 +132,7 @@ func Agent(ctx context.Context, writer io.Writer, agentID uuid.UUID, opts AgentO } stage := "Running workspace agent startup scripts" - follow := opts.Wait + follow := opts.Wait && agent.LifecycleState.Starting() if !follow { stage += " (non-blocking)" } diff --git a/cli/cliui/agent_test.go b/cli/cliui/agent_test.go index 43d135db2c2be..47c9d21900751 100644 --- a/cli/cliui/agent_test.go +++ b/cli/cliui/agent_test.go @@ -258,10 +258,9 @@ func TestAgent(t *testing.T) { }, }, want: []string{ - "⧗ Running workspace agent startup scripts", - "ℹ︎ To connect immediately, reconnect with --wait=no or CODER_SSH_WAIT=no, see --help for more information.", + "⧗ Running workspace agent startup scripts (non-blocking)", "Hello world", - "✘ Running workspace agent startup scripts", + "✘ Running workspace agent startup scripts (non-blocking)", "Warning: A startup script exited with an error and your workspace may be incomplete.", "For more information and troubleshooting, see", },