fix: PHASE:crashed unhandled in _on_phase_change / dev-agent callback (#339)
Add explicit PHASE:crashed case to _on_phase_change in phase-handler.sh: logs crash, notifies Matrix, escalates to supervisor, restores backlog label, preserves worktree if PR exists, cleans up temp files. Add crashed case to dev-agent.sh post-loop case statement for belt-and-suspenders cleanup matching the callback behavior. Replaces the dead crash_recovery_failed case that was never triggered. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e8dc145184
commit
7f9cefa847
2 changed files with 46 additions and 1 deletions
|
|
@ -767,8 +767,24 @@ case "${_MONITOR_LOOP_EXIT:-}" in
|
|||
"/tmp/ci-result-${PROJECT_NAME}-${ISSUE}.txt"
|
||||
[ -n "${PR_NUMBER:-}" ] && rm -f "/tmp/review-injected-${PROJECT_NAME}-${PR_NUMBER}"
|
||||
;;
|
||||
crash_recovery_failed)
|
||||
crashed)
|
||||
# Belt-and-suspenders: _on_phase_change(PHASE:crashed) handles primary
|
||||
# cleanup, but ensure labels and files are cleaned up if callback was
|
||||
# interrupted (e.g. set -e propagation).
|
||||
cleanup_labels
|
||||
curl -sf -X POST \
|
||||
-H "Authorization: token ${CODEBERG_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${API}/issues/${ISSUE}/labels" \
|
||||
-d "{\"labels\":[${BACKLOG_LABEL_ID}]}" >/dev/null 2>&1 || true
|
||||
CLAIMED=false
|
||||
if [ -z "${PR_NUMBER:-}" ]; then
|
||||
cleanup_worktree
|
||||
fi
|
||||
rm -f "$PHASE_FILE" "${PHASE_FILE%.phase}.context" \
|
||||
"$IMPL_SUMMARY_FILE" "$THREAD_FILE" "$SCRATCH_FILE" \
|
||||
"/tmp/ci-result-${PROJECT_NAME}-${ISSUE}.txt"
|
||||
[ -n "${PR_NUMBER:-}" ] && rm -f "/tmp/review-injected-${PROJECT_NAME}-${PR_NUMBER}"
|
||||
;;
|
||||
done)
|
||||
# Belt-and-suspenders: callback in phase-handler.sh handles primary cleanup,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue