fix: address cubic re-review — remove non-existent session.stop event, fix env var fallback test
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user