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 commit 563e27831b removed 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 commit 563e27831b removed 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:
Sonarly Claude Code 2026-04-09 18:38:55 +00:00
parent 8fde5d9da3
commit da11f44847
2 changed files with 5 additions and 8 deletions

View file

@ -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': {

View file

@ -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;
};
};