mirror of
https://fastgit.cc/github.com/Yeachan-Heo/oh-my-claudecode
synced 2026-04-21 05:12:30 +08:00
The deployed scripts/keyword-detector.mjs still listed "autonomous" in the
autopilot trigger regex, even though src/hooks/keyword-detector/index.ts
and templates/hooks/keyword-detector.mjs both removed it some time ago.
Because "autonomous" is extremely common in technical/research prose
("autonomous driving", "autonomous agent", "autonomous system"), the
UserPromptSubmit hook was silently creating autopilot-state.json on
completely unrelated prompts. The Stop hook (persistent-mode.mjs) then
treated autopilot as active and forced the assistant into a
"[AUTOPILOT - Phase: unspecified] Autopilot not complete. Continue working."
block loop that the user could not easily escape — state_clear from the
cancel skill did not target the per-project state path and the Stop hook
kept refreshing it.
Reproduction (before this patch):
echo '{"hook_event_name":"UserPromptSubmit","cwd":"'"$(pwd)"'",
"session_id":"x","prompt":"DriveVLA-W0: World Models Amplify Data
Scaling Law in Autonomous Driving"}' | node scripts/keyword-detector.mjs
-> emits [MAGIC KEYWORD: AUTOPILOT] and writes
.omc/state/sessions/x/autopilot-state.json
After the patch the same prompt returns
{"continue":true,"suppressOutput":true} and no state file is created,
while an explicit "autopilot build a todo CLI" prompt still triggers
autopilot as expected.
Changes:
- scripts/keyword-detector.mjs: drop "autonomous" from the autopilot
regex; add a comment explaining why, pointing at the already-aligned
TS source and templates mjs.
- src/__tests__/keyword-detector-script.test.ts: add two regression
tests — one negative ("Autonomous Driving" paper title must not
activate autopilot state) and one positive control (explicit
"autopilot ..." still writes state and emits the magic keyword).