From 0cbc6b541032e2b098a0719a063927ba050abbd6 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 23 Feb 2026 02:42:26 +0900 Subject: [PATCH] fix(hooks/session-recovery): replace @ts-expect-error with proper type cast Add ClientWithPromptAsync local type to avoid @ts-expect-error Cast client to proper type before calling session.promptAsync Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- .../session-recovery/recover-tool-result-missing.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hooks/session-recovery/recover-tool-result-missing.ts b/src/hooks/session-recovery/recover-tool-result-missing.ts index a1121fc6..4d19880b 100644 --- a/src/hooks/session-recovery/recover-tool-result-missing.ts +++ b/src/hooks/session-recovery/recover-tool-result-missing.ts @@ -5,6 +5,12 @@ import { isSqliteBackend } from "../../shared/opencode-storage-detection" import { normalizeSDKResponse } from "../../shared" type Client = ReturnType +type ClientWithPromptAsync = { + session: { + promptAsync: (opts: { path: { id: string }; body: Record }) => Promise + } +} + interface ToolUsePart { type: "tool_use" @@ -77,8 +83,7 @@ export async function recoverToolResultMissing( } try { - // @ts-expect-error - SDK types may not include tool_result parts - await client.session.promptAsync(promptInput) + await (client as unknown as ClientWithPromptAsync).session.promptAsync(promptInput) return true } catch {