@ynhcj/xiaoyi-channel 0.0.115-beta → 0.0.117-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 +4 -4
- package/openclaw.plugin.json +22 -0
- package/package.json +1 -1
package/dist/src/provider.js
CHANGED
|
@@ -158,14 +158,13 @@ function createRetryingStream(createStream, cronJob) {
|
|
|
158
158
|
}
|
|
159
159
|
if (event.type === "error") {
|
|
160
160
|
console.log(`[xiaoyiprovider] stream error after content: ${event.error?.errorMessage}`);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return;
|
|
161
|
+
errorResult = event.error;
|
|
162
|
+
break; // break inner loop, proceed to retry decision
|
|
164
163
|
}
|
|
165
164
|
yield event;
|
|
166
165
|
}
|
|
167
166
|
}
|
|
168
|
-
// Stream ended
|
|
167
|
+
// Stream ended (buffer or streaming phase) — decide whether to retry
|
|
169
168
|
if (errorResult?.stopReason === "error" && isRetryableProviderError(errorResult.errorMessage)) {
|
|
170
169
|
if (attempt < MAX_RETRY_ATTEMPTS - 1) {
|
|
171
170
|
const delayMs = getRetryDelayMs(attempt + 1, cronJob);
|
|
@@ -192,6 +191,7 @@ function createRetryingStream(createStream, cronJob) {
|
|
|
192
191
|
}
|
|
193
192
|
if (errorResult && buffer.every(b => b.type !== "done" && b.type !== "error")) {
|
|
194
193
|
resultResolve(errorResult);
|
|
194
|
+
yield { type: "error", reason: "error", error: errorResult };
|
|
195
195
|
}
|
|
196
196
|
return;
|
|
197
197
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -7,5 +7,27 @@
|
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|
|
9
9
|
"properties": {}
|
|
10
|
+
},
|
|
11
|
+
"channelConfigs": {
|
|
12
|
+
"xiaoyi-channel": {
|
|
13
|
+
"schema": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"properties": {
|
|
16
|
+
"enabled": { "type": "boolean", "description": "Enable/disable the XY channel", "default": false },
|
|
17
|
+
"wsUrl1": { "type": "string", "description": "Primary WebSocket URL" },
|
|
18
|
+
"wsUrl2": { "type": "string", "description": "Secondary WebSocket URL" },
|
|
19
|
+
"apiKey": { "type": "string", "description": "API key for authentication" },
|
|
20
|
+
"uid": { "type": "string", "description": "User ID for file upload" },
|
|
21
|
+
"agentId": { "type": "string", "description": "Agent ID for this bot instance" },
|
|
22
|
+
"apiId": { "type": "string", "description": "API ID for push messages" },
|
|
23
|
+
"pushId": { "type": "string", "description": "Push ID for push messages" },
|
|
24
|
+
"fileUploadUrl": { "type": "string", "description": "Base URL for file upload service" },
|
|
25
|
+
"pushUrl": { "type": "string", "description": "URL for push message service" }
|
|
26
|
+
},
|
|
27
|
+
"required": ["apiKey", "agentId", "uid", "apiId", "pushId"]
|
|
28
|
+
},
|
|
29
|
+
"label": "Xiaoyi Channel",
|
|
30
|
+
"description": "Xiaoyi A2A protocol integration"
|
|
31
|
+
}
|
|
10
32
|
}
|
|
11
33
|
}
|