fix: address cubic re-review — remove non-existent session.stop event, fix env var fallback test

This commit is contained in:
YeonGyu-Kim
2026-03-17 17:00:18 +09:00
parent c644930753
commit 82e25c845b
15 changed files with 7086 additions and 6 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ describe("createOpenClawHook", () => {
wakeOpenClawMock.mockClear()
})
test("maps session.stop events to stop", async () => {
test("maps session.created to session-start", async () => {
const { createOpenClawHook } = await import("./openclaw")
const hook = createOpenClawHook(
{ directory: "/tmp/project" } as any,
@@ -20,14 +20,14 @@ describe("createOpenClawHook", () => {
await hook?.event?.({
event: {
type: "session.stop",
type: "session.created",
properties: { sessionID: "session-1" },
},
})
expect(wakeOpenClawMock).toHaveBeenCalledWith(
expect.anything(),
"stop",
"session-start",
expect.objectContaining({
projectPath: "/tmp/project",
sessionId: "session-1",
-2
View File
@@ -34,8 +34,6 @@ export function createOpenClawHook(
// This is heuristic. If the last message was from assistant and ended with a question?
// Or if the system is idle.
await handleWake("session-idle", context)
} else if (event.type === "session.stop") {
await handleWake("stop", context)
}
},