Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- support for configuring the SSH connection timeout, defaults to 10 seconds

### Fixed

- environment actions failing after URI execution by refreshing http client and CLI references

## 0.8.4 - 2026-01-20

### Fixed
Expand Down
14 changes: 10 additions & 4 deletions src/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ private val POLL_INTERVAL = 5.seconds
*/
class CoderRemoteEnvironment(
private val context: CoderToolboxContext,
private val client: CoderRestClient,
private val cli: CoderCLIManager,
internal var client: CoderRestClient,
internal var cli: CoderCLIManager,
private var workspace: Workspace,
private var agent: WorkspaceAgent,
) : RemoteProviderEnvironment("${workspace.name}.${agent.name}"), BeforeConnectionHook, AfterDisconnectHook {
Expand Down Expand Up @@ -351,8 +351,6 @@ class CoderRemoteEnvironment(
}
}

fun isConnected(): Boolean = isConnected.value

/**
* An environment is equal if it has the same ID.
*/
Expand All @@ -371,4 +369,12 @@ class CoderRemoteEnvironment(
override fun toString(): String {
return "CoderRemoteEnvironment(name='$name')"
}

/**
* Update the client and CLI manager for this environment.
*/
fun updateClientAndCli(client: CoderRestClient, cli: CoderCLIManager) {
this.client = client
this.cli = cli
}
}
2 changes: 2 additions & 0 deletions src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ class CoderRemoteProvider(
}
this.client = newRestClient
this.cli = newCli
lastEnvironments.forEach { it.updateClientAndCli(newRestClient, newCli) }
pollJob = poll(newRestClient, newCli)
context.logger.info("Workspace poll job with name ${pollJob.toString()} was created while handling URI")
return newRestClient to newCli
Expand Down Expand Up @@ -521,6 +522,7 @@ class CoderRemoteProvider(
}
this.client = client
this.cli = cli
lastEnvironments.forEach { it.updateClientAndCli(client, cli) }
environments.showLoadingMessage()
if (context.settingsStore.useAppNameAsTitle) {
context.logger.info("Displaying ${client.appName} as main page title")
Expand Down
Loading