mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 08:02:17 +00:00
Add reasoning events and abort-aware finish reason to chat endpoint
Map thinking_start/delta/end to Vercel AI SDK reasoning-start/delta/end chunk types. Derive finish reason from enqueueMessage result - aborted sessions get a clean finish with reason "error" instead of an error chunk.
This commit is contained in:
parent
fcd51005e2
commit
8a61de15fa
2 changed files with 25 additions and 1 deletions
|
|
@ -638,7 +638,12 @@ export class GatewayRuntime {
|
|||
if (result.ok) {
|
||||
finishVercelStream(response, "stop");
|
||||
} else {
|
||||
errorVercelStream(response, result.error ?? "Unknown error");
|
||||
const isAbort = result.error?.includes("aborted");
|
||||
if (isAbort) {
|
||||
finishVercelStream(response, "error");
|
||||
} else {
|
||||
errorVercelStream(response, result.error ?? "Unknown error");
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue