name: "Hooks Lifecycle (PreToolCall / PostToolCall)"
description: >
Verify the hook system works end-to-end:
--hook-timing flag enables ToolTimingHook (prints tool durations to
stderr), and hooks don't block normal execution — file creation still
succeeds.
sequential: true
setup:
- name: "Prepare workspace"
exec:
container: recursive-e2e
command: |
rm -rf /workspace/test-hooks
mkdir -p /workspace/test-hooks
echo prepared
- name: "Run agent with --hook-timing (act)"
exec:
container: recursive-e2e
command: >
recursive --workspace /workspace/test-hooks
--api-base http://aimock:4010/v1
--api-key mock-key -m mock-chat
--max-steps 5
--hook-timing
run "Write file hook-test.txt with content hook-ok"
cases:
- name: "hook-test.txt was created (hook did not block tool execution)"
file:
container: recursive-e2e
path: /workspace/test-hooks/hook-test.txt
exists: true
contains: "hook-ok"
- name: "Session recorded write_file tool call"
recursive-session:
container: recursive-e2e
input: /workspace/test-hooks/.recursive/sessions
status: ["completed", "success"]
hasToolCalls: ["write_file"]
minMessages: 2
teardown:
- name: "Clean workspace"
ignoreError: true
exec:
container: recursive-e2e
command: rm -rf /workspace/test-hooks