Skip to content

Commit 2eaaa53

Browse files
Jacksondr5claude
andcommitted
fix(web): Reconnect on a switched-off environment switches it back on
After Disconnect server switches an environment off, its thread's banner offers Reconnect, which only retried the connection and did nothing while the environment stayed switched off. Reconnect now switches it back on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 8045537 commit 2eaaa53

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/web/src/components/chat/useSystemComposerBanners.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ export function useSystemComposerBanners(input: SystemComposerBannersInput) {
105105
);
106106
}, [activeReconnectingEnvironmentId]);
107107
const handleReconnectActiveEnvironment = async (environmentId: EnvironmentId) => {
108-
const result = await retryEnvironment(environmentId);
108+
// A retry does nothing while the environment is switched off.
109+
const result =
110+
activeEnvironment?.entry.enabled === false
111+
? await setEnvironmentEnabled({ environmentId, enabled: true })
112+
: await retryEnvironment(environmentId);
109113
if (result._tag === "Failure" && !isAtomCommandInterrupted(result)) {
110114
const error = squashAtomCommandFailure(result);
111115
toastManager.add(

0 commit comments

Comments
 (0)