mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-03 15:43:45 +00:00
Refactor session module structure and improve error handling
- Rename session.ts to index.ts for cleaner module imports - Update all imports to use new session module structure - Add error metadata tracking to message schema - Improve error handling in session stream processing 🤖 Generated with [OpenCode](https://opencode.ai) Co-Authored-By: OpenCode <noreply@opencode.ai>
This commit is contained in:
@@ -398,11 +398,9 @@ ${app.git ? await ListTool.execute({ path: app.path.cwd }, { sessionID: input.se
|
||||
let text: Message.TextPart | undefined
|
||||
const reader = result.toUIMessageStream().getReader()
|
||||
while (true) {
|
||||
const result = await reader.read().catch((e) => {
|
||||
if (e instanceof DOMException && e.name === "AbortError") {
|
||||
return
|
||||
}
|
||||
throw e
|
||||
const result = await reader.read().catch(async (e) => {
|
||||
console.log(e)
|
||||
next.metadata.error = e.name
|
||||
})
|
||||
if (!result) break
|
||||
const { done, value } = result
|
||||
@@ -138,6 +138,7 @@ export namespace Message {
|
||||
created: z.number(),
|
||||
completed: z.number().optional(),
|
||||
}),
|
||||
error: z.string().optional(),
|
||||
sessionID: z.string(),
|
||||
tool: z.record(z.string(), z.any()),
|
||||
assistant: z
|
||||
|
||||
Reference in New Issue
Block a user