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

View File

@@ -0,0 +1,14 @@
{"timestamp":"2026-03-16T13:12:26.982Z","type":"hook_dispatch","event":"session-start","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:12:27.136Z","type":"hook_dispatch","event":"session-end","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:12:55.267Z","type":"hook_dispatch","event":"session-start","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:13:02.998Z","type":"hook_dispatch","event":"turn-complete","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:13:03.044Z","type":"hook_dispatch","event":"session-idle","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:13:03.086Z","type":"hook_dispatch","event":"session-end","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:13:57.316Z","type":"hook_dispatch","event":"session-start","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:13:57.478Z","type":"hook_dispatch","event":"session-end","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:14:41.828Z","type":"hook_dispatch","event":"session-start","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:16:55.853Z","type":"hook_dispatch","event":"session-end","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:17:04.654Z","type":"hook_dispatch","event":"session-start","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:29:23.473Z","type":"hook_dispatch","event":"turn-complete","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:29:23.521Z","type":"hook_dispatch","event":"session-idle","source":"native","enabled":false,"reason":"plugins_disabled"}
{"timestamp":"2026-03-16T13:29:23.698Z","type":"hook_dispatch","event":"session-end","source":"native","enabled":false,"reason":"plugins_disabled"}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
{"event":"session_start","session_id":"omx-1773666746913-dczsio","pid":4466,"timestamp":"2026-03-16T13:12:26.939Z","_ts":"2026-03-16T13:12:26.939Z"}
{"event":"session_end","session_id":"omx-1773666746913-dczsio","timestamp":"2026-03-16T13:12:27.102Z","_ts":"2026-03-16T13:12:27.102Z"}
{"event":"session_start","session_id":"omx-1773666775198-1ghyp3","pid":4691,"timestamp":"2026-03-16T13:12:55.225Z","_ts":"2026-03-16T13:12:55.225Z"}
{"event":"session_end","session_id":"omx-1773666775198-1ghyp3","timestamp":"2026-03-16T13:13:03.055Z","_ts":"2026-03-16T13:13:03.055Z"}
{"event":"session_start","session_id":"omx-1773666837247-7cn2dq","pid":5158,"timestamp":"2026-03-16T13:13:57.272Z","_ts":"2026-03-16T13:13:57.272Z"}
{"event":"session_end","session_id":"omx-1773666837247-7cn2dq","timestamp":"2026-03-16T13:13:57.445Z","_ts":"2026-03-16T13:13:57.445Z"}
{"event":"session_start","session_id":"omx-1773666881758-szlibo","pid":5323,"timestamp":"2026-03-16T13:14:41.785Z","_ts":"2026-03-16T13:14:41.785Z"}
{"event":"session_end","session_id":"omx-1773666881758-szlibo","timestamp":"2026-03-16T13:16:55.818Z","_ts":"2026-03-16T13:16:55.819Z"}
{"event":"session_start","session_id":"omx-1773667024582-sll3ve","pid":6324,"timestamp":"2026-03-16T13:17:04.611Z","_ts":"2026-03-16T13:17:04.611Z"}
{"event":"session_end","session_id":"omx-1773667024582-sll3ve","timestamp":"2026-03-16T13:29:23.663Z","_ts":"2026-03-16T13:29:23.664Z"}

View File

@@ -0,0 +1,5 @@
{"session_id":"omx-1773666746913-dczsio","started_at":"2026-03-16T13:12:26.939Z","ended_at":"2026-03-16T13:12:27.102Z","cwd":"/private/tmp/work-omx-sdk","pid":4466}
{"session_id":"omx-1773666775198-1ghyp3","started_at":"2026-03-16T13:12:55.225Z","ended_at":"2026-03-16T13:13:03.055Z","cwd":"/private/tmp/work-omx-sdk","pid":4691}
{"session_id":"omx-1773666837247-7cn2dq","started_at":"2026-03-16T13:13:57.272Z","ended_at":"2026-03-16T13:13:57.445Z","cwd":"/private/tmp/work-omx-sdk","pid":5158}
{"session_id":"omx-1773666881758-szlibo","started_at":"2026-03-16T13:14:41.785Z","ended_at":"2026-03-16T13:16:55.818Z","cwd":"/private/tmp/work-omx-sdk","pid":5323}
{"session_id":"omx-1773667024582-sll3ve","started_at":"2026-03-16T13:17:04.611Z","ended_at":"2026-03-16T13:29:23.663Z","cwd":"/private/tmp/work-omx-sdk","pid":6324}

View File

@@ -0,0 +1,2 @@
{"timestamp":"2026-03-16T13:13:02.970Z","type":"agent-turn-complete","thread_id":"019cf6c7-3179-7231-97d8-936fe86255ca","turn_id":"019cf6c7-3196-7350-9ec8-34792e3af0a4","input_preview":"[notify-fallback] synthesized from rollout task_complete","output_preview":""}
{"timestamp":"2026-03-16T13:29:23.441Z","type":"agent-turn-complete","thread_id":"019cf6ca-ff56-77e1-8a9c-9496e46fe1fd","turn_id":"019cf6ca-ff5f-7ec1-a90f-80f8344b7079","input_preview":"Fix all 16 cubic review issues on PR #2620. The issues are:\n\nP0:\n1. daemon.ts — pollLoop identity ch","output_preview":"Done.\n\nCommitted:\n- `c6449307` — `Fix OpenClaw review issues`\n\nChanged files:\n- `src/config/schema/openclaw.ts`\n- `src/hooks/openclaw.ts`\n- `src/hooks/openclaw.test.ts`\n- `src/openclaw/config.ts`\n- `s"}

10
.omx/metrics.json Normal file
View File

@@ -0,0 +1,10 @@
{
"total_turns": 1,
"session_turns": 1,
"last_activity": "2026-03-16T13:29:23.442Z",
"session_input_tokens": 0,
"session_output_tokens": 0,
"session_total_tokens": 0,
"five_hour_limit_pct": 0,
"weekly_limit_pct": 0
}

View File

@@ -0,0 +1,5 @@
{
"last_turn_at": "2026-03-16T13:29:23.442Z",
"turn_count": 1,
"last_agent_output": "Done.\n\nCommitted:\n- `c6449307` — `Fix OpenClaw review issues`\n\nChanged files:\n- `src/config/schema/o"
}

View File

@@ -0,0 +1,51 @@
{
"pid": 6327,
"parent_pid": 6324,
"started_at": "2026-03-16T13:17:04.668Z",
"cwd": "/private/tmp/work-omx-sdk",
"notify_script": "/private/var/folders/h6/w548ypzn1k78_xqndn63y7xc0000gn/T/bunx-501-oh-my-codex@latest/node_modules/oh-my-codex/scripts/notify-hook.js",
"poll_ms": 250,
"pid_file": "/private/tmp/work-omx-sdk/.omx/state/notify-fallback.pid",
"max_lifetime_ms": 21600000,
"tracked_files": 1,
"seen_turns": 0,
"dispatch_drain": {
"enabled": true,
"max_per_tick": 5,
"run_count": 2898,
"leader_only": true,
"last_tick_at": "2026-03-16T13:29:23.500Z",
"last_result": {
"processed": 0,
"skipped": 0,
"failed": 0
},
"last_error": null
},
"leader_nudge": {
"enabled": true,
"run_count": 2898,
"leader_only": true,
"stale_threshold_ms": 180000,
"precomputed_leader_stale": false,
"last_tick_at": "2026-03-16T13:29:23.501Z",
"last_error": null
},
"ralph_continue_steer": {
"enabled": true,
"cadence_ms": 60000,
"message": "Ralph loop active continue",
"active": false,
"last_state_check_at": "2026-03-16T13:29:23.502Z",
"last_sent_at": "",
"last_reason": "cleared",
"last_error": null,
"state_path": "",
"pane_id": "",
"pane_current_command": "",
"current_phase": ""
},
"stop_reason": "signal",
"stop_signal": "SIGTERM",
"stopping": true
}

View File

@@ -0,0 +1,7 @@
{
"recent_turns": {
"019cf6c7-3179-7231-97d8-936fe86255ca|019cf6c7-3196-7350-9ec8-34792e3af0a4|agent-turn-complete": 1773666782969,
"019cf6ca-ff56-77e1-8a9c-9496e46fe1fd|019cf6ca-ff5f-7ec1-a90f-80f8344b7079|agent-turn-complete": 1773667763439
},
"last_event_at": "2026-03-16T13:29:23.440Z"
}

View File

@@ -0,0 +1,11 @@
{
"version": 1,
"active": false,
"skill": "cancel",
"keyword": "stop",
"phase": "completing",
"activated_at": "2026-03-16T13:29:23.526Z",
"updated_at": "2026-03-16T13:29:23.527Z",
"source": "keyword-detector",
"input_lock": null
}

View File

@@ -0,0 +1,5 @@
{
"last_nudged_by_team": {},
"last_idle_nudged_by_team": {},
"progress_by_team": {}
}

View File

@@ -0,0 +1,9 @@
{
"total_injections": 0,
"pane_counts": {},
"session_counts": {},
"recent_keys": {},
"last_injection_ts": 0,
"last_reason": "disabled",
"last_event_at": "2026-03-16T13:29:23.442Z"
}

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",

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)
}
},

View File

@@ -60,7 +60,8 @@ describe("OpenClaw Dispatcher", () => {
process.env.OMO_OPENCLAW_COMMAND_TIMEOUT_MS = "4321"
try {
expect(resolveCommandTimeoutMs(undefined, process.env.OMO_OPENCLAW_COMMAND_TIMEOUT_MS)).toBe(4321)
// Call without explicit envTimeoutRaw so the function reads from process.env itself
expect(resolveCommandTimeoutMs(undefined)).toBe(4321)
} finally {
if (original === undefined) delete process.env.OMO_OPENCLAW_COMMAND_TIMEOUT_MS
else process.env.OMO_OPENCLAW_COMMAND_TIMEOUT_MS = original