From dda8368b556c80c82385cded08708fb40eb15d24 Mon Sep 17 00:00:00 2001 From: zerone0x Date: Mon, 12 Jan 2026 17:30:00 +0800 Subject: [PATCH] fix(tui): handle JSON parse error on double-escape abort When aborting a session with double-escape, the abort races with the in-flight prompt request. If the response is incomplete or empty, the SDK's JSON parser throws "Unexpected end of JSON input". Adding .catch() silences this expected error during abort, matching the pattern used elsewhere for session.abort() calls. Fixes #7946 Co-Authored-By: Claude --- packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx index 644ac262241..24d877db76e 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -217,7 +217,7 @@ export function Prompt(props: PromptProps) { if (store.interrupt >= 2) { sdk.client.session.abort({ sessionID: props.sessionID, - }) + }).catch(() => {}) setStore("interrupt", 0) } dialog.clear()