fix(macos): await-safe session key selection
This commit is contained in:
@@ -291,9 +291,13 @@ actor TalkModeRuntime {
|
|||||||
await self.reloadConfig()
|
await self.reloadConfig()
|
||||||
guard self.isCurrent(gen) else { return }
|
guard self.isCurrent(gen) else { return }
|
||||||
let prompt = self.buildPrompt(transcript: transcript)
|
let prompt = self.buildPrompt(transcript: transcript)
|
||||||
let sessionKey =
|
let activeSessionKey = await MainActor.run { WebChatManager.shared.activeSessionKey }
|
||||||
await MainActor.run { WebChatManager.shared.activeSessionKey } ??
|
let sessionKey: String
|
||||||
await GatewayConnection.shared.mainSessionKey()
|
if let activeSessionKey {
|
||||||
|
sessionKey = activeSessionKey
|
||||||
|
} else {
|
||||||
|
sessionKey = await GatewayConnection.shared.mainSessionKey()
|
||||||
|
}
|
||||||
let runId = UUID().uuidString
|
let runId = UUID().uuidString
|
||||||
let startedAt = Date().timeIntervalSince1970
|
let startedAt = Date().timeIntervalSince1970
|
||||||
self.logger.info(
|
self.logger.info(
|
||||||
|
|||||||
Reference in New Issue
Block a user