fix: feat: unified escalation — single PHASE:escalate path for all agents (#510)
Replace PHASE:needs_human with PHASE:escalate across all agent types. Consolidates 6 overlapping escalation mechanisms into one unified path: detect → notify via Matrix → session stays alive → human reply injected → resume. Key changes: - PHASE:escalate replaces PHASE:needs_human everywhere (16 files) - CI exhausted now escalates instead of immediately marking blocked - Matrix listener routes free-text replies to vault tmux sessions - Vault agent writes PHASE:escalate files for procurement requests - Supervisor monitors PHASE:escalate sessions in health checks - 24h timeout on escalation → blocked label + session killed - All 38 phase protocol tests updated and passing Supersedes #462, #458, #465.
This commit is contained in:
parent
725c4d7334
commit
5822dc89d9
18 changed files with 138 additions and 95 deletions
|
|
@ -156,7 +156,7 @@ curl -sf -X PATCH \\
|
|||
echo \"PHASE:done\" > \"${phase_file}\"
|
||||
|
||||
If merge fails due to conflicts, rebase first then retry.
|
||||
If merge repeatedly fails, write PHASE:needs_human."
|
||||
If merge repeatedly fails, write PHASE:escalate with a reason."
|
||||
elif [ "${verdict}" = "REQUEST_CHANGES" ] || [ "${verdict}" = "DISCUSS" ]; then
|
||||
inject_msg="Review: ${verdict} on PR #${pr_num}:
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ review_cb() {
|
|||
[ "$_REVIEW_CRASH" -gt 0 ] && return 0; _REVIEW_CRASH=$((_REVIEW_CRASH + 1))
|
||||
create_agent_session "${_MONITOR_SESSION}" "$WORKTREE" "$PHASE_FILE" 2>/dev/null && \
|
||||
agent_inject_into_session "${_MONITOR_SESSION}" "$PROMPT" ;;
|
||||
PHASE:done|PHASE:failed|PHASE:needs_human) agent_kill_session "${_MONITOR_SESSION}" ;;
|
||||
PHASE:done|PHASE:failed|PHASE:escalate) agent_kill_session "${_MONITOR_SESSION}" ;;
|
||||
esac
|
||||
}
|
||||
monitor_phase_loop "$PHASE_FILE" 600 "review_cb" "$SESSION"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue