fix payload accesses

This commit is contained in:
Vikhyath Mondreti
2026-04-09 17:28:16 -07:00
parent 2d2f7828c9
commit f509e33601
4 changed files with 5 additions and 8 deletions

View File

@@ -1033,7 +1033,7 @@ export function useChat(
if (previewPhase === 'file_preview_complete') {
const fileId =
typeof payload.fileId === 'string' ? payload.fileId : prevSession.fileId
const resultData = asPayloadRecord(payload.data)
const resultData = asPayloadRecord(payload.output)
sessions.delete(id)
activeFilePreviewToolCallIdRef.current = null

View File

@@ -418,10 +418,7 @@ export async function runStreamLoop(
toolName: 'workspace_file',
previewPhase: 'file_preview_complete',
fileId: context.activeFileIntent.target.fileId,
data:
streamEvent.payload.result !== undefined
? streamEvent.payload.result
: streamEvent.payload.data,
output: streamEvent.payload.output,
},
...(streamEvent.scope ? { scope: streamEvent.scope } : {}),
})

View File

@@ -209,7 +209,7 @@ export async function emitSyntheticToolResult(
mode: MothershipStreamV1ToolMode.async,
phase: MothershipStreamV1ToolPhase.result,
success,
result: resultPayload,
output: resultPayload,
...(completion?.status ? { status: completion.status } : {}),
...(!success && completion?.message ? { error: completion.message } : {}),
},

View File

@@ -423,7 +423,7 @@ export async function executeToolAndReport(
mode: MothershipStreamV1ToolMode.async,
phase: MothershipStreamV1ToolPhase.result,
success: result.success,
result: result.output,
output: result.output,
...(result.success
? { status: MothershipStreamV1ToolOutcome.success }
: { status: MothershipStreamV1ToolOutcome.error }),
@@ -527,7 +527,7 @@ export async function executeToolAndReport(
phase: MothershipStreamV1ToolPhase.result,
status: MothershipStreamV1ToolOutcome.error,
error: toolCall.error,
result: { error: toolCall.error },
output: { error: toolCall.error },
},
}
await options?.onEvent?.(errorEvent)