Skip to content

Stop work when an issue or PR withdraws intent #2659

Closed

Description

@integry

Problem

ProPR starts work when an issue is labeled, but never stops work when the issue stops wanting it.

  • Only labeled is handled. packages/core/src/webhook/webhookHandler.ts acts on the issues event's labeled action only. Closing the issue, removing the trigger label, or removing the model label doesn't cancel a queued or running task. The one exception is removing ultrafix from a PR, which stops that loop.

OpenAI's Symphony reconciles on every scheduler tick:

  • It refreshes the tracker state of each running issue. A terminal issue stops the agent and cleans its workspace; a no-longer-eligible issue stops the agent and keeps the workspace.
  • It records distinct terminal reasons, such as CanceledByReconciliation and TimedOut.

Proposal

  1. Cancel on intent withdrawal. Handle issues.closed and issues.unlabeled, when the removed label is a processing trigger:

    • cancel queued jobs for that issue;
    • request cancellation of a running implementation task, through the same path as propr task stop or the UI;
    • leave any already-opened PR alone.

    For PRs, pull_request.closed without a merge should cancel in-flight follow-up, review and Ultrafix work for that PR. Before starting, the worker re-checks the issue or PR state, which covers missed webhooks and polling mode.

  2. Record terminal reasons. Give task state a cancellation or failure reason: timed_out, cancelled_issue_closed, cancelled_label_removed, cancelled_pr_closed, cancelled_by_user. Surface it in the task view, the Inbox and MCP (get_task), and use it in retry decisions (never retry cancellations).

Acceptance criteria

  • Closing an issue, or removing its trigger label, while its task is queued or running cancels the task within one event, or one poll interval in polling mode. The task shows cancelled_issue_closed or cancelled_label_removed, and the issue's state labels reflect it.
  • Removing a model label doesn't cancel anything.
  • Closing a PR without merging stops in-flight follow-up, review and Ultrafix work for it.
  • The worker's pre-start re-check prevents starting a job whose issue is already closed or unlabeled.
  • pr-followup.md and the task-state docs describe the new behavior.

Out of scope

Stall detection (killing sessions that emit no output for N minutes). Hung sessions haven't been a real problem, and agents legitimately go quiet for long stretches, so an inactivity cutoff risks false positives. The existing overall task timeout remains the backstop.

Activity

  1. changed the title [-]Stop work when an issue or PR withdraws intent, and detect stalled agent sessions[/-] [+]Stop work when an issue or PR withdraws intent[/+] on Sep 30, 2026
  2. propr-dev commented on Sep 30, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using codex agent with gpt-6-astra model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: codex
    • Model: gpt-6-astra
    • Branch: 2659/gpt-6-astra-stop-work-when-an-issue-o-20260930-2350-tvv
    • Base Branch: main
    • Worktree: issue-2659-20260930-2350-gpt-6-astra-tvv

    🔍 Track Task Execution

  3. added a commit that references this issue on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions