@jeffreycao/copilot-api 2.1.7 → 2.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -25,7 +25,7 @@ bindElectronFetch();
25
25
  const { auth } = await import("./auth-t5Gi1JB9.js");
26
26
  const { debug } = await import("./debug-2GkXJBt5.js");
27
27
  const { mcp } = await import("./mcp-BG6fpi6q.js");
28
- const { start } = await import("./start-D5W3xtWv.js");
28
+ const { start } = await import("./start-CnK6t2pl.js");
29
29
  await runMain(defineCommand({
30
30
  meta: {
31
31
  name: "copilot-api",
@@ -3458,7 +3458,9 @@ function translateToOpenAI(payload, options = {}) {
3458
3458
  const model = state.models?.data.find((m) => m.id === modelId);
3459
3459
  const thinkingBudget = getThinkingBudget(payload, model);
3460
3460
  const reasoningEffort = getReasoningEffort(payload, options);
3461
- const promptCacheKey = requestContext.getStore()?.sessionAffinity?.trim();
3461
+ const { sessionId: metadataPromptCacheKey } = parseUserIdMetadata(payload.metadata?.user_id);
3462
+ const sessionAffinity = requestContext.getStore()?.sessionAffinity?.trim() || null;
3463
+ const promptCacheKey = metadataPromptCacheKey ?? sessionAffinity;
3462
3464
  return {
3463
3465
  model: modelId,
3464
3466
  messages: translateAnthropicMessagesToOpenAI(payload, modelId, {
@@ -10433,4 +10435,4 @@ server.route("/:provider/images", providerImageRoutes);
10433
10435
  //#endregion
10434
10436
  export { server };
10435
10437
 
10436
- //# sourceMappingURL=server-s6RzK7Oo.js.map
10438
+ //# sourceMappingURL=server-TnE0V9Un.js.map