@ynhcj/xiaoyi-channel 0.0.98-next → 0.0.99-next
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 +7 -3
- package/package.json +1 -1
package/dist/src/provider.js
CHANGED
|
@@ -489,9 +489,13 @@ export const xiaoyiProvider = {
|
|
|
489
489
|
if (context.systemPrompt) {
|
|
490
490
|
console.log(`[xiaoyiprovider] system prompt length: ${context.systemPrompt.length}`);
|
|
491
491
|
}
|
|
492
|
-
//
|
|
493
|
-
//
|
|
494
|
-
|
|
492
|
+
// Prefer deviceType from extraParams (set by prepareExtraParams).
|
|
493
|
+
// Fall back to getCurrentSessionContext() because OpenClaw caches
|
|
494
|
+
// resolvePreparedExtraParams by provider/modelId – the cache key does
|
|
495
|
+
// not include session-specific data, so deviceType may be missing
|
|
496
|
+
// from the cached extraParams even when a session is active.
|
|
497
|
+
const extraParamsDeviceType = ctx.extraParams?.[DEVICE_TYPE_KEY] || undefined;
|
|
498
|
+
const deviceType = extraParamsDeviceType ?? getCurrentSessionContext()?.deviceType;
|
|
495
499
|
// 在发送给模型前,优化 systemPrompt 结构
|
|
496
500
|
if (context.systemPrompt) {
|
|
497
501
|
let sp = context.systemPrompt;
|