@ynhcj/xiaoyi-channel 0.0.178-beta → 0.0.180-beta
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/src/provider.js
CHANGED
|
@@ -436,7 +436,7 @@ export const xiaoyiProvider = {
|
|
|
436
436
|
reasoning: false,
|
|
437
437
|
input: ["text"],
|
|
438
438
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
439
|
-
contextWindow:
|
|
439
|
+
contextWindow: 256_000,
|
|
440
440
|
maxTokens: 8192,
|
|
441
441
|
...(ctx.providerConfig?.headers && typeof ctx.providerConfig.headers === "object"
|
|
442
442
|
? { headers: ctx.providerConfig.headers }
|
|
@@ -64,9 +64,17 @@ export function registerSession(sessionKey, context) {
|
|
|
64
64
|
setLastRegisteredKey(sessionKey);
|
|
65
65
|
const existing = activeSessions.get(sessionKey);
|
|
66
66
|
if (existing) {
|
|
67
|
-
//
|
|
67
|
+
// 更新上下文(全量同步所有字段,避免 global Map 残留旧值,
|
|
68
|
+
// 当 ALS 丢失回退到 Map 时拿到过期的 modelName / deviceType)
|
|
69
|
+
existing.config = context.config;
|
|
70
|
+
existing.sessionId = context.sessionId;
|
|
71
|
+
existing.distributionSessionId = context.distributionSessionId;
|
|
68
72
|
existing.taskId = context.taskId;
|
|
69
73
|
existing.messageId = context.messageId;
|
|
74
|
+
existing.agentId = context.agentId;
|
|
75
|
+
existing.deviceType = context.deviceType;
|
|
76
|
+
existing.modelName = context.modelName;
|
|
77
|
+
existing.runCrossTaskContext = context.runCrossTaskContext;
|
|
70
78
|
existing.refCount++;
|
|
71
79
|
existing.createdAt = Date.now(); // 刷新存活时间,长对话不受 TTL 影响
|
|
72
80
|
}
|