feat: update tool output format, use plain string instead of json string (#881)

This commit is contained in:
tanzhenxin
2025-10-27 17:26:47 +08:00
committed by GitHub
parent 2a5577e5d7
commit 4328cd7f63
9 changed files with 188 additions and 117 deletions

View File

@@ -115,17 +115,12 @@ class ExitPlanModeToolInvocation extends BaseToolInvocation<
const rejectionMessage =
'Plan execution was not approved. Remaining in plan mode.';
return {
llmContent: JSON.stringify({
success: false,
plan,
error: rejectionMessage,
}),
llmContent: rejectionMessage,
returnDisplay: rejectionMessage,
};
}
const llmMessage =
'User has approved your plan. You can now start coding. Start with updating your todo list if applicable.';
const llmMessage = `User has approved your plan. You can now start coding. Start with updating your todo list if applicable.`;
const displayMessage = 'User approved the plan.';
return {
@@ -142,11 +137,11 @@ class ExitPlanModeToolInvocation extends BaseToolInvocation<
console.error(
`[ExitPlanModeTool] Error executing exit_plan_mode: ${errorMessage}`,
);
const errorLlmContent = `Failed to present plan: ${errorMessage}`;
return {
llmContent: JSON.stringify({
success: false,
error: `Failed to present plan. Detail: ${errorMessage}`,
}),
llmContent: errorLlmContent,
returnDisplay: `Error presenting plan: ${errorMessage}`,
};
}