Skip to content

Commit 0bdd3ff

Browse files
committed
fix: resiliency when workspace agent is not ready
1 parent d885c60 commit 0bdd3ff

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/main/kotlin/com/coder/toolbox/util/CoderProtocolHandler.kt

+4-13
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,10 @@ open class CoderProtocolHandler(
128128
val agent = getMatchingAgent(params, workspace)
129129
val status = WorkspaceAndAgentStatus.from(workspace, agent)
130130

131-
if (status.pending()) {
132-
// TODO: Wait for the agent to be ready.
133-
throw IllegalArgumentException(
134-
"The agent \"${agent.name}\" has a status of \"${
135-
status.toString().lowercase()
136-
}\"; please wait then try again",
137-
)
138-
} else if (!status.ready()) {
139-
throw IllegalArgumentException(
140-
"The agent \"${agent.name}\" has a status of \"${
141-
status.toString().lowercase()
142-
}\"; unable to connect"
143-
)
131+
if (!status.ready()) {
132+
context.logger.error("Agent ${agent.name} for workspace $workspaceName from $deploymentURL is not started")
133+
context.showErrorPopup(MissingArgumentException("Can't handle URI because agent ${agent.name} for workspace $workspaceName from $deploymentURL is not started"))
134+
return
144135
}
145136

146137
val cli =

0 commit comments

Comments
 (0)