fix: patch bug in approve plan mode (handle empty toolArgs for tools with no parameters) (#387)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2025-12-24 15:41:50 -08:00
committed by GitHub
parent a4fa3023c1
commit afbe253de2
2 changed files with 30 additions and 9 deletions

View File

@@ -215,10 +215,12 @@ export async function drainStream(
// Include ALL tool_call_ids - don't filter out incomplete entries
// Missing name/args will be handled by denial logic in App.tsx
// Default empty toolArgs to "{}" - empty string causes JSON.parse("") to fail
// This happens for tools with no parameters (e.g., EnterPlanMode, ExitPlanMode)
approvals = allPending.map((a) => ({
toolCallId: a.toolCallId,
toolName: a.toolName || "",
toolArgs: a.toolArgs || "",
toolArgs: a.toolArgs || "{}",
}));
if (approvals.length === 0) {