Back to Signal Feed
CodeTracked since May 19, 2026

Make duplicate run cancellation idempotent in deer-flow gateway

The gateway `cancel_run` flow was fixed to avoid spurious 409 conflicts when two cancellation requests hit the same active run. It now rechecks the run state after a failed `cancel()` and treats already-interrupted or already-removed runs as a successful no-op (202), while still returning 409 for truly completed/error/timeout terminal states.

deer-flowcancel_rungatewayrun status

What Happened

  • The gateway `cancel_run` flow was fixed to avoid spurious 409 conflicts when two cancellation requests hit the same active run. It now rechecks the run state after a failed `cancel()` and treats already-interrupted or already-removed runs as a successful no-op (202), while still returning 409 for truly completed/error/timeout terminal states.
  • The gateway `cancel_run` flow was fixed to avoid spurious 409 conflicts when two cancellation requests hit the same active run. It now rechecks the run state after a failed `cancel()` and treats already-interrupted or already-removed runs as a successful no-op (202), while still returning 409 for truly completed/error/timeout terminal states.
  • 1 evidence item attached for review.

What is Different

Before

Scattered source updates, isolated context, and manual follow-up across multiple feeds.

Now

Introduced a state-recheck path in cancellation handling so that when `cancel()` returns false, the API distinguishes idempotent interrupted/cleanup races from non-cancelable terminal runs and maps them to 202 instead of wrongly surfacing a conflict.

Why Track This

Why It Matters

Clients and operators that retry cancel requests (for example orchestration systems and monitoring scripts) will see fewer false cancellation failures because duplicate cancels on already-interrupted runs now return 202 and do not block workflows. The change fixes a race in the lock/lock-free get path, and teams should watch for edge cases where terminal state transitions are re-read incorrectly under cleanup timing so a completed run is never incorrectly accepted as idempotently interrupted.

Impact

Clients and operators that retry cancel requests (for example orchestration systems and monitoring scripts) will see fewer false cancellation failures because duplicate cancels on already-interrupted runs now return 202 and do not block workflows. The change fixes a race in the lock/lock-free get path, and teams should watch for edge cases where terminal state transitions are re-read incorrectly under cleanup timing so a completed run is never incorrectly accepted as idempotently interrupted.

What To Watch Next

  • Watch whether deer-flow becomes a repeated pattern.
  • Track follow-up changes around AI Agents.
  • Compare future signals against this evidence trail.
  • Re-check risk flags: duplicate_cancel_idempotency_regression, run_state_reread_race_condition.
Open Topic TimelineOpen Technical EventOpen Original Sourceduplicate_cancel_idempotency_regression / run_state_reread_race_condition / terminal_state_misclassification

Supporting Evidence