blob: 8029757c5b61adbab7c36988db34b47202f2767f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { Resource } from "@opencode-ai/console-resource"
export function createStickyTracker(stickyProvider: "strict" | "prefer" | undefined, session: string) {
if (!stickyProvider) return
if (!session) return
const key = `sticky:${session}`
return {
get: async () => {
return await Resource.GatewayKv.get(key)
},
set: async (providerId: string) => {
await Resource.GatewayKv.put(key, providerId, { expirationTtl: 86400 })
},
}
}
|