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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user