MCPcopy Create free account
hub / github.com/ephraimduncan/opencode-cursor / evictStaleConversations

Function evictStaleConversations

src/proxy.ts:160–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

158const CONVERSATION_TTL_MS = 30 * 60 * 1000; // 30 minutes
159
160function evictStaleConversations(): void {
161 const now = Date.now();
162 for (const [key, stored] of conversationStates) {
163 if (now - stored.lastAccessMs > CONVERSATION_TTL_MS) {
164 conversationStates.delete(key);
165 }
166 }
167}
168
169/** Length-prefix a message: [4-byte BE length][payload] */
170function lpEncode(data: Uint8Array): Buffer {

Callers 1

handleChatCompletionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected