mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 18:57:27 +00:00
Core: update shared gateway models
This commit is contained in:
@@ -428,9 +428,7 @@ public actor GatewayChannelActor {
|
||||
guard let self else { return }
|
||||
await self.watchTicks()
|
||||
}
|
||||
if let pushHandler = self.pushHandler {
|
||||
Task { await pushHandler(.snapshot(ok)) }
|
||||
}
|
||||
await self.pushHandler?(.snapshot(ok))
|
||||
}
|
||||
|
||||
private func listen() {
|
||||
|
||||
@@ -16,7 +16,6 @@ public actor GatewayNodeSession {
|
||||
private let logger = Logger(subsystem: "ai.openclaw", category: "node.gateway")
|
||||
private let decoder = JSONDecoder()
|
||||
private let encoder = JSONEncoder()
|
||||
private static let defaultInvokeTimeoutMs = 30_000
|
||||
private var channel: GatewayChannelActor?
|
||||
private var activeURL: URL?
|
||||
private var activeToken: String?
|
||||
@@ -36,8 +35,8 @@ public actor GatewayNodeSession {
|
||||
) async -> BridgeInvokeResponse {
|
||||
let timeoutLogger = Logger(subsystem: "ai.openclaw", category: "node.gateway")
|
||||
let timeout: Int = {
|
||||
if let timeoutMs { return max(0, timeoutMs) }
|
||||
return Self.defaultInvokeTimeoutMs
|
||||
guard let timeoutMs else { return 0 }
|
||||
return max(0, timeoutMs)
|
||||
}()
|
||||
guard timeout > 0 else {
|
||||
return await onInvoke(request)
|
||||
@@ -154,8 +153,10 @@ public actor GatewayNodeSession {
|
||||
|
||||
do {
|
||||
try await channel.connect()
|
||||
_ = await self.waitForSnapshot(timeoutMs: 500)
|
||||
await self.notifyConnectedIfNeeded()
|
||||
let snapshotReady = await self.waitForSnapshot(timeoutMs: 500)
|
||||
if snapshotReady {
|
||||
await self.notifyConnectedIfNeeded()
|
||||
}
|
||||
} catch {
|
||||
await onDisconnected(error.localizedDescription)
|
||||
throw error
|
||||
|
||||
@@ -73,6 +73,11 @@ public final class GatewayTLSPinningSession: NSObject, WebSocketSessioning, URLS
|
||||
if let expected {
|
||||
if fingerprint == expected {
|
||||
completionHandler(.useCredential, URLCredential(trust: trust))
|
||||
} else if params.allowTOFU {
|
||||
if let storeKey = params.storeKey {
|
||||
GatewayTLSStore.saveFingerprint(fingerprint, stableID: storeKey)
|
||||
}
|
||||
completionHandler(.useCredential, URLCredential(trust: trust))
|
||||
} else {
|
||||
completionHandler(.cancelAuthenticationChallenge, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user