@@ -54,7 +54,7 @@ enum class WorkspaceAndAgentStatus(val icon: Icon, val label: String, val descri
5454 fun statusColor (): JBColor =
5555 when (this ) {
5656 READY , AGENT_STARTING_READY , START_TIMEOUT_READY -> JBColor .GREEN
57- START_ERROR , START_TIMEOUT , SHUTDOWN_TIMEOUT -> JBColor .YELLOW
57+ CREATED , START_ERROR , START_TIMEOUT , SHUTDOWN_TIMEOUT -> JBColor .YELLOW
5858 FAILED , DISCONNECTED , TIMEOUT , SHUTDOWN_ERROR -> JBColor .RED
5959 else -> if (JBColor .isBright()) JBColor .LIGHT_GRAY else JBColor .DARK_GRAY
6060 }
@@ -63,15 +63,21 @@ enum class WorkspaceAndAgentStatus(val icon: Icon, val label: String, val descri
6363 * Return true if the agent is in a connectable state.
6464 */
6565 fun ready (): Boolean {
66- return listOf (READY , START_ERROR , AGENT_STARTING_READY , START_TIMEOUT_READY )
66+ // It seems that the agent can get stuck in a `created` state if the
67+ // workspace is updated and the agent is restarted (presumably because
68+ // lifecycle scripts are not running again). This feels like either a
69+ // Coder or template bug, but `coder ssh` and the VS Code plugin will
70+ // still connect so do the same here to not be the odd one out.
71+ return listOf (READY , START_ERROR , AGENT_STARTING_READY , START_TIMEOUT_READY , CREATED )
6772 .contains(this )
6873 }
6974
7075 /* *
7176 * Return true if the agent might soon be in a connectable state.
7277 */
7378 fun pending (): Boolean {
74- return listOf (CONNECTING , TIMEOUT , CREATED , AGENT_STARTING , START_TIMEOUT )
79+ // See ready() for why `CREATED` is not in this list.
80+ return listOf (CONNECTING , TIMEOUT , AGENT_STARTING , START_TIMEOUT )
7581 .contains(this )
7682 }
7783
0 commit comments