Skip to content

Commit 009ca72

Browse files
sweetmantechclaude
andcommitted
debug: add logging to trace onFinish callback execution
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4d78258 commit 009ca72

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/chat/handleChatGenerate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export async function handleChatGenerate(request: NextRequest): Promise<Response
4141
],
4242
} as UIMessage;
4343

44+
console.log("🟢 Calling handleChatCompletion for generate endpoint");
4445
void handleChatCompletion(body, [responseUIMessage]).catch((e) => {
4546
console.error("Failed to handle chat completion:", e);
4647
});

lib/chat/handleChatStream.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export async function handleChatStream(request: NextRequest): Promise<Response>
4444
});
4545
},
4646
onFinish: ({ messages }) => {
47+
console.log("🟢 onFinish triggered, messages count:", messages?.length);
4748
void handleChatCompletion(body, messages).catch((e) => {
4849
console.error("Failed to handle chat completion:", e);
4950
});

0 commit comments

Comments
 (0)