-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(cli/cliui): skip startup script logs when Wait=false #21105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a05caf2 to
92fa5b1
Compare
3ce5d2a to
38d9973
Compare
92fa5b1 to
73bd961
Compare
38d9973 to
65329a5
Compare
73bd961 to
380b15b
Compare
65329a5 to
9c77fcd
Compare
380b15b to
4ffc13f
Compare
9c77fcd to
cc5cf9a
Compare
4ffc13f to
1463cd8
Compare
cc5cf9a to
48a735a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses issue #13580 by suppressing startup script logs when users explicitly set Wait=false (via --wait=no or CODER_SSH_WAIT=no). This prevents SSH operations like rsync and scp from dumping hundreds of lines of logs to stderr, which was breaking scriptability.
Key Changes:
- Modified
handleConnectedto only callstreamLogswhenWait=true, preventing log output in non-blocking mode - Stage indicators and warning messages are still displayed, only the log content is suppressed
- Added comprehensive test coverage for the new non-blocking behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cli/cliui/agent.go | Added conditional logic to skip streamLogs when Wait=false, suppressing log output while maintaining stage indicators and warnings |
| cli/cliui/agent_test.go | Added two new test cases verifying logs are suppressed in non-blocking mode, both when agent is already connected and after waiting for connection |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📚 Documentation Check✨ No Changes NeededThis PR is an internal refactoring that improves code organization without changing user-facing behavior. The changes:
User-facing behavior remains unchanged:
The existing documentation in This comment was generated by an AI Agent through Coder Tasks |
| return agent.LifecycleState.Starting() | ||
| }) | ||
| if err != nil { | ||
| return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we will call pollWhite in a few places, should wrap these errors?
When users pass --wait=no or set CODER_SSH_WAIT=no, startup logs are no longer dumped to stderr. The stage indicator is still shown, just not the log content. Fixes #13580
48a735a to
6d43efd
Compare
When users pass
--wait=noor setCODER_SSH_WAIT=no, startup logs are no longer dumped to stderr. The stage indicator is still shown, just not the log content.This addresses the issue where SSH operations like rsync and scp would dump hundreds of lines of startup logs, breaking scriptability.
Depends on #21104
Fixes #13580
Examples of output when using no wait:
Early attach:
During startup:
After startup (still shows warning, but no logs):