Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

[codex] show complete approval details (#4111)

Maxwell Younga135f2c2d32b
diff --git a/apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.approval.test.ts b/apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.approval.test.ts
new file mode 100644
index 000000000..05370781c
--- /dev/null
+++ b/apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.approval.test.ts
@@ -0,0 +1,33 @@
+import {
+ EventId,
+ ProviderDriverKind,
+ RuntimeRequestId,
+ ThreadId,
+ type ProviderRuntimeEvent,
+} from "@t3tools/contracts";
+import { describe, expect, it } from "vite-plus/test";
+
+import { runtimeEventToActivities } from "./ProviderRuntimeIngestion.ts";
+
+describe("runtimeEventToActivities approval details", () => {
+ it("preserves complete multiline command details", () => {
+ const detail = `bun run release -- ${"long-argument ".repeat(20)}\nsecond line`;
+ const event = {
+ type: "request.opened",
+ eventId: EventId.make("evt-request-opened"),
+ provider: ProviderDriverKind.make("codex"),
+ createdAt: "2026-07-18T00:00:00.000Z",
+ threadId: ThreadId.make("thread-1"),
+ requestId: RuntimeRequestId.make("approval-1"),
+ payload: {
+ requestType: "command_execution_approval",
+ detail,
+ },
+ } satisfies ProviderRuntimeEvent;
+
+ const [activity] = runtimeEventToActivities(event);
+
+ expect(activity?.kind).toBe("approval.requested");
+ expect((activity?.payload as Record<string, unknown> | undefined)?.detail).toBe(detail);
+ });
+});
diff --git a/apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts b/apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts
index a5ec9d2b8..09566feb2 100644
--- a/apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts
+++ b/apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts
@@ -306,7 +306,7 @@ function requestKindFromCanonicalRequestType(
}
}
-function runtimeEventToActivities(
+export function runtimeEventToActivities(
event: ProviderRuntimeEvent,
taskTitle?: string,
): ReadonlyArray<OrchestrationThreadActivity> {
@@ -340,7 +340,7 @@ function runtimeEventToActivities(
requestId: toApprovalRequestId(event.requestId),
...(requestKind ? { requestKind } : {}),
requestType: event.payload.requestType,
- ...(event.payload.detail ? { detail: truncateDetail(event.payload.detail) } : {}),
+ ...(event.payload.detail ? { detail: event.payload.detail } : {}),
},
turnId: toTurnId(event.turnId) ?? null,
...maybeSequence,
diff --git a/apps/web/src/components/chat/ComposerPendingApprovalPanel.test.tsx b/apps/web/src/components/chat/ComposerPendingApprovalPanel.test.tsx
new file mode 100644
index 000000000..fbaf81bc9
--- /dev/null
+++ b/apps/web/src/components/chat/ComposerPendingApprovalPanel.test.tsx
@@ -0,0 +1,28 @@
+import { ApprovalRequestId } from "@t3tools/contracts";
+import { renderToStaticMarkup } from "react-dom/server";
+import { describe, expect, it } from "vite-plus/test";
+
+import { ComposerPendingApprovalPanel } from "./ComposerPendingApprovalPanel";
+
+describe("ComposerPendingApprovalPanel", () => {
+ it("renders complete multiline command details without hover or truncation", () => {
+ const detail = `bun run release -- ${"long-argument ".repeat(20)}\nsecond line`;
+ const markup = renderToStaticMarkup(
+ <ComposerPendingApprovalPanel
+ approval={{
+ requestId: ApprovalRequestId.make("approval-1"),
+ requestKind: "command",
+ createdAt: "2026-07-18T00:00:00.000Z",
+ detail,
+ }}
+ pendingCount={1}
+ />,
+ );
+
+ expect(markup).toContain('data-approval-detail="complete"');
+ expect(markup).toContain('aria-label="Command"');
+ expect(markup).toContain(detail);
+ expect(markup).not.toContain("truncate");
+ expect(markup).not.toContain("line-clamp");
+ });
+});
diff --git a/apps/web/src/components/chat/ComposerPendingApprovalPanel.tsx b/apps/web/src/components/chat/ComposerPendingApprovalPanel.tsx
index 569fd108a..dd966bf57 100644
--- a/apps/web/src/components/chat/ComposerPendingApprovalPanel.tsx
+++ b/apps/web/src/components/chat/ComposerPendingApprovalPanel.tsx
@@ -16,6 +16,12 @@ export const ComposerPendingApprovalPanel = memo(function ComposerPendingApprova
: approval.requestKind === "file-read"
? "File-read approval requested"
: "File-change approval requested";
+ const detailLabel =
+ approval.requestKind === "command"
+ ? "Command"
+ : approval.requestKind === "file-read"
+ ? "File to read"
+ : "File change";
return (
<div className="px-4 py-3.5 sm:px-5 sm:py-4">
@@ -26,6 +32,18 @@ export const ComposerPendingApprovalPanel = memo(function ComposerPendingApprova
<span className="text-xs text-muted-foreground">1/{pendingCount}</span>
) : null}
</div>
+ {approval.detail ? (
+ <div className="mt-3 rounded-lg border border-border/65 bg-background/70 p-3">
+ <p className="text-xs font-medium text-muted-foreground">{detailLabel}</p>
+ <pre
+ aria-label={detailLabel}
+ className="mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-foreground"
+ data-approval-detail="complete"
+ >
+ {approval.detail}
+ </pre>
+ </div>
+ ) : null}
</div>
);
});