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:
parent
ac3a9fd272
commit
0cbc6b5410
@ -5,6 +5,12 @@ import { isSqliteBackend } from "../../shared/opencode-storage-detection"
|
|||||||
import { normalizeSDKResponse } from "../../shared"
|
import { normalizeSDKResponse } from "../../shared"
|
||||||
|
|
||||||
type Client = ReturnType<typeof createOpencodeClient>
|
type Client = ReturnType<typeof createOpencodeClient>
|
||||||
|
type ClientWithPromptAsync = {
|
||||||
|
session: {
|
||||||
|
promptAsync: (opts: { path: { id: string }; body: Record<string, unknown> }) => Promise<unknown>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
interface ToolUsePart {
|
interface ToolUsePart {
|
||||||
type: "tool_use"
|
type: "tool_use"
|
||||||
@ -77,8 +83,7 @@ export async function recoverToolResultMissing(
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// @ts-expect-error - SDK types may not include tool_result parts
|
await (client as unknown as ClientWithPromptAsync).session.promptAsync(promptInput)
|
||||||
await client.session.promptAsync(promptInput)
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user