mirror of
https://github.com/twentyhq/twenty
synced 2026-04-21 13:37:22 +00:00
fix: update UI tool call processing to match new unwrapped ToolOutput shape
https://sonarly.com/issue/23566?type=bug AI chat navigate_app tool calls crash in the frontend because commit563e27831bremoved the `ExecuteToolResult` wrapper on the backend but the frontend still reads the old nested `output.result.success` path. Fix: Updated the frontend to match the new backend `ToolOutput` shape after commit563e27831bremoved the `ExecuteToolResult` wrapper from `execute_tool`. **`AgentChatMessageUIToolCallPart.ts`**: Removed the `toolName` field and flattened the `output` type from `{ toolName, result: { success, message, result } }` to `{ success, message, result }` — matching the raw `ToolOutput<NavigateAppToolOutput>` the backend now returns. **`useProcessUIToolCallMessage.ts`**: Updated two property access paths: - Line 45: `toolExecutionPart.output.result.success` → `toolExecutionPart.output.success` - Line 54: `toolExecutionPart.output.result.result` → `toolExecutionPart.output.result` These are the only two sites in the codebase that read from the tool execution part output, so the fix is complete.
This commit is contained in:
parent
8fde5d9da3
commit
da11f44847
2 changed files with 5 additions and 8 deletions
|
|
@ -42,7 +42,7 @@ export const useProcessUIToolCallMessage = () => {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (toolExecutionPart.output.result.success !== true) {
|
||||
if (toolExecutionPart.output.success !== true) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ export const useProcessUIToolCallMessage = () => {
|
|||
toolExecutionPart.toolCallId,
|
||||
]);
|
||||
|
||||
const navigateAppOutput = toolExecutionPart.output.result.result;
|
||||
const navigateAppOutput = toolExecutionPart.output.result;
|
||||
|
||||
switch (navigateAppOutput.action) {
|
||||
case 'navigateToObject': {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,8 @@ export type AgentChatMessageUIToolCallPart = {
|
|||
toolCallId: string;
|
||||
state: string;
|
||||
output: {
|
||||
toolName: string;
|
||||
result: {
|
||||
message: string;
|
||||
result: NavigateAppToolOutput;
|
||||
success: boolean;
|
||||
};
|
||||
success: boolean;
|
||||
message: string;
|
||||
result: NavigateAppToolOutput;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue