feat(coding-agent): session_before_refine extension hook (#1558) master
* feat(coding-agent): session_before_refine extension hook Let extensions customize continual-harness refinement the same way session_before_compact customizes compaction. The hook fires before the planning LLM call for /refine and auto-refine with the planning inputs (trigger, instructions, scope, planning harness state, refinement history, serialized conversation). An extension can return a RefinementProposal to replace the built-in planner (edits still pass apply-time validation and baseline conflict rejection), return { skip: true } to suppress the round, or return nothing to fall back to the default planner. Rollback refinements bypass the hook. Includes examples/extensions/custom-refinement.ts (planning with a cheaper model, covering discussion #1464) and documents the existing refine_complete event. * Update queue-test refine call assertions for the trigger argument * Propagate the auto trigger and skip semantics through serialized refine paths Serialized auto-refine now reaches session_before_refine with trigger "auto", an extension skip there stamps the cooldown without emitting refine_failed, and a skipped explicit refine.run surfaces the RefineSkippedError instead of passing as a silent reviewer decline. The example planner now labels entry ids with their scope and tells the model other-scope entries are read-only. * fix(coding-agent): consume skipped auto-refine rounds * fix(coding-agent): report skipped refine during disposal * fix(coding-agent): normalize extension refine proposals --------- Co-authored-by: Seth <seth@primeintellect.ai>