Files
openclaw/apps/macos/Sources/OpenClaw/OnboardingGatewayAuthBlocker.swift
Peter Steinberger 2472782622 fix(macos): gate remote onboarding on gateway auth (#117904)
* fix(macos): gate remote onboarding on gateway auth

* fix(macos): address onboarding CI failures

* test(macos): stabilize gateway auth routing coverage

* fix(macos): bound remote gateway onboarding probe

* fix(macos): satisfy remote probe CI guards

* fix(macos): scope remote probe cleanup ownership

* refactor(macos): remove unused health snapshot wrapper
2026-08-02 04:14:54 -07:00

56 lines
2.0 KiB
Swift

extension OnboardingAISetupModel {
enum ConfiguredGatewayBlocker: Equatable {
case unavailable
case authentication(RemoteGatewayAuthIssue)
}
var configuredGatewayProbeUnavailable: Bool {
self.configuredGatewayBlocker == .unavailable
}
var configuredGatewayAuthIssue: RemoteGatewayAuthIssue? {
guard case let .authentication(issue) = self.configuredGatewayBlocker else { return nil }
return issue
}
func showConfiguredGatewayProbeUnavailable() {
guard !self.ownsInferenceTransition ||
self.configuredGatewayBlocker != nil ||
self.waitingForPendingActivationDeadline
else { return }
// Retire stale candidates and `started` state. A later successful
// missing-model probe must be able to run a fresh detect/activate flow.
self.resetForGatewayChange(clearPendingHandoff: false)
self.updateConfiguredGatewayBlockerState(
.unavailable,
phase: .ready,
detectError: Failure(
summary: "The Gateway did not answer the inference check. Nothing was changed.",
detail: nil))
}
func showConfiguredGatewayAuthIssue(_ issue: RemoteGatewayAuthIssue) {
guard !self.ownsInferenceTransition ||
self.configuredGatewayBlocker != nil ||
self.waitingForPendingActivationDeadline
else { return }
self.enterGatewayAuthBlocker(issue)
}
func beginConfiguredGatewayProbeRetry() {
guard self.configuredGatewayBlocker != nil else { return }
self.updateConfiguredGatewayBlockerState(
self.configuredGatewayBlocker,
phase: .detecting,
detectError: nil)
}
func enterGatewayAuthBlocker(_ issue: RemoteGatewayAuthIssue) {
self.resetForGatewayChange(clearPendingHandoff: false)
self.updateConfiguredGatewayBlockerState(
.authentication(issue),
phase: .ready,
detectError: nil)
}
}