fix(session-recovery): fallback when stored unavailable-tool parts are absent
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -13,6 +13,10 @@ mock.module("./storage", () => ({
|
||||
readParts: () => storedParts,
|
||||
}))
|
||||
|
||||
mock.module("./storage/parts-reader", () => ({
|
||||
readParts: () => storedParts,
|
||||
}))
|
||||
|
||||
const { recoverUnavailableTool } = await import("./recover-unavailable-tool")
|
||||
|
||||
const failedAssistantMsg: MessageData = {
|
||||
@@ -82,7 +86,10 @@ describe("recoverUnavailableTool", () => {
|
||||
tool: "bash",
|
||||
state: { input: {} },
|
||||
}]
|
||||
const { client, promptAsync } = createMockClient()
|
||||
const { client, promptAsync } = createMockClient([{
|
||||
info: { id: "msg_failed", role: "assistant" },
|
||||
parts: [{ type: "tool", id: "prt_stored_valid_call", callID: "toolu_recovered", name: "bash", input: {} }],
|
||||
}])
|
||||
|
||||
//#when
|
||||
const result = await recoverUnavailableTool(client, "ses_2", failedAssistantMsg)
|
||||
|
||||
Reference in New Issue
Block a user