@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.
@@ -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
- // Reuse deviceType from extraParams instead of calling getCurrentSessionContext()
493
- // again (which may be ambiguous in multi-session or async scenarios).
494
- const deviceType = ctx.extraParams?.[DEVICE_TYPE_KEY] || undefined;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.98-next",
3
+ "version": "0.0.99-next",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",