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) => {
|
onSubmitAnswer={(output) => {
|
||||||
if (!pending) return;
|
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({
|
void addToolOutput({
|
||||||
tool: pending.tool as "quiz" | "ask_user_question",
|
tool: pending.tool as "quiz" | "ask_user_question",
|
||||||
toolCallId: pending.toolCallId,
|
toolCallId: pending.toolCallId,
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
/// <reference types="next" />
|
/// <reference types="next" />
|
||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
import "./.next/types/routes.d.ts";
|
import "./.next/dev/types/routes.d.ts";
|
||||||
import "./.next/types/root-params.d.ts";
|
import "./.next/dev/types/root-params.d.ts";
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
// NOTE: This file should not be edited
|
||||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||||
|
|||||||
Reference in New Issue
Block a user