Bug Description
Hook dependency installation can run inside the short PreToolUse execution window, which makes setup flaky. The correct package fix is to eagerly bootstrap hook environments before registering the hooks.
Environment
- OS: Darwin 24.5.0
- Shell: zsh
- Git: 2.39.5
- agentic-config: 0.3.2
Steps to Reproduce
- Activate pi-ac-safety hooks that declare UV script dependencies (e.g. pyyaml).
- Trigger a tool call that runs PreToolUse.
- Observe dependency bootstrap competing with the ~5s PreToolUse timeout path.
Expected Behavior
Hook environments are bootstrapped during pi-ac-safety activation (before tool hooks are enabled), so PreToolUse only runs already-prepared hooks. Bootstrap failures surface actionable stderr details.
Actual Behavior
Dependency installation can occur on the PreToolUse path, risking timeouts/failures without clear setup diagnostics.
Proposed Fix
- During pi-ac-safety activation, run each hook once with a 60-second setup timeout:
uv run --no-project --script <hook.py>
using a harmless empty payload.
- Wait for bootstrap completion before enabling tool hooks.
- Pin the dependency:
dependencies = ["pyyaml==6.0.3"]
- Update
pi-compat/extensions/hook-compat/runtime.js to include error.details.stderr when bootstrap fails.
This keeps dependency installation out of the 5-second PreToolUse execution path and gives an actionable error if setup genuinely fails.
Reported via /skill:ac-tools-ac-issue command
Bug Description
Hook dependency installation can run inside the short PreToolUse execution window, which makes setup flaky. The correct package fix is to eagerly bootstrap hook environments before registering the hooks.
Environment
Steps to Reproduce
Expected Behavior
Hook environments are bootstrapped during pi-ac-safety activation (before tool hooks are enabled), so PreToolUse only runs already-prepared hooks. Bootstrap failures surface actionable stderr details.
Actual Behavior
Dependency installation can occur on the PreToolUse path, risking timeouts/failures without clear setup diagnostics.
Proposed Fix
pi-compat/extensions/hook-compat/runtime.jsto includeerror.details.stderrwhen bootstrap fails.This keeps dependency installation out of the 5-second PreToolUse execution path and gives an actionable error if setup genuinely fails.
Reported via
/skill:ac-tools-ac-issuecommand