@serii84/vertex-partner-provider 1.0.24 → 1.0.26
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/index.js +7 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Vertex Partner Provider for OpenCode
|
|
3
|
-
* v1.0.
|
|
3
|
+
* v1.0.26 - Don't forward [DONE] signal
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const fs = require('fs');
|
|
@@ -123,7 +123,8 @@ function transformStream(response) {
|
|
|
123
123
|
const data = message.slice(6);
|
|
124
124
|
|
|
125
125
|
if (data === '[DONE]') {
|
|
126
|
-
|
|
126
|
+
debugLog('Received [DONE], not forwarding');
|
|
127
|
+
// Don't forward [DONE] - just let the stream end naturally
|
|
127
128
|
continue;
|
|
128
129
|
}
|
|
129
130
|
|
|
@@ -134,9 +135,10 @@ function transformStream(response) {
|
|
|
134
135
|
|
|
135
136
|
const cleaned = cleanResponse(parsed);
|
|
136
137
|
|
|
137
|
-
// Skip chunks
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
// Skip chunks with empty choices (including usage-only chunks)
|
|
139
|
+
// The AI SDK may not handle empty choices arrays correctly
|
|
140
|
+
if (!cleaned.choices || cleaned.choices.length === 0) {
|
|
141
|
+
debugLog('Skipping chunk with empty choices');
|
|
140
142
|
continue;
|
|
141
143
|
}
|
|
142
144
|
|