fix(answer): stash the answer input event before addToolOutput
The onSubmitAnswer path was the one Wave B send site missing its stash: addToolOutput triggers the SDK's automatic continuation send, the transport found nothing stashed, and threw — the answer never POSTed, so the question stayed open. One line (plus the contract comment). Caught live by the owner; the suite drives answer events directly at the handler, so this client seam stays untested until Wave D's client work.
This commit is contained in:
@@ -1310,6 +1310,12 @@ export function Chat({
|
||||
}
|
||||
onSubmitAnswer={(output) => {
|
||||
if (!pending) return;
|
||||
// THE INPUT-EVENTS CONTRACT (Wave B): the answer ride order is
|
||||
// stash-then-send — addToolOutput triggers the SDK's automatic
|
||||
// continuation send (sendAutomaticallyWhen), and the transport
|
||||
// consumes THIS stash to build {chatId, input}. Dismissals ride
|
||||
// the same callback (QuestionAnswerData.dismissed).
|
||||
stashInput({ type: "answer", toolCallId: pending.toolCallId, answer: output });
|
||||
void addToolOutput({
|
||||
tool: pending.tool as "quiz" | "ask_user_question",
|
||||
toolCallId: pending.toolCallId,
|
||||
|
||||
Reference in New Issue
Block a user