mirror of
https://github.com/coleam00/Archon
synced 2026-04-21 13:37:41 +00:00
fix: initialize options.hooks before merging YAML node hooks (#1177)
Some checks are pending
E2E Smoke Tests / e2e-codex (push) Waiting to run
E2E Smoke Tests / e2e-claude (push) Waiting to run
E2E Smoke Tests / e2e-deterministic (push) Waiting to run
E2E Smoke Tests / e2e-mixed (push) Blocked by required conditions
Test Suite / test (ubuntu-latest) (push) Waiting to run
Test Suite / test (windows-latest) (push) Waiting to run
Test Suite / docker-build (push) Waiting to run
Some checks are pending
E2E Smoke Tests / e2e-codex (push) Waiting to run
E2E Smoke Tests / e2e-claude (push) Waiting to run
E2E Smoke Tests / e2e-deterministic (push) Waiting to run
E2E Smoke Tests / e2e-mixed (push) Blocked by required conditions
Test Suite / test (ubuntu-latest) (push) Waiting to run
Test Suite / test (windows-latest) (push) Waiting to run
Test Suite / docker-build (push) Waiting to run
When a workflow node defines hooks (PreToolUse/PostToolUse) in YAML but
no hooks exist yet on the options object, applyNodeConfig crashes with
"undefined is not an object" because it tries to assign properties on
the undefined options.hooks.
Initialize options.hooks to {} before the merge loop.
Reproduces with: archon workflow run archon-architect (which uses
per-node hooks extensively).
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ba4b9b47e6
commit
7ea321419f
1 changed files with 3 additions and 0 deletions
|
|
@ -382,6 +382,9 @@ async function applyNodeConfig(
|
|||
if (Object.keys(builtHooks).length > 0) {
|
||||
// Merge with existing hooks (PostToolUse capture hook)
|
||||
const existingHooks = options.hooks as SDKHooksMap | undefined;
|
||||
if (!options.hooks) {
|
||||
(options as Record<string, unknown>).hooks = {};
|
||||
}
|
||||
for (const [event, matchers] of Object.entries(builtHooks)) {
|
||||
if (!matchers) continue;
|
||||
const existing = existingHooks?.[event] as HookCallbackMatcher[] | undefined;
|
||||
|
|
|
|||
Loading…
Reference in a new issue