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
@@ -90,6 +90,17 @@ describe("extractSessionIdFromMetadata", () => {
expect(result).toBe("ses_plugin_abc123")
})
test("extracts legacy session aliases from tool metadata object", () => {
// given
const metadata = { sessionID: "ses_plugin_alias_123" }
// when
const result = extractSessionIdFromMetadata(metadata)
// then
expect(result).toBe("ses_plugin_alias_123")
})
test("returns undefined for metadata without sessionId", () => {
// given
const metadata = { title: "some task" }