snow-flow 10.0.205 → 10.0.206
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/package.json +1 -1
- package/src/session/llm.ts +5 -0
- package/src/session/message-v2.ts +15 -1
package/package.json
CHANGED
package/src/session/llm.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Installation } from "@/installation"
|
|
|
3
3
|
import { Provider } from "@/provider/provider"
|
|
4
4
|
import { Log } from "@/util/log"
|
|
5
5
|
import {
|
|
6
|
+
NoOutputGeneratedError,
|
|
6
7
|
streamText,
|
|
7
8
|
wrapLanguageModel,
|
|
8
9
|
type ModelMessage,
|
|
@@ -189,6 +190,10 @@ export namespace LLM {
|
|
|
189
190
|
|
|
190
191
|
return streamText({
|
|
191
192
|
onError(error) {
|
|
193
|
+
if (NoOutputGeneratedError.isInstance(error.error)) {
|
|
194
|
+
l.debug("stream aborted before output was generated")
|
|
195
|
+
return
|
|
196
|
+
}
|
|
192
197
|
l.error("stream error", {
|
|
193
198
|
error,
|
|
194
199
|
})
|
|
@@ -2,7 +2,14 @@ import { BusEvent } from "@/bus/bus-event"
|
|
|
2
2
|
import { Bus } from "@/bus"
|
|
3
3
|
import z from "zod"
|
|
4
4
|
import { NamedError } from "@opencode-ai/util/error"
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
APICallError,
|
|
7
|
+
convertToModelMessages,
|
|
8
|
+
LoadAPIKeyError,
|
|
9
|
+
NoOutputGeneratedError,
|
|
10
|
+
type ModelMessage,
|
|
11
|
+
type UIMessage,
|
|
12
|
+
} from "ai"
|
|
6
13
|
import { Identifier } from "../id/id"
|
|
7
14
|
import { LSP } from "../lsp"
|
|
8
15
|
import { Snapshot } from "@/snapshot"
|
|
@@ -805,6 +812,13 @@ export namespace MessageV2 {
|
|
|
805
812
|
cause: e,
|
|
806
813
|
},
|
|
807
814
|
).toObject()
|
|
815
|
+
case NoOutputGeneratedError.isInstance(e):
|
|
816
|
+
return new MessageV2.AbortedError(
|
|
817
|
+
{ message: e.message || "Stream interrupted before any output was generated" },
|
|
818
|
+
{
|
|
819
|
+
cause: e,
|
|
820
|
+
},
|
|
821
|
+
).toObject()
|
|
808
822
|
case MessageV2.OutputLengthError.isInstance(e):
|
|
809
823
|
return e
|
|
810
824
|
case LoadAPIKeyError.isInstance(e):
|