Commit 1a39ebe
fix(agent-flow): auto-allow staged deletions + surface gh pr create failures (#565)
Two ergonomic fixes to remove recurring friction in the agent commit +
finish flow.
1. pre-commit auto-claim: the existing GUARDEX_AUTOCLAIM_STAGED_LOCKS
block iterated --diff-filter=ACMRDTUXB and claimed every staged path
without --allow-delete, so 'locks validate --staged' then rejected
the same deletion the operator just staged, forcing a manual 'gx
locks allow-delete' + re-commit loop. Split non-deletion staged
paths from deletions and claim deletions with --allow-delete, gated
by GUARDEX_AUTOCLAIM_STAGED_DELETES (default 1).
2. agent-branch-finish run_pr_flow: 'gh pr create' was wrapped in
'>/dev/null 2>&1 || true', so auth, branch-protection, or gh-version
failures were invisible. The function then ran 'gh pr view' (empty
URL) and 'gh pr merge' (silent no-op), leaving operators with a
'merged via pr flow' log and no PR. Capture stderr, let the
idempotent 'PR already exists' path through, surface every other
failure verbatim, fail fast if no URL appears, and log the URL
on success.
Both changes are additive and behind opt-out env vars where behavior
diverges; existing operators see strictly fewer reject+retry loops and
louder PR-create failures.
Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>1 parent 7694495 commit 1a39ebe
4 files changed
Lines changed: 69 additions & 3 deletions
File tree
- openspec/changes/agent-claude-smoother-finish-autoclaim-deletes-and-lo-2026-05-12-00-28
- templates
- githooks
- scripts
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
210 | 213 | | |
211 | 214 | | |
212 | 215 | | |
213 | 216 | | |
214 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
215 | 236 | | |
216 | 237 | | |
217 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1126 | 1126 | | |
1127 | 1127 | | |
1128 | 1128 | | |
1129 | | - | |
| 1129 | + | |
| 1130 | + | |
1130 | 1131 | | |
1131 | 1132 | | |
1132 | 1133 | | |
1133 | | - | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1134 | 1145 | | |
1135 | 1146 | | |
1136 | 1147 | | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1137 | 1158 | | |
1138 | 1159 | | |
1139 | 1160 | | |
| |||
0 commit comments