fix(cli): ensure cliui.Agent doesn't fetch infinitely (#8446)

This commit is contained in:
Colin Adler
2023-07-12 10:21:54 -05:00
committed by GitHub
parent 14caa9b7c1
commit 1c3bfacca3
6 changed files with 72 additions and 44 deletions

View File

@ -175,10 +175,8 @@ func (r *RootCmd) ssh() *clibase.Cmd {
// OpenSSH passes stderr directly to the calling TTY.
// This is required in "stdio" mode so a connecting indicator can be displayed.
err = cliui.Agent(ctx, inv.Stderr, cliui.AgentOptions{
Fetch: func(ctx context.Context) (codersdk.WorkspaceAgent, error) {
return client.WorkspaceAgent(ctx, workspaceAgent.ID)
},
err = cliui.Agent(ctx, inv.Stderr, workspaceAgent.ID, cliui.AgentOptions{
Fetch: client.WorkspaceAgent,
FetchLogs: client.WorkspaceAgentStartupLogsAfter,
Wait: wait,
})