Skip to content

Commit 88785d6

Browse files
zerone0xclaude
andcommitted
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 anomalyco#7946 Co-Authored-By: Claude <[email protected]>
1 parent 03fb824 commit 88785d6

File tree

1 file changed

+1
-1
lines changed
  • packages/opencode/src/cli/cmd/tui/component/prompt

1 file changed

+1
-1
lines changed

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export function Prompt(props: PromptProps) {
217217
if (store.interrupt >= 2) {
218218
sdk.client.session.abort({
219219
sessionID: props.sessionID,
220-
})
220+
}).catch(() => {})
221221
setStore("interrupt", 0)
222222
}
223223
dialog.clear()

0 commit comments

Comments
 (0)