test(hooks): remove unsafe test assertions

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-12 14:22:05 +09:00
parent 11b3638493
commit 23211159c9
37 changed files with 242 additions and 232 deletions
@@ -11,6 +11,10 @@ type ClientWithPromptAsync = {
}
}
function hasPromptAsync(client: Client): client is Client & ClientWithPromptAsync {
return "promptAsync" in client.session && typeof client.session.promptAsync === "function"
}
interface ToolUsePart {
type: "tool_use"
@@ -111,7 +115,11 @@ export async function recoverToolResultMissing(
}
try {
await (client as unknown as ClientWithPromptAsync).session.promptAsync(promptInput)
if (!hasPromptAsync(client)) {
return false
}
await client.session.promptAsync(promptInput)
return true
} catch {
@@ -13,7 +13,7 @@ function createMockClient(handlers: {
messages?: (sessionID: string) => unknown[]
message?: (sessionID: string, messageID: string) => unknown
}) {
return {
return testCoerce({
session: {
messages: async (opts: { path: { id: string } }) => {
if (handlers.messages) {
@@ -28,7 +28,7 @@ function createMockClient(handlers: {
throw new Error("not implemented")
},
},
} as unknown
})
}
describe("session-recovery storage SDK readers", () => {