Skip to content

Commit 0bcddb3

Browse files
authored
iOS: reconnect gateway on foreground return (#41384)
Merged via squash. Prepared head SHA: 0e2e0dc Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
1 parent d86647d commit 0bcddb3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Docs: https://docs.openclaw.ai
2121
- ACP/stop reason mapping: resolve gateway chat `state: "error"` completions as ACP `end_turn` instead of `refusal` so transient backend failures are not surfaced as deliberate refusals. (#41187) thanks @pejmanjohn.
2222
- ACP/setSessionMode: propagate gateway `sessions.patch` failures back to ACP clients so rejected mode changes no longer return silent success. (#41185) thanks @pejmanjohn.
2323
- Agents/embedded logs: add structured, sanitized lifecycle and failover observation events so overload and provider failures are easier to tail and filter. (#41336) thanks @altaywtf.
24+
- iOS/gateway foreground recovery: reconnect immediately on foreground return after stale background sockets are torn down, so the app no longer stays disconnected until a later wake path happens. (#41384) Thanks @mbelinky.
2425

2526
## 2026.3.8
2627

apps/ios/Sources/Model/NodeAppModel.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,14 @@ final class NodeAppModel {
362362
await MainActor.run {
363363
self.operatorConnected = false
364364
self.gatewayConnected = false
365+
// Foreground recovery must actively restart the saved gateway config.
366+
// Disconnecting stale sockets alone can leave us idle if the old
367+
// reconnect tasks were suppressed or otherwise got stuck in background.
368+
self.gatewayStatusText = "Reconnecting…"
365369
self.talkMode.updateGatewayConnected(false)
370+
if let cfg = self.activeGatewayConnectConfig {
371+
self.applyGatewayConnectConfig(cfg)
372+
}
366373
}
367374
}
368375
}

0 commit comments

Comments
 (0)