Skip to content

[WIP] Fix approval gate timeout handling in pipelines - #5

Closed
shaifulshabuj with Claude wants to merge 1 commit into
mainfrom
claude/fix-approval-gate-timeout
Closed

[WIP] Fix approval gate timeout handling in pipelines#5
shaifulshabuj with Claude wants to merge 1 commit into
mainfrom
claude/fix-approval-gate-timeout

Conversation

@Claude

@Claude Claude AI commented May 16, 2026

Copy link
Copy Markdown
Contributor

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Approval gate timeout leaves pipeline in unrecoverable rejected-at-diff state</issue_title>
<issue_description>## Bug Report

Summary

When the diff approval gate times out (default 120s), the pipeline is permanently stopped with rejected-at-diff status. There is no way to continue, retry, or resume the task.

Steps to Reproduce

  1. Run devloop run without --auto
  2. When the diff gate appears, let it time out (120s)
  3. Pipeline prints: Approval timed out after 120s - rejecting
  4. Pipeline prints: Diff rejected at approval gate - pipeline stopped
  5. Open devloop view TASK-ID - status shows rejected-at-diff with no recovery path

Observed Behavior

After timeout:

  • Status file set to rejected-at-diff
  • Live View shows phases done but status = rejected-at-diff
  • devloop resume re-runs the entire worker phase (wrong - worker already completed)
  • No hint printed about how to recover

Expected Behavior

A timeout at a gate is different from an active rejection. Expected:

  • devloop resume TASK-ID should detect gate-stall and re-present only the gate
  • devloop resume TASK-ID --approve-diff to force-approve and proceed to review
  • Recovery hint printed after timeout: Run devloop resume TASK-ID to retry the gate
  • New status values: timed-out-at-plan, timed-out-at-diff (distinct from rejected)

Suggested Fix

  1. Add timed-out-at-diff status distinct from rejected-at-diff in session status file
  2. cmd_resume() should detect gate-stall status and re-present the gate, not re-run worker
  3. Consider per-gate timeout config: DEVLOOP_PLAN_GATE_TIMEOUT, DEVLOOP_DIFF_GATE_TIMEOUT
  4. Print recovery hint immediately after timeout

Environment

  • DevLoop: v5.1.0
  • Gate: diff gate
  • DEVLOOP_APPROVAL_TIMEOUT: 120 (default)

Related Code

  • devloop.sh _approval_gate() - gate resolver and timeout
  • devloop.sh cmd_resume() - needs to handle gate-stall status
  • .devloop/sessions/TASK-ID/status - needs new timed-out states
    </issue_description>

Comments on the Issue (you are @claude[agent] in this section)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Approval gate timeout leaves pipeline in unrecoverable rejected-at-diff state

2 participants