fix(ci): allow out-of-repo paths through the agent hook pre-check (#1993)
* fix(ci): allow out-of-repo paths through the agent hook pre-check The pre hook treated every path that normalizes outside the repository as "cannot determine edited paths" and blocked the tool call with exit 2. That blocked agent writes to user settings and session scratchpad files - paths that cannot be the generated file this guard protects. A payload with extractable paths that all resolve outside the repo now passes; only a payload with no extractable path at all is refused. * fix(ci): refuse empty path candidates in the agent hook pre-check An empty or whitespace file_path made rawPaths non-empty while every candidate normalized to null, so the out-of-repo allowance would have passed a payload with no usable path. Only a candidate that is non-empty after trimming counts as an outside-repo path; anything else still fails closed. * fix(ci): trim path candidates again after quote stripping A candidate whose content is whitespace inside quotes survived the outside-path predicate, which trims before stripping quotes but not after. Re-trim so only a candidate with real content counts as an outside-repo path. * style(ci): apply Biome formatting to the agent hook
S
shm committed
02c8de6f48308ed01c72fb18083812a2fa7e8406
Parent: f3350e8
Committed by GitHub <noreply@github.com>
on 8/23/2026, 3:59:15 AM