fix(runner): show disk exhaustion before recovery errors (#22448)

Show the confirmed sandbox disk failure before a later lost-turn or restore error in saved run errors and both run detail views. Preserve the original diagnostics and leave scarce inodes available when preparing the existing runner relaunch reserve.

Verified focused regressions, scoped typechecks, and full CI on the reviewed revision, including Runner checks and all eight end-to-end shards. Greptile is 5/5 with all review findings resolved.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Devin FoleyandPaperclip authored and GitHub committed 2026-11-20 17:08:31 -08:00
1 parent 611dc68581
commit b4cea5b5a4
10 files changed
+87 -14

No files matched your search

@@ -50,6 +50,33 @@ const states = [
{ status: "running", eligibility: undefined, label: "Cancel", driverKind: "grok_bot_mcp" },
{ status: "queued", eligibility: undefined, label: "Cancel", driverKind: "grok_bot_mcp" },
];
it.each([RunsTab, ProductionRunsTab].flatMap(Tab => [null, "The previous turn is no longer active."].map(error => ({ Tab, error }))))(
"shows the confirmed full disk for historical run details (%#)", async ({ Tab, error }) => {
const run = { id: "disk-full-run", companyId: "company-1", agentId: "agent-1", status: "failed",
errorCode: "sandbox_disk_full", error, resultJson: null, contextSnapshot: null, usageJson: null,
createdAt: "2026-01-01T00:00:00Z", updatedAt: "2026-01-01T00:00:00Z", invocationSource: "manual",
startedAt: null, finishedAt: null, logRef: null, exitCode: 1,
execution: { canStop: false, phase: "completed", label: "Continued in another run" },
} as unknown as HeartbeatRun;
get.mockResolvedValue(run);
const client = new QueryClient({ defaultOptions: { queries: { retry: false, gcTime: 0 } } });
const element = document.createElement("div"); document.body.append(element);
const root = createRoot(element);
try {
await act(async () => root.render(<QueryClientProvider client={client}><MemoryRouter><PanelProvider><ToastProvider>
<Tab runs={[]} companyId="company-1" agentId="agent-1" agentRouteId="agent-1" selectedRunId={run.id} adapterType="paperclip_runner" adapterConfig={{}} />
</ToastProvider></PanelProvider></MemoryRouter></QueryClientProvider>));
await vi.waitFor(async () => {
await act(async () => {});
expect(element.textContent).toContain("computer ran out of disk space");
});
expect(element.textContent).not.toContain("previous turn is no longer active");
expect(cancel).not.toHaveBeenCalled();
} finally { await act(async () => root.unmount()); client.clear(); element.remove(); }
},
);
it.each([RunsTab, ProductionRunsTab].flatMap(Tab => states.map(state => ({ Tab, ...state }))))("renders and submits only eligible run cancellation (%#)", async ({ Tab, status, eligibility, label, ...state }) => {
if (state.local) { actor.id = "local-board"; actor.source = "local_implicit"; }
const run = { id: state.priorSession ? `persisted-run-${Tab === RunsTab ? "main" : "production"}` : "failed-native-run", companyId: "company-1", agentId: "agent-1", issueId: "issue-1", status, driverKind: state.driverKind, invocationSource: "manual",
+3 -2
View File
@@ -66,6 +66,7 @@ import { readSourceResolvedWatchdogFold } from "../lib/source-resolved-watchdog-
import { formatCents, formatDate, relativeTime, formatTokens, visibleRunCostUsd, visibleRunTokenTotal } from "../lib/utils";
import { cn } from "../lib/utils";
import { ProviderLimitMessage } from "../components/ProviderLimitMessage";
import { runFailureMessage } from "@paperclipai/shared";
import { describeRunRetryState } from "../lib/runRetryState";
import { Button } from "@/components/ui/button";
import { Skeleton } from "@/components/ui/skeleton";
@@ -3039,9 +3040,9 @@ function RunDetail({ run: initialRun, agentRouteId, adapterType, adapterConfig }
)}
</div>
)}
{run.error && (
{runFailureMessage(run) && (
<div className="text-xs">
<span className="text-red-600 dark:text-red-400"><ProviderLimitMessage>{run.error}</ProviderLimitMessage></span>
<span className="text-destructive"><ProviderLimitMessage>{runFailureMessage(run)!}</ProviderLimitMessage></span>
{run.errorCode && <span className="text-muted-foreground ml-1">({run.errorCode})</span>}
</div>
)}
+4 -4
View File
@@ -6,7 +6,7 @@ import { GrokBotWorkSummary } from "@/components/GrokBotWorkSummary";
import { PrimaryAgentCrownButton } from "@/components/primary-agent/PrimaryAgentPresentation";
import { AiConnectionPoolRunDetails } from "@/components/ai-connections/AiConnectionPoolRunDetails";
import { ProviderFailureNotice } from "@/components/ProviderFailureNotice";
import { readProviderFailure } from "@paperclipai/shared";
import { readProviderFailure, runFailureMessage } from "@paperclipai/shared";
import { AgentConnectionInstructions } from "@/features/connections/ConnectionInstructions";
import type { AgentInstructionCandidate, AgentInstructionsBundle } from "@paperclipai/shared";
import { InstructionHistory } from "../components/InstructionHistory";
@@ -3362,11 +3362,11 @@ function RunDetail({ run: initialRun, agentRouteId, adapterType, adapterConfig }
</div>
)}
<AgentFileRunNotice resultJson={run.resultJson} />
{readProviderFailure(run.resultJson?.providerFailure) ? (
{run.errorCode !== "sandbox_disk_full" && readProviderFailure(run.resultJson?.providerFailure) ? (
<ProviderFailureNotice failure={readProviderFailure(run.resultJson?.providerFailure)!} />
) : run.error && (
) : runFailureMessage(run) && (
<div className="text-xs">
<span className="text-red-600 dark:text-red-400"><ProviderLimitMessage>{run.error}</ProviderLimitMessage></span>
<span className="text-destructive"><ProviderLimitMessage>{runFailureMessage(run)!}</ProviderLimitMessage></span>
{run.errorCode && <span className="text-muted-foreground ml-1">({run.errorCode})</span>}
</div>
)}