fix: use canonical main session keys in apps

This commit is contained in:
Peter Steinberger
2026-01-15 08:57:08 +00:00
parent 5f87f7bbf5
commit b77b47bb98
25 changed files with 294 additions and 64 deletions

View File

@@ -5,4 +5,11 @@ enum SessionKey {
let trimmed = (raw ?? "").trimmingCharacters(in: .whitespacesAndNewlines)
return trimmed.isEmpty ? "main" : trimmed
}
static func isCanonicalMainSessionKey(_ value: String?) -> Bool {
let trimmed = (value ?? "").trimmingCharacters(in: .whitespacesAndNewlines)
if trimmed.isEmpty { return false }
if trimmed == "global" { return true }
return trimmed.hasPrefix("agent:")
}
}