Skip to content

Commit a91f995

Browse files
committed
fix(approvals): pi shows whole bash commands, mobile commands scroll
1 parent be7b126 commit a91f995

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎apps/mobile/src/features/threads/PendingApprovalCard.tsx‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {
55
ProviderApprovalOption,
66
RuntimeRequestId,
77
} from "@t3tools/contracts";
8-
import { View } from "react-native";
8+
import { ScrollView, View } from "react-native";
99

1010
import { AppText as Text } from "../../components/ui/AppText";
1111
import type { PendingApproval } from "../../lib/threadActivity";
@@ -49,9 +49,12 @@ export function PendingApprovalCard(props: PendingApprovalCardProps) {
4949
) : null}
5050
{props.approval.detail ? (
5151
props.approval.requestKind === "command" ? (
52-
<Text className="font-mono text-sm leading-normal text-foreground" selectable>
53-
{approvalCommandDisplayText(props.approval.detail)}
54-
</Text>
52+
// Long commands scroll inside the card so its buttons stay on screen.
53+
<ScrollView className="max-h-40" nestedScrollEnabled showsVerticalScrollIndicator>
54+
<Text className="font-mono text-sm leading-normal text-foreground" selectable>
55+
{approvalCommandDisplayText(props.approval.detail)}
56+
</Text>
57+
</ScrollView>
5558
) : (
5659
<Text className="font-sans text-sm leading-normal text-foreground-secondary">
5760
{props.approval.detail}

‎packages/provider-pi/src/server/mcpExtensionSource.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ function runtimeMode(): RuntimeMode {
7373
}
7474
7575
function toolInputSummary(toolName: string, input: unknown): string {
76-
// The bash tool's approval shows the command itself, not its JSON arguments.
76+
// The bash tool's approval shows the whole command, never a truncated one.
7777
const command = (input as { command?: unknown } | null)?.command;
7878
if (toolName === "bash" && typeof command === "string" && command.trim().length > 0) {
79-
return command.slice(0, 4_000);
79+
return command;
8080
}
8181
try {
8282
return JSON.stringify(input, null, 2).slice(0, 4_000);

0 commit comments

Comments
 (0)