microvm console: show resume/connect progress and friendly closes by sgupta832 · Pull Request #2006 · digitalocean/doctl · GitHub
Skip to content

microvm console: show resume/connect progress and friendly closes - #2006

Open
sgupta832 wants to merge 2 commits into
digitalocean:mainfrom
sgupta832:microvm-console-ux-resuming
Open

sgupta832 wants to merge 2 commits into
digitalocean:mainfrom
sgupta832:microvm-console-ux-resuming

Conversation

@sgupta832

Copy link
Copy Markdown
Contributor

Summary

  • Fail fast when doctl compute microvm console is run without a TTY.
  • Print Connecting / Resuming / Connected status lines on stderr (server already sends status:resuming and will send status:connected after the companion cthulhu PR).
  • Map server limit kicks (idle_timeout, session_max_duration) to exit 0 with plain messages; keep client_unresponsive and other codes as errors.

Companion: microdroplet customer-facing PTY/exec fixes (MDROP-493 follow-up).

Test plan

  • go test ./commands/ -run TestConsoleControlError
  • Manual: doctl compute microvm console <paused-id> shows Resuming then Connected
  • Manual: pipe without TTY fails with the new message

Made with Cursor

Print Connecting/Resuming/Connected on stderr so a paused MicroVM no longer
looks stuck, fail fast when stdin is not a TTY, and map idle/max-duration
server closes to exit 0 with plain messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread commands/microvms.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These land after we put the terminal in raw mode, so \n alone can leave the cursor mid-line. Can we use \r\n here?

Comment thread commands/microvms.go
Comment on lines +656 to +657
case "idle_timeout":
fmt.Fprintln(os.Stderr, "console closed: no activity for 30 minutes")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding “30 minutes” could become inaccurate if the server idle limit is configurable.
Can we use message when it’s non-empty, or fall back to a generic “idle timeout reached”?

Comment thread commands/microvms.go
Comment on lines +659 to +660

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, avoid hardcoding “4 hour”, use the server message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants