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 <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-02-23 02:42:26 +09:00
parent ac3a9fd272
commit 0cbc6b5410

View File

@@ -5,6 +5,12 @@ import { isSqliteBackend } from "../../shared/opencode-storage-detection"
import { normalizeSDKResponse } from "../../shared"
type Client = ReturnType<typeof createOpencodeClient>
type ClientWithPromptAsync = {
session: {
promptAsync: (opts: { path: { id: string }; body: Record<string, unknown> }) => Promise<unknown>
}
}
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 {