@ynhcj/xiaoyi-channel 0.0.206-beta → 0.0.207-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.
@@ -126,14 +126,27 @@ export const xyPlugin = {
126
126
  ? { conversationId, matchPriority: 2 }
127
127
  : null;
128
128
  },
129
- resolveCommandConversation: ({ accountId }) => {
129
+ resolveCommandConversation: ({ accountId, sessionKey }) => {
130
130
  // xiaoyi-channel: the A2A sessionId IS the conversationId.
131
- // Read from the current ALS session context.
131
+ // 1. Prefer the current ALS session context (works when the command
132
+ // is processed inside an active A2A message-handling turn).
132
133
  const ctx = getCurrentSessionContext();
133
- const sessionId = ctx?.sessionId?.trim();
134
- if (!sessionId)
135
- return null;
136
- return { conversationId: sessionId };
134
+ const alsSessionId = ctx?.sessionId?.trim();
135
+ if (alsSessionId)
136
+ return { conversationId: alsSessionId };
137
+ // 2. Fall back to parsing the session key. For xiaoyi-channel the
138
+ // session key has the form:
139
+ // agent:<agentId>:xiaoyi-channel:<accountId>:<sessionId>
140
+ // The last `:`-delimited segment is the A2A sessionId.
141
+ if (sessionKey) {
142
+ const lastColon = sessionKey.lastIndexOf(":");
143
+ if (lastColon >= 0) {
144
+ const sessionId = sessionKey.slice(lastColon + 1).trim();
145
+ if (sessionId)
146
+ return { conversationId: sessionId };
147
+ }
148
+ }
149
+ return null;
137
150
  },
138
151
  },
139
152
  reload: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.206-beta",
3
+ "version": "0.0.207-beta",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",