@devries-cameron20 / t3code Mirror · read-only / commits / c8c210203c
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 21, 12:15 UTC

fix(server): log canceled relay requests at debug level (#32215)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Sudharsan committed Nov 15, 2026 at 10:09 UTC c8c210203c48875a1249b1f6d299a43a1f220835
2 files changed +23
apps/server/src/cloud/ManagedEndpointRuntime.test.ts
+15
@@ -180,6 +180,21 @@ describe("CloudManagedEndpointRuntime", () => {
180 expect(
181 ManagedEndpointRuntime.classifyRelayClientOutput("2026-06-17T02:00:00Z PNC runtime panic"),
182 ).toBe("warning");
183 + for (const prefix of ["", "Request failed "]) {
184 + expect(
185 + ManagedEndpointRuntime.classifyRelayClientOutput(
186 + `2026-06-17T02:00:00Z ERR ${prefix}error="Incoming request ended abruptly: context canceled" connIndex=0`,
187 + ),
188 + ).toBe("debug");
189 + }
190 + for (const line of [
191 + '2026-06-17T02:00:00Z ERR error="Incoming request ended abruptly: context deadline exceeded" connIndex=0',
192 + '2026-06-17T02:00:00Z ERR Failed to serve tunnel connection error="context canceled"',
193 + '2026-06-17T02:00:00Z FTL error="Incoming request ended abruptly: context canceled"',
194 + '2026-06-17T02:00:00Z PNC error="Incoming request ended abruptly: context canceled"',
195 + ]) {
196 + expect(ManagedEndpointRuntime.classifyRelayClientOutput(line)).toBe("warning");
197 + }
198 });
199
200 it("classifies connection unregistration apart from registration and routine output", () => {
apps/server/src/cloud/ManagedEndpointRuntime.ts
+8
@@ -168,6 +168,14 @@ export function classifyRelayClientOutput(
168 if (/\bRegistered tunnel connection\b/iu.test(line)) {
169 return "connected";
170 }
171 + // cloudflared logs a browser closing its request mid-stream as ERR; the tunnel itself is fine.
172 + if (
173 + /\bERR\s+(?:Request failed\s+)?error="Incoming request ended abruptly: context canceled"(?:\s|$)/u.test(
174 + line,
175 + )
176 + ) {
177 + return "debug";
178 + }
179 // cloudflared uses zerolog FTL/PNC for fatal/panic; classify them above debug too.
180 if (/\b(?:ERR|WRN|FTL|PNC)\b/u.test(line)) {
181 return "warning";