fix(plugin): harden metadata recovery and extraction

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-04-16 13:52:12 +09:00
parent 80d3339c4c
commit 4da3005797
7 changed files with 158 additions and 75 deletions
+18
View File
@@ -78,6 +78,24 @@ describe("createTaskResumeInfoHook", () => {
})
})
describe("#given target tool with session metadata object", () => {
describe("#when output text omits session ID but metadata includes it", () => {
it("#then should append resume info from metadata", async () => {
const input = createInput("task")
const output = {
title: "task",
output: "Task completed successfully",
metadata: { sessionID: "ses_meta_123" },
}
await afterHook(input, output)
expect(output.output).toContain("to continue:")
expect(output.output).toContain("ses_meta_123")
})
})
})
describe("#given target tool with error output", () => {
describe("#when output starts with Error:", () => {
it("#then should not modify output", async () => {