@devries-cameron20 / t3code Mirror · read-only / commits / bbcaa79907
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 03:00 UTC

fix(web): usage limit recovery errors no longer crush the composer banner (#17457)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Patryk Sztuczka committed Oct 18, 2026 at 21:33 UTC bbcaa7990728325689841593bcd9c6c597750ee3
1 file changed +15 -11
apps/web/src/components/chat/UsageLimitRecoveryBanner.tsx
+15 -11
@@ -6,6 +6,7 @@ import {
6 import { GaugeIcon } from "lucide-react";
7 import { useEffect, useState } from "react";
8 import { Button } from "../ui/button";
9 +import { toastManager } from "../ui/toast";
10 import type { ComposerBannerStackItem } from "./ComposerBannerStack";
11
12 type RecoveryProps = {
@@ -35,7 +36,6 @@ export function usageLimitRecoveryBannerItem(props: RecoveryProps): ComposerBann
36
37 function RecoveryActions({ runId, resetAt, recovery, snoozedUntil, onChange }: RecoveryProps) {
38 const [pending, setPending] = useState(false);
38 - const [error, setError] = useState<string | null>(null);
39 const [nowMs, setNowMs] = useState(() => Date.now());
40 useEffect(() => {
41 const delay = Date.parse(resetAt ?? "") - Math.max(nowMs, Date.now());
@@ -56,12 +56,15 @@ function RecoveryActions({ runId, resetAt, recovery, snoozedUntil, onChange }: R
56 async function toggle(action: "resume" | "snooze") {
57 if (resetAt === null) return;
58 if (action === "snooze" && !snoozed && Date.parse(resetAt) <= Date.now()) {
59 - setError("The reset time has passed. Retry the thread manually.");
59 + toastManager.add({
60 + type: "error",
61 + title: "Could not snooze thread",
62 + description: "The reset time has passed. Retry the thread manually.",
63 + });
64 setNowMs(Date.now());
65 return;
66 }
67 setPending(true);
64 - setError(null);
68 try {
69 await onChange({
70 runId,
@@ -69,12 +72,18 @@ function RecoveryActions({ runId, resetAt, recovery, snoozedUntil, onChange }: R
72 ...(action === "resume" ? { autoResume: !scheduled } : { snooze: !snoozed }),
73 });
74 } catch (cause) {
72 - setError(cause instanceof Error ? cause.message : "Could not change limit recovery.");
75 + toastManager.add({
76 + type: "error",
77 + title: action === "resume" ? "Could not change auto-resume" : "Could not snooze thread",
78 + description: cause instanceof Error ? cause.message : "An error occurred.",
79 + });
80 }
81 setPending(false);
82 }
83 + // Failures go to a toast: the actions column is auto-sized, so inline error
84 + // text would widen it and crush the title.
85 return (
77 - <div className="flex flex-wrap items-center gap-2">
86 + <>
87 <Button size="xs" variant="ghost" disabled={pending} onClick={() => void toggle("resume")}>
88 {pending ? "Saving..." : scheduled ? "Cancel auto-resume" : "Resume at reset"}
89 </Button>
@@ -88,11 +97,6 @@ function RecoveryActions({ runId, resetAt, recovery, snoozedUntil, onChange }: R
97 {pending ? "Saving..." : "Snooze until reset"}
98 </Button>
99 ) : null}
91 - {error ? (
92 - <p role="alert" className="basis-full text-xs text-destructive">
93 - {error}
94 - </p>
95 - ) : null}
96 - </div>
100 + </>
101 );
102 }