feat: upgrade hook system with multi-executor types, structured output, and event telemetry#75
Merged
yishuiliunian merged 2 commits intomainfrom Apr 4, 2026
Merged
Conversation
…t, and event telemetry Upgrade the hook system from shell-command-only to a full Harness Hook architecture supporting Command/HTTP/Prompt executor types, structured output interpretation, condition-based matching with glob expressions, cross-layer dedup, configurable agent control-loop thresholds, and per-turn event telemetry with causality tracking. Key changes: - HookExecutor trait + CommandExecutor/HttpExecutor/PromptExecutor - HookService as single orchestration entry point - 8 hook events fully wired (PreToolUse, PostToolUse, PreRequest, PostInput, Stop, SessionStart, SessionEnd, PreCompact) - HookOutput structured protocol with permission/context/input override - Condition expressions: "Bash(git push*)", "Write(*.rs)", "Tool1|Tool2" - HarnessConfig for loop/circuit-breaker/stop-feedback thresholds - AgentEvent gains event_id, turn_id, correlation_id fields - TurnCompleted event with aggregated metrics - AsyncHookStore + rewake channel infrastructure (prepared, not yet activated)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
New files (19):
loopal-hooks: executor.rs, executor_command.rs, executor_http.rs, executor_prompt.rs, output.rs, input.rs, service.rs, async_store.rs + 3 test filesloopal-config: harness.rs, hook_condition.rs, resolver_hooks_test.rsloopal-kernel: hook_factory.rsloopal-protocol: event_id.rs, event_payload.rsloopal-runtime: turn_metrics.rs, fire_hooks.rsModified files (60):
Test plan
bazel build //...passesbazel test //...— 48/48 tests passbazel build //... --config=clippy— zero warnings