Skip to content

Emit an event when an epic queue issue becomes blocked, and add skip and retry actions #3474

Closed

Description

@integry

Problem

When an epic issue is blocked (closed without merge, missing from the plan, dispatch failed, agent reported a blocker) the queue writes a reason and stands still. Nothing is emitted, so nobody is told and nothing can react. There is also no way to move on: an issue cannot be skipped or retried, and the only way out is to merge something into it.

Goal

Becoming blocked is a durable, deduplicated event that people and clients can see, and a blocked or pending issue can be skipped or retried through REST, MCP and the UI.

Acceptance criteria

  • When an issue of an execution becomes blocked, exactly one event is recorded for that transition, with the plan, execution, issue number, reason kind and text. Repeated sweeps or repeated status notifications for the same blocked state record nothing more; a later, different blocker on the same issue records a new event. Clearing a blocker records its resolution.
  • The event is durable and readable: a client can list an execution's blocked events with a cursor through REST and MCP, without polling the whole plan.
  • The event raises one Inbox notification of kind plan for the plan's owner and the repository's notification recipients, deduplicated per blocked state, linking to the plan. The agent-reported blocker keeps its existing task notification and does not produce a second card for the same cause.
  • The event is published on the existing realtime channel as a plan-domain blocked activity so open UIs update without a refresh.
  • Planner Studio shows which issue of an execution is blocked and why. Today the reason is returned by the API and never rendered.
  • Skip: a pending or blocked issue can be marked skipped. The queue then treats it as finished for scheduling: a chain moves to the next issue; in a graph, issues that depend on a skipped issue are reported as waiting on a skipped prerequisite and are not started unless the caller skips with an explicit option to treat the dependency as satisfied. Skipping never closes or edits the GitHub issue.
  • Retry: a blocked issue can be requested again. The blocker is cleared and the issue is dispatched under the normal guards. For an issue started through MCP this works despite the earlier implementation receipt.
  • Both actions are guarded like every other queue write (execution id and current state), are idempotent, and are refused with a clear error for an issue that is in flight or already done.
  • Skip and retry are available as REST routes, MCP tools and controls in Planner Studio, with docs and MCP coverage entries.
  • Tests cover: one event per blocked transition under repeated sweeps, a second event for a new blocker, resolution on clear, notification deduplication, skip in a chain and in a graph (both dependency options), retry of each blocker kind, and refusal for in-flight and done issues.

Out of scope

  • Starting an automation from the event (next issue).
  • Automatic recovery policies (replacement tasks, escalation): the hook makes them possible, it does not implement them.

Implementation

Key files: the queue modules in packages/core/src/services/taskPlanning/ (every place that sets or clears a blocked state after the per-issue refactor), packages/core/src/services/notificationService.ts (createNotificationEvent; kind plan and PlanNotificationTarget already exist in packages/shared/src/notifications.ts), src/jobs/blockedRun.ts (notifyBlockedRun, the existing task-level notification for an agent-reported blocker), src/jobs/issueJobBlocked.ts, packages/core/src/utils/eventPublisher.ts (publishActivity; ACTIVITY_DOMAINS includes plan and ACTIVITY_CHANGES includes blocked in packages/shared/src/activityEvents.ts), packages/api/services/activityBroadcast.ts, packages/api/services/notificationProjectionService.ts, packages/api/routeRegistry.ts (plan routes), packages/api/routes/planExecutionQueueHandlers.ts, packages/api/mcp/toolsPlanning.ts and tools.ts (the permanent mcp_records issue_execution claim that blocks a second implement_plan for the same issue), propr-ui/src/api/planIssuesApi.ts, propr-ui/src/components/TaskPlanner/PlanIssuesManager.tsx and its row components.

The blocked writes run in three processes (API, webhook handling, worker sweep), so detect the transition in the same guarded statement that writes the state and record the event in the same transaction. A new MCP tool and REST route must follow the repository conventions: route registry, OpenAPI docs and generated client types, docs/mcp.md and docs/mcp-coverage.md, and the coverage tests (packages/api/test/openapiRouteCoverage.test.ts, packages/api/test/mcpObservableSurface.test.ts: every backticked token in docs/mcp.md must be a tool name or on the non-tool allowlist).

Tests: core epic queue tests, packages/api/test/mcpEpicDispatch.test.ts, packages/api/test/notificationProjectionService.test.ts, test/issueJobBlocked.test.ts, UI tests next to the changed components. Verify with the standard commands.

Activity

  1. propr-dev commented on Nov 13, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

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

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3474/claude-opus-5-5-emit-an-event-when-an-epi-20261113-0213-zd9
    • Base Branch: 3470-epic-scheduler-primitives-nrj
    • Worktree: issue-3474-20261113-0213-claude-opus-5-5-zd9

    🔍 Track Task Execution

  2. added a commit that references this issue on Nov 13, 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