@devries-cameron20 / t3code Mirror · read-only / commits / 069e63b117
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 22, 22:00 UTC

fix(web): VCS status refresh no longer trips the slow-request toast (#22159)

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

Theo Browne committed Oct 19, 2026 at 23:39 UTC 069e63b11758c803a064e5515b4485f43147ac28
2 files changed +22 -16
apps/web/src/rpc/requestLatencyState.test.ts
+16 -13
@@ -80,20 +80,23 @@ describe("requestLatencyState", () => {
80 expect(getSlowRpcAckRequests()).toEqual([]);
81 });
82
83 - it("gives provider updates a longer threshold before warning", () => {
84 - trackRpcRequestSent("1", WS_METHODS.serverUpdateProvider, "server.updateProvider · env-1");
85 - vi.advanceTimersByTime(LONG_RUNNING_RPC_ACK_THRESHOLD_MS - 1);
86 - expect(getSlowRpcAckRequests()).toEqual([]);
83 + it.each([WS_METHODS.serverUpdateProvider, WS_METHODS.vcsRefreshStatus])(
84 + "gives %s a longer threshold before warning",
85 + (method) => {
86 + trackRpcRequestSent("1", method, `${method} · env-1`);
87 + vi.advanceTimersByTime(LONG_RUNNING_RPC_ACK_THRESHOLD_MS - 1);
88 + expect(getSlowRpcAckRequests()).toEqual([]);
89
88 - vi.advanceTimersByTime(1);
89 - expect(getSlowRpcAckRequests()).toMatchObject([
90 - {
91 - requestId: "1",
92 - tag: "server.updateProvider · env-1",
93 - thresholdMs: LONG_RUNNING_RPC_ACK_THRESHOLD_MS,
94 - },
95 - ]);
96 - });
90 + vi.advanceTimersByTime(1);
91 + expect(getSlowRpcAckRequests()).toMatchObject([
92 + {
93 + requestId: "1",
94 + tag: `${method} · env-1`,
95 + thresholdMs: LONG_RUNNING_RPC_ACK_THRESHOLD_MS,
96 + },
97 + ]);
98 + },
99 + );
100
101 it("evicts the oldest pending requests once the tracker reaches capacity", () => {
102 for (let index = 0; index < MAX_TRACKED_RPC_ACK_REQUESTS + 1; index += 1) {
apps/web/src/rpc/requestLatencyState.ts
+6 -3
@@ -6,9 +6,11 @@ import { appAtomRegistry } from "./atomRegistry";
6
7 export const SLOW_RPC_ACK_THRESHOLD_MS = 15_000;
8 /**
9 - * Some requests are slow by design — they shell out to a package manager on the
10 - * server and only respond once the install finishes. Warning about those after
11 - * 15s is noise, so they get a much longer leash.
9 + * Some requests are slow by design. Provider and server updates shell out to a
10 + * package manager and only respond once the install finishes. A VCS status
11 + * refresh fetches, may auto-pull, looks up the pull request, and first waits for
12 + * any background refresh of the same repository, which often totals over 15s.
13 + * Warning about those after 15s is noise, so they get a much longer leash.
14 */
15 export const LONG_RUNNING_RPC_ACK_THRESHOLD_MS = 120_000;
16 export const MAX_TRACKED_RPC_ACK_REQUESTS = 256;
@@ -33,6 +35,7 @@ const longRunningRpcAckMethods = new Set<string>([
35 WS_METHODS.serverUpdateProvider,
36 WS_METHODS.serverRefreshProviders,
37 WS_METHODS.serverUpdateServer,
38 + WS_METHODS.vcsRefreshStatus,
39 ]);
40
41 const slowRpcAckRequestsAtom = Atom.make<ReadonlyArray<SlowRpcAckRequest>>([]).pipe(