fix: investigate: PreToolUse guard blocks do_merge() in dev-agent — every disinto PR escalates on merge (#568)
Root cause: two code paths injected merge curl commands into Claude's session (review-poll.sh APPROVE injection and dev-agent.sh prompt instructions). The PreToolUse guard correctly blocked these, causing Claude to write PHASE:escalate instead of merging. The bash phase handler already handles merging via do_merge() — which runs outside Claude tool use and is not subject to the guard. Remove the merge/close curl instructions from both Claude-facing prompts so the bash orchestrator handles merges as intended. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a2549f62e7
commit
06cddb456d
2 changed files with 4 additions and 38 deletions
|
|
@ -579,27 +579,8 @@ echo \"PHASE:awaiting_ci\" > \"${PHASE_FILE}\"
|
|||
(CI runs again after each push — always write awaiting_ci, not awaiting_review)
|
||||
|
||||
**When you receive an \"Approved\" injection:**
|
||||
The injection includes exact API commands. Merge the PR and close the issue directly:
|
||||
\`\`\`bash
|
||||
# Merge (replace NNN with the actual PR number from the injection):
|
||||
curl -sf -X POST \\
|
||||
-H \"Authorization: token \${CODEBERG_TOKEN}\" \\
|
||||
-H 'Content-Type: application/json' \\
|
||||
\"${API}/pulls/NNN/merge\" \\
|
||||
-d '{\"Do\":\"merge\",\"delete_branch_after_merge\":true}'
|
||||
|
||||
# Close the issue:
|
||||
curl -sf -X PATCH \\
|
||||
-H \"Authorization: token \${CODEBERG_TOKEN}\" \\
|
||||
-H 'Content-Type: application/json' \\
|
||||
\"${API}/issues/${ISSUE}\" \\
|
||||
-d '{\"state\":\"closed\"}'
|
||||
|
||||
# Signal done:
|
||||
echo \"PHASE:done\" > \"${PHASE_FILE}\"
|
||||
\`\`\`
|
||||
If merge fails due to conflicts, rebase first then retry the merge.
|
||||
If merge repeatedly fails, write PHASE:escalate with a reason.
|
||||
The orchestrator handles merging and issue closure automatically via the bash
|
||||
phase handler. You do not need to merge or close anything — stop and wait.
|
||||
|
||||
**When you need human help (CI exhausted, merge blocked, stuck on a decision):**
|
||||
\`\`\`bash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue