Skip to content

Commit e5871b6

Browse files
Jacksondr5claude
andauthored
fix(web): Reconnect on a switched-off environment switches it back on (#24691)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent f5bc64b commit e5871b6

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
@@ -84,7 +84,11 @@ export function useSystemComposerBanners(input: SystemComposerBannersInput) {
8484
ENVIRONMENT_RECONNECT_WARNING_GRACE_MS,
8585
);
8686
const handleReconnectActiveEnvironment = async (environmentId: EnvironmentId) => {
87-
const result = await retryEnvironment(environmentId);
87+
// A retry does nothing while the environment is switched off.
88+
const result =
89+
activeEnvironment?.entry.enabled === false
90+
? await setEnvironmentEnabled({ environmentId, enabled: true })
91+
: await retryEnvironment(environmentId);
8892
if (result._tag === "Failure" && !isAtomCommandInterrupted(result)) {
8993
const error = squashAtomCommandFailure(result);
9094
toastManager.add(

0 commit comments

Comments
 (0)