fix(plugin): verify event hook compatibility with v1.4.0

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-08 13:08:03 +09:00
parent e52dd340c6
commit 78e6d780eb
15 changed files with 383 additions and 28 deletions
@@ -52,6 +52,30 @@ describe("getLastAgentFromSession SQLite backend ordering", () => {
expect(result).toBe("sisyphus-junior")
})
test("skips compaction marker user messages that retain the original agent", async () => {
// given
const client = {
session: {
messages: async () => ({
data: [
{ id: "msg_real", info: { agent: "sisyphus", time: { created: 100 } } },
{
id: "msg_compaction",
info: { agent: "atlas", time: { created: 200 } },
parts: [{ type: "compaction" }],
},
],
}),
},
}
// when
const result = await getLastAgentFromSession("ses_sqlite_compaction_marker", client as never)
// then
expect(result).toBe("sisyphus")
})
test("returns null instead of throwing when SQLite message lookup fails", async () => {
// given
const client = {