const COMPACTION_STARTED_TIMEOUT: Duration;Expand description
Fail-fast timeout for publish_compaction_started specifically —
much shorter than the 5s client-wide default used for tool_chunk
streaming (from_env). That default is fine for exec’s own async
runtime, but precompact is invoked as Claude Code’s SYNCHRONOUS
PreCompact hook: the CLI blocks compaction on this process’s exit,
so inheriting the 5s default means a wedged (but TCP-accepting)
backend delays the user’s actual compaction by up to 5 real seconds —
directly contradicting this hook’s own “never block/delay the
operation for observability” contract (see precompact.rs’s module
doc comment). Codex P2, PR #2378 round 4. 500ms comfortably covers a
normal same-host round trip while keeping the worst case imperceptible.