Skip to content

The agent that grows with you

fix(desktop): restore stale-branch-reverted main.ts/update files; detach post-switch profile refresh from switch completion

Teknium5a285d34368e
diff --git a/apps/desktop/src/app/chat/session-tile-actions.ts b/apps/desktop/src/app/chat/session-tile-actions.ts
index 056bb99b598..8e916412181 100644
--- a/apps/desktop/src/app/chat/session-tile-actions.ts
+++ b/apps/desktop/src/app/chat/session-tile-actions.ts
@@ -22,7 +22,7 @@ import { resetSessionBackground } from '@/store/composer-status'
import { notifyError } from '@/store/notifications'
import { clearPreviewArtifacts } from '@/store/preview-status'
import { clearAllPrompts } from '@/store/prompts'
-import { $connection, $sessions, knownSessionOwner, sessionMatchesStoredId } from '@/store/session'
+import { $sessions, knownSessionOwner, sessionMatchesStoredId } from '@/store/session'
import {
requestForSessionProfile,
type SessionOwnerScope,
diff --git a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
index 52b6cefaedc..10d43d99e84 100644
--- a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
+++ b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
@@ -568,14 +568,17 @@ export function useGatewayBoot({
// re-pulls /api/profiles deterministically post-switch — leaving the
// rail stale or (if a stale in-flight response landed) collapsed
// (#85731). Best-effort like the rest: a failure keeps the cached
- // list rather than blanking the rail.
+ // list rather than blanking the rail. NOT awaited: refreshProfiles
+ // now carries a bounded retry chain (#70679), and switch completion
+ // must not wait out backoff timers against an unhealthy backend.
if (!(await adoptPrimaryProfile(ownsSwitch)) || !ownsSwitch()) {
return
}
+ void refreshActiveProfile().catch(() => undefined)
+
await Promise.all([
seedDefaultCwd(ownsSwitch),
- refreshActiveProfile().catch(() => undefined),
callbacksRef.current.refreshHermesConfig(false, ownsSwitch).catch(() => undefined),
callbacksRef.current.refreshSessions(ownsSwitch).catch(() => undefined)
])