fix(ai): preserve chat response for onFinish#16145
Conversation
|
Quick status check on current head Review focus: whether preserving the response object for |
|
Friendly follow-up: current head Happy to rebase or adjust the approach if that would help. Let me know if there are questions or if there is a preferred path for the deployment authorization. |
aayush-kapoor
left a comment
There was a problem hiding this comment.
closing in favor of #16620
Summary
Closes #15668.
activeResponsereference foronFinishinstead of reading the mutable instance field infinallythis.activeResponsewhen another overlapping request has already replaced itactiveResponsebefore stream finish and verifiesonFinishstill receives the assistant message without logging an erroraiTests
pnpm test:node src/ui/chat.test.tspnpm --filter ai type-checkpnpm checkpnpm --filter ai build