@@ -28,34 +28,36 @@ enum class WorkspaceAndAgentStatus(val label: String, val description: String) {
2828 CONNECTING (" ⦿ Connecting" , " The agent is connecting." ),
2929 DISCONNECTED (" ⦸ Disconnected" , " The agent has disconnected." ),
3030 TIMEOUT (" ⓧ Timeout" , " The agent has timed out." ),
31- AGENT_STARTING (" ⦿ Starting" , " The agent is running the startup script ." ),
32- AGENT_STARTING_READY (" ⦿ Starting" , " The agent is running the startup script but is ready to accept connections." ),
31+ AGENT_STARTING (" ⦿ Starting" , " The startup script is running." ),
32+ AGENT_STARTING_READY (" ⦿ Starting" , " The startup script is still running but the agent is ready to accept connections." ),
3333 CREATED (" ⦿ Created" , " The agent has been created." ),
3434 START_ERROR (" ◍ Started with error" , " The agent is ready but the startup script errored." ),
35- START_TIMEOUT (" ◍ Started with timeout" , " The agent is ready but the startup script timed out" ),
35+ START_TIMEOUT (" ◍ Starting" , " The startup script is taking longer than expected." ),
36+ START_TIMEOUT_READY (" ◍ Starting" , " The startup script is taking longer than expected but the agent is ready to accept connections." ),
3637 SHUTTING_DOWN (" ◍ Shutting down" , " The agent is shutting down." ),
3738 SHUTDOWN_ERROR (" ⦸ Shutdown with error" , " The agent shut down but the shutdown script errored." ),
38- SHUTDOWN_TIMEOUT (" ⦸ Shutdown with timeout " , " The agent shut down but the shutdown script timed out ." ),
39+ SHUTDOWN_TIMEOUT (" ⦸ Shutting down " , " The shutdown script is taking longer than expected ." ),
3940 OFF (" ⦸ Off" , " The agent has shut down." ),
4041 READY (" ⦿ Ready" , " The agent is ready to accept connections." );
4142
4243 fun statusColor (): JBColor = when (this ) {
43- READY , AGENT_STARTING_READY -> JBColor .GREEN
44- START_ERROR , START_TIMEOUT -> JBColor .YELLOW
45- FAILED , DISCONNECTED , TIMEOUT , SHUTTING_DOWN , SHUTDOWN_ERROR , SHUTDOWN_TIMEOUT -> JBColor .RED
44+ READY , AGENT_STARTING_READY , START_TIMEOUT_READY -> JBColor .GREEN
45+ START_ERROR , START_TIMEOUT , SHUTDOWN_TIMEOUT -> JBColor .YELLOW
46+ FAILED , DISCONNECTED , TIMEOUT , SHUTDOWN_ERROR -> JBColor .RED
4647 else -> if (JBColor .isBright()) JBColor .LIGHT_GRAY else JBColor .DARK_GRAY
4748 }
4849
4950 // We want to check that the workspace is `running`, the agent is
5051 // `connected`, and the agent lifecycle state is `ready` to ensure the best
5152 // possible scenario for attempting a connection.
5253 //
53- // We can also choose to allow `start_timeout` and ` start_error` for the
54- // agent state; this means the startup script did not successfully complete
55- // but the agent will accept SSH connections.
54+ // We can also choose to allow `start_error` for the agent lifecycle state;
55+ // this means the startup script did not successfully complete but the agent
56+ // will still accept SSH connections.
5657 //
5758 // Lastly we can also allow connections when the agent lifecycle state is
58- // `starting` if `login_before_ready` is true on the workspace response.
59+ // `starting` or `start_timeout` if `login_before_ready` is true on the
60+ // workspace response since this bypasses the need to wait for the script.
5961 //
6062 // Note that latest_build.status is derived from latest_build.job.status and
6163 // latest_build.job.transition so there is no need to check those.
@@ -67,7 +69,7 @@ enum class WorkspaceAndAgentStatus(val label: String, val description: String) {
6769 WorkspaceAgentStatus .CONNECTED -> when (agent.lifecycleState) {
6870 WorkspaceAgentLifecycleState .CREATED -> CREATED
6971 WorkspaceAgentLifecycleState .STARTING -> if (agent.loginBeforeReady == true ) AGENT_STARTING_READY else AGENT_STARTING
70- WorkspaceAgentLifecycleState .START_TIMEOUT -> START_TIMEOUT
72+ WorkspaceAgentLifecycleState .START_TIMEOUT -> if (agent.loginBeforeReady == true ) START_TIMEOUT_READY else START_TIMEOUT
7173 WorkspaceAgentLifecycleState .START_ERROR -> START_ERROR
7274 WorkspaceAgentLifecycleState .READY -> READY
7375 WorkspaceAgentLifecycleState .SHUTTING_DOWN -> SHUTTING_DOWN
0 commit comments