fix: add goose execution override for h5 chat

This commit is contained in:
john
2026-07-04 14:48:45 +08:00
parent 927e16d861
commit 12268110f7
13 changed files with 261 additions and 18 deletions
+11 -7
View File
@@ -1136,7 +1136,7 @@ export function useTKMindChat(
const submit = useCallback(
async (
text: string,
options?: { mindspaceContext?: MindSpaceChatContext; messageId?: string },
options?: { mindspaceContext?: MindSpaceChatContext; messageId?: string; forceGoose?: boolean },
imageUrls?: string[],
previewImageUrls?: string[],
) => {
@@ -1182,16 +1182,20 @@ export function useTKMindChat(
}
try {
const runOptions = resolveAgentRunOptions(trimmed, {
taskType: 'h5_chat_code_task',
userId: userRef.current?.id ?? null,
requestId,
mindspaceContext: options?.mindspaceContext ?? null,
});
const createdRun = await createAgentRun(
activeSessionId,
requestId,
userMessage,
resolveAgentRunOptions(trimmed, {
taskType: 'h5_chat_code_task',
userId: userRef.current?.id ?? null,
requestId,
mindspaceContext: options?.mindspaceContext ?? null,
}),
{
...runOptions,
...(options?.forceGoose ? { forceGoose: true } : {}),
},
);
const finishedRun =
createdRun.status === 'succeeded' ? createdRun : await waitForAgentRun(createdRun.id);