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

Function deterministicConversationId

src/proxy.ts:1133–1146  ·  view source on GitHub ↗

Deterministic UUID derived from convKey so Cursor's server-side conversation * persists across proxy restarts. Formats 16 bytes of SHA-256 as a v4-shaped UUID.

(convKey: string)

Source from the content-addressed store, hash-verified

1131/** Deterministic UUID derived from convKey so Cursor's server-side conversation
1132 * persists across proxy restarts. Formats 16 bytes of SHA-256 as a v4-shaped UUID. */
1133function deterministicConversationId(convKey: string): string {
1134 const hex = createHash("sha256")
1135 .update(`cursor-conv-id:${convKey}`)
1136 .digest("hex")
1137 .slice(0, 32);
1138 // Format as UUID: xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx
1139 return [
1140 hex.slice(0, 8),
1141 hex.slice(8, 12),
1142 `4${hex.slice(13, 16)}`,
1143 `${(0x8 | (parseInt(hex[16], 16) & 0x3)).toString(16)}${hex.slice(17, 20)}`,
1144 hex.slice(20, 32),
1145 ].join("-");
1146}
1147
1148/** Create an SSE streaming Response that reads from a live bridge. */
1149function createBridgeStreamResponse(

Callers 1

handleChatCompletionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected