From 450ed33f943c2e0f60c7e31ac65c0bb1736ba484 Mon Sep 17 00:00:00 2001 From: zeroaltitude Date: Tue, 3 Mar 2026 22:12:02 -0700 Subject: [PATCH] fix(browser): remove catch-block originalJson reference (block-scoped to try) originalJson is const inside the try block and not accessible from the catch block (tsgo correctly flags this, tsc was lenient). The inner try/catch around params.run() already restores res.json before re-throwing, so the outer catch doesn't need the restore. Fixes tsgo TS2304 in CI. --- src/browser/routes/agent.shared.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/browser/routes/agent.shared.ts b/src/browser/routes/agent.shared.ts index 33b15d23b45..4f4592c87a1 100644 --- a/src/browser/routes/agent.shared.ts +++ b/src/browser/routes/agent.shared.ts @@ -191,10 +191,6 @@ export async function withRouteTabContext( return result; } catch (err) { - // Ensure res.json is always restored for error handling. - if (params.res.json !== originalJson) { - params.res.json = originalJson; - } handleRouteError(params.ctx, params.res, err); return undefined; }