From bf5b827f2f48b7eea56a9154873a3005ca9544da Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Tue, 17 Mar 2026 11:11:58 +0200 Subject: [PATCH] add timeout to TsClient diagnostic wait --- packages/opencode/src/kilocode/ts-client.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/kilocode/ts-client.ts b/packages/opencode/src/kilocode/ts-client.ts index b88bbb52e66..dd4ebc1bf3f 100644 --- a/packages/opencode/src/kilocode/ts-client.ts +++ b/packages/opencode/src/kilocode/ts-client.ts @@ -6,6 +6,7 @@ import type { LSPClient } from "../lsp/client" import { TsCheck } from "./ts-check" import { Log } from "../util/log" +import { withTimeout } from "../util/timeout" import path from "path" import { Instance } from "../project/instance" @@ -71,7 +72,9 @@ export namespace TsClient { }, async waitForDiagnostics(_input: { path: string }) { // Run tsgo --noEmit and wait for results. Coalesces concurrent calls. - await check() + // 30s cap matches the process timeout in TsCheck.run(). Silent catch + // matches the real LSPClient's .catch(() => {}) on its 3s timeout. + await withTimeout(check(), 30_000).catch(() => {}) }, async shutdown() { log.info("shutting down ts-client")