fix: improve task approval display text and spacing (#913)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-02-11 01:35:58 -08:00
committed by GitHub
parent 03c70ab723
commit 863973be83
2 changed files with 26 additions and 38 deletions

View File

@@ -143,53 +143,30 @@ export const InlineTaskApproval = memo(
{/* Header */}
<Text bold color={colors.approval.header}>
Run Task?
Dispatch subagent?
</Text>
{/* Task details */}
<Box paddingLeft={2} flexDirection="column" marginTop={1}>
{/* Subagent type */}
{/* Type — Description (with optional model) */}
<Box flexDirection="row">
<Box width={12} flexShrink={0}>
<Text dimColor>Type:</Text>
</Box>
<Box flexGrow={1} width={contentWidth - 12}>
<Text wrap="wrap" color={colors.subagent.header}>
{subagentType}
<Box flexGrow={1} width={contentWidth}>
<Text wrap="wrap">
<Text bold color={colors.subagent.header}>
{subagentType}
</Text>
<Text dimColor>
{" — "}
{description}
{model ? ` (${model})` : ""}
</Text>
</Text>
</Box>
</Box>
{/* Model (if specified) */}
{model && (
<Box flexDirection="row">
<Box width={12} flexShrink={0}>
<Text dimColor>Model:</Text>
</Box>
<Box flexGrow={1} width={contentWidth - 12}>
<Text wrap="wrap" dimColor>
{model}
</Text>
</Box>
</Box>
)}
{/* Description */}
<Box flexDirection="row">
<Box width={12} flexShrink={0}>
<Text dimColor>Description:</Text>
</Box>
<Box flexGrow={1} width={contentWidth - 12}>
<Text wrap="wrap">{description}</Text>
</Box>
</Box>
{/* Prompt */}
<Box flexDirection="row" marginTop={1}>
<Box width={12} flexShrink={0}>
<Text dimColor>Prompt:</Text>
</Box>
<Box flexGrow={1} width={contentWidth - 12}>
<Box marginTop={1}>
<Box flexGrow={1} width={contentWidth}>
<Text wrap="wrap" dimColor>
{truncatedPrompt}
</Text>
@@ -209,7 +186,7 @@ export const InlineTaskApproval = memo(
// Generate "always" text for Task tool
const alwaysText =
approveAlwaysText || "Yes, allow Task operations during this session";
approveAlwaysText || "Yes, allow subagent operations during this session";
return (
<Box flexDirection="column">

View File

@@ -74,6 +74,17 @@ export function analyzeApprovalContext(
workingDirectory,
);
case "Task":
case "task":
return {
recommendedRule: "Task",
ruleDescription: "subagent operations",
approveAlwaysText: "Yes, allow subagent operations during this session",
defaultScope: "session",
allowPersistence: true,
safetyLevel: "moderate",
};
default:
return analyzeDefaultApproval(toolName);
}