fix(web): accept unknown stream payload when binding spoken prompts
Independent Staging Quality Gate / validate (push) Successful in 21m40s
Independent Staging Quality Gate / publish (push) Successful in 11m12s

Publish next build failed because the spoken-bind helper required result/output
on chunk payload, which the runner stream type does not have.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-26 00:27:49 +08:00
parent 97b02aef5d
commit 9326b7d0a4
4 changed files with 28 additions and 4 deletions
@@ -48,12 +48,15 @@ export function readOpenQuestionPrompt(value: unknown): string | null {
export function openQuestionPromptFromToolResult(chunk: {
type?: string;
payload?: { result?: unknown; output?: unknown };
payload?: unknown;
object?: unknown;
}): string | null {
if (chunk.type !== "tool-result") return null;
return readOpenQuestionPrompt(chunk.payload?.result)
?? readOpenQuestionPrompt(chunk.payload?.output)
const payload = chunk.payload && typeof chunk.payload === "object" && !Array.isArray(chunk.payload)
? chunk.payload as Record<string, unknown>
: null;
return readOpenQuestionPrompt(payload?.result)
?? readOpenQuestionPrompt(payload?.output)
?? readOpenQuestionPrompt(chunk.object)
?? readOpenQuestionPrompt(chunk.payload);
}