{"record":{"id":"c46f78846d2a502a","repo":"gastownhall/beads","slug":"unsupported-codex-hook-event-q","errorCode":null,"errorMessage":"unsupported Codex hook event %q","messagePattern":"unsupported Codex hook event %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/codex_hook.go","lineNumber":87,"sourceCode":"\t}\n\tif input.HookEventName != \"\" {\n\t\tevent = input.HookEventName\n\t}\n\n\tctx, cancel := context.WithTimeout(ctx, 30*time.Second)\n\tdefer cancel()\n\n\tswitch event {\n\tcase codexHookSessionStart:\n\t\treturn codexHookInjectPrime(ctx, stdout, codexHookSessionStart)\n\tcase codexHookPreCompact:\n\t\treturn codexHookPreCompactCheck(ctx, stdout)\n\tcase codexHookPostCompact:\n\t\treturn codexHookMarkNeedsRefresh(input)\n\tcase codexHookUserPromptSubmit:\n\t\treturn codexHookMaybeRefresh(ctx, input, stdout)\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported Codex hook event %q\", event)\n\t}\n}\n\nfunc codexHookInjectPrime(ctx context.Context, stdout io.Writer, event string) error {\n\tout, err := codexHookExecPrime(ctx, false)\n\tif err != nil || strings.TrimSpace(out) == \"\" {\n\t\treturn nil\n\t}\n\treturn writeCodexHookAdditionalContext(stdout, event, out)\n}\n\nfunc codexHookPreCompactCheck(ctx context.Context, stdout io.Writer) error {\n\tif _, err := codexHookExecPrime(ctx, true); err != nil {\n\t\treturn writeCodexHookSystemMessage(stdout, fmt.Sprintf(\"Beads context check failed before compaction: %v\", err))\n\t}\n\treturn nil\n}\n","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/codex_hook.go#L69-L105","documentation":"The Codex hook dispatcher received a hook event name it doesn't recognize. Only a fixed set of events (session-start, pre-compact, post-compact, user-prompt-submit) is supported; anything else is rejected.","triggerScenarios":"Codex invokes the hook binary with an event name outside the supported set — a newer Codex version added an event the installed bd doesn't know, a misconfigured hook entry passes the wrong event string, or hooks are wired with a typo.","commonSituations":"Upgraded Codex CLI emitting new hook events while bd is older; hand-edited Codex config with a misspelled event name; copying hook config from docs for a different version.","solutions":["Upgrade bd to the latest version so new Codex hook events are recognized","Check the Codex hooks configuration and correct the event name spelling","If the event is genuinely unsupported, remove or ignore that hook entry","Verify the hook wiring passes the event as the expected argument/format"],"exampleFix":"// before\nevent = \"session_start\"   // wrong format\n// after\nevent = \"session-start\"   // supported: session-start, pre-compact, post-compact, user-prompt-submit","handlingStrategy":"validation","validationCode":"// allowlist supported events before invoking\nSUPPORTED=\"session-start pre-compact post-compact user-prompt-submit\"\ncase \"$EVENT\" in session-start|pre-compact|post-compact|user-prompt-submit) ;; *) exit 0;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep bd updated alongside Codex CLI upgrades","Don't hand-edit Codex hook config; copy from version-matched docs","Log unknown events to catch new Codex event names early","Pin Codex + bd versions together"],"tags":["codex","hooks","cli"],"backgroundTag":"unsupported-hook-event","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}