fix: patch plan mode (#211)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2025-12-14 21:11:42 -08:00
committed by GitHub
parent 078fcf5476
commit cd270a938d
4 changed files with 32 additions and 4 deletions

View File

@@ -272,8 +272,9 @@ export const ToolCallMessage = memo(({ line }: { line: ToolCallLine }) => {
// Format tool denial errors more user-friendly
if (isError && displayText.includes("request to call tool denied")) {
const match = displayText.match(/User reason: (.+)$/);
const reason = match ? match[1] : "(empty)";
// Use [\s\S]+ to match multiline reasons
const match = displayText.match(/User reason: ([\s\S]+)$/);
const reason = match?.[1]?.trim() || "(empty)";
displayText = `User rejected the tool call with reason: ${reason}`;
}