Skip to content

fix(worker): prevent manual dispatch run leakage - #280

Merged
outof-place merged 1 commit into
mainfrom
fix/run-dispatch-leak-p2
Aug 28, 2026
Merged

fix(worker): prevent manual dispatch run leakage#280
outof-place merged 1 commit into
mainfrom
fix/run-dispatch-leak-p2

Conversation

@outof-place

Copy link
Copy Markdown
Collaborator

Defect

A coordinator-consented manual MCP ticket dispatch reserves the subject and moves the ticket into the shared Ai column. The Jira webhook and poll pickup path also treat that column as default-workflow enrolment, so releasing the manual run's claim while the ticket remained there allowed unconsented default runs to start on consecutive pickups. This was observed in production as wrun_01KZYCWTYMDN6EVNV7BETD71XM and wrun_01KZYD0FDD1DBT6YYK4GXMXD9J.

Invariant and approach

One coordinator-consented manual dispatch causes at most that one consented run. The existing manual subject reservation remains the immediate auto-pickup marker; this change adds owner-fenced withdrawal from Ai before a manual_ticket claim can be released on natural terminal reconciliation or operator cancellation. If Jira withdrawal cannot be confirmed, ownership is retained for retry, and a workflow-selected destination outside Ai is preserved. The manual-dispatch preflight now states that manual ownership suppresses automatic pickup until the run withdraws or moves the ticket.

Focused verification

pnpm --filter worker test -- src/lib/dispatch.test.ts src/lib/reconcile.test.ts src/lib/cancel-run.test.ts src/lib/ticket-transition.test.ts src/db/queries/runs-read.test.ts src/manual-dispatch/resolve.test.ts src/routes/api/v1/runs/cancel.test.ts src/mcp/tools/run-control.test.ts
Test Files  8 passed (8)
Tests       183 passed (183)

pnpm --filter worker typecheck
exit 0

No full local suite was run; CI provides breadth.

Overlaps the dispatch/capacity subsystem being changed off-main by AIW-277/279 - coordinate before merge; do not merge without reviewing against that work.

Generated by an AI coding agent via Orca.

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-workflow-app-dashboard Ready Ready Preview Aug 28, 2026 6:21am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 311b1b81-7742-4be4-a3ea-22b1df54e0bc


Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@outof-place
outof-place merged commit a68869c into main Aug 28, 2026
7 checks passed
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.

1 participant