Coverage for little_loops / hooks / post_tool_use.py: 100%
5 statements
« prev ^ index » next coverage.py v7.12.0, created at 2026-05-22 16:19 -0500
« prev ^ index » next coverage.py v7.12.0, created at 2026-05-22 16:19 -0500
1"""PostToolUse hook handler: no-op baseline for fire-and-forget observability.
3Per FEAT-1489, this handler is wired as the post-tool-use intent on Codex and
4OpenCode so future consumers (audit logging, token budgeting, rate-limit
5enforcement) have a stable registration point. Today it returns a passing
6result with no side effects — the no-op baseline matches ``session_start``'s
7``exit_code=0`` convention rather than ``pre_compact``'s ``exit_code=2``
8block-and-inject pattern.
10Fire-and-forget semantics are achieved through handler speed (<200ms p95
11no-op) on the Codex blocking-shim adapter (≤5s timeout) and through the
12no-await invocation pattern on the OpenCode adapter. The handler itself
13does not background or spawn anything.
14"""
16from __future__ import annotations
18from little_loops.hooks.types import LLHookEvent, LLHookResult
21def handle(event: LLHookEvent) -> LLHookResult:
22 """Return a passing result. No-op baseline for future consumers."""
23 del event
24 return LLHookResult(exit_code=0)