Skip to content

Commit f509e33

Browse files
committed
fix payload accesses
1 parent 2d2f782 commit f509e33

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ export function useChat(
10331033
if (previewPhase === 'file_preview_complete') {
10341034
const fileId =
10351035
typeof payload.fileId === 'string' ? payload.fileId : prevSession.fileId
1036-
const resultData = asPayloadRecord(payload.data)
1036+
const resultData = asPayloadRecord(payload.output)
10371037
sessions.delete(id)
10381038
activeFilePreviewToolCallIdRef.current = null
10391039

apps/sim/lib/copilot/request/go/stream.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,7 @@ export async function runStreamLoop(
418418
toolName: 'workspace_file',
419419
previewPhase: 'file_preview_complete',
420420
fileId: context.activeFileIntent.target.fileId,
421-
data:
422-
streamEvent.payload.result !== undefined
423-
? streamEvent.payload.result
424-
: streamEvent.payload.data,
421+
output: streamEvent.payload.output,
425422
},
426423
...(streamEvent.scope ? { scope: streamEvent.scope } : {}),
427424
})

apps/sim/lib/copilot/request/handlers/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export async function emitSyntheticToolResult(
209209
mode: MothershipStreamV1ToolMode.async,
210210
phase: MothershipStreamV1ToolPhase.result,
211211
success,
212-
result: resultPayload,
212+
output: resultPayload,
213213
...(completion?.status ? { status: completion.status } : {}),
214214
...(!success && completion?.message ? { error: completion.message } : {}),
215215
},

apps/sim/lib/copilot/request/tools/executor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ export async function executeToolAndReport(
423423
mode: MothershipStreamV1ToolMode.async,
424424
phase: MothershipStreamV1ToolPhase.result,
425425
success: result.success,
426-
result: result.output,
426+
output: result.output,
427427
...(result.success
428428
? { status: MothershipStreamV1ToolOutcome.success }
429429
: { status: MothershipStreamV1ToolOutcome.error }),
@@ -527,7 +527,7 @@ export async function executeToolAndReport(
527527
phase: MothershipStreamV1ToolPhase.result,
528528
status: MothershipStreamV1ToolOutcome.error,
529529
error: toolCall.error,
530-
result: { error: toolCall.error },
530+
output: { error: toolCall.error },
531531
},
532532
}
533533
await options?.onEvent?.(errorEvent)

0 commit comments

Comments
 (0)