fix(system): SystemStats useFetch gets 10s timeoutMs ceiling

/api/system runs four shell tools each capped at 5s; a 10s client-side abort
gives 2× margin for network/render jitter while ensuring a hung call resolves
to FetchErrorState instead of pinning the panel on stale data for the full
30s poll interval. Uses the timeoutMs option introduced in eed1228 for
GitHubStatus.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
g-butandClaude Opus 4.7 committed 2026-05-20 18:54:53 +02:00
1 parent 44f2db4c1e
commit 7ab00171be
1 file changed
+4 -1
+4 -1
View File
@@ -39,7 +39,10 @@ function UsageBar({ usedMiB, totalMiB }: { usedMiB: number; totalMiB: number })
}
export function SystemStats() {
const { data, loading, error, refetch } = useFetch<SystemData>("/api/system", { intervalMs: 30_000 });
// 10s ceiling = 2× the server's 5s runTool cap; covers network jitter while
// ensuring a hung /api/system call surfaces FetchErrorState instead of
// pinning the panel on stale data for the full 30s poll interval.
const { data, loading, error, refetch } = useFetch<SystemData>("/api/system", { intervalMs: 30_000, timeoutMs: 10_000 });
if (loading) {
return <div className="animate-pulse text-base text-text-secondary">Loading system status...</div>;