From 4f202303bc610ad93ab92182c52ca12c66ffd84e Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 9 May 2026 20:21:58 -0400 Subject: [PATCH] fix(web): hide retry on non-recoverable terminal errors Server-typed errors like "Local sandboxes do not support embedded terminals" won't change on retry, so the ErrorState now omits the "Try again" button for them. WebSocket connection failures stay recoverable and keep the retry affordance. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/fabro-web/app/routes/run-terminal.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/fabro-web/app/routes/run-terminal.tsx b/apps/fabro-web/app/routes/run-terminal.tsx index 906db2242..7bcf0d28b 100644 --- a/apps/fabro-web/app/routes/run-terminal.tsx +++ b/apps/fabro-web/app/routes/run-terminal.tsx @@ -196,7 +196,7 @@ export default function RunTerminal({ params }: { params: { id: string } }) { const accessCommandLabel = terminalAccessCommandLabel(provider); const [connectionKey, setConnectionKey] = useState(0); const [status, setStatus] = useState("connecting"); - const [error, setError] = useState(null); + const [error, setError] = useState<{ message: string; recoverable: boolean } | null>(null); const terminalEl = useRef(null); const terminalRef = useRef(null); const fitRef = useRef(null); @@ -291,7 +291,10 @@ export default function RunTerminal({ params }: { params: { id: string } }) { return; } setStatus("error"); - setError(message.message ?? "Terminal session failed."); + setError({ + message: message.message ?? "Terminal session failed.", + recoverable: false, + }); return; } const bytes = event.data instanceof ArrayBuffer @@ -304,7 +307,10 @@ export default function RunTerminal({ params }: { params: { id: string } }) { }); socket.addEventListener("error", () => { setStatus("error"); - setError("Terminal WebSocket connection failed."); + setError({ + message: "Terminal WebSocket connection failed.", + recoverable: true, + }); }); resizeObserver = new ResizeObserver(() => { @@ -373,8 +379,8 @@ export default function RunTerminal({ params }: { params: { id: string } }) {
) : (