tests: fill critical-path coverage gaps
- loop.go: rate-limit retry (retryCountdown 100%), pre-tool cancellation,
ChatStream+ctx-cancel (recordInterruption "request"), exec-cancel with
pending inject
- executeTurn: startup messages, backend error event, auto-compact with
preCompact/postCompact hook context injection
- session: compact backend error, empty summary, tool-message flattening
- handleCommand: /compact while running/nil-session/preHook-blocks,
/clear while running, /agents with files
- hooks: non-zero exit code (non-blocking), context cancellation
- accessors: AgentName, BackendName, ModelName, SystemPrompt,
GenerationParams (get+set), ListModels, CtxSz, Usage
- SetSessionID rename and same-ID no-op
- autoCompactLimit with zero ctxLen, agentSpawn with context output,
hooksRan plural branch
55.2% → 73.7% total; executeTurn 87.7%→98.6%, run 62.7%→93.1%,
retryCountdown 0%→100%, compact 84.2%→94.7%
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>