Skip to content

feat(action): Handle cancellation gracefully - #521

Open
jamieQ wants to merge 1 commit into
mainfrom
feat/graceful-action-cancellation
Open

feat(action): Handle cancellation gracefully#521
jamieQ wants to merge 1 commit into
mainfrom
feat/graceful-action-cancellation

Conversation

@jamieQ

@jamieQ jamieQ commented Aug 27, 2026

Copy link
Copy Markdown
Member

Warden Action runs now treat SIGINT and SIGTERM as terminal cancelled outcomes instead of exiting before results are finalized. Cancellation aborts in-flight analysis, verification, and consolidation work; preserves completed findings and observed usage in an atomic findings artifact with outcome: "cancelled"; concludes active checks; and flushes telemetry before exiting.

Split mode retains a single publication owner: analyze writes the replay artifact without publishing, while report consumes and publishes successful or cancelled artifacts. Legacy run and schedule modes continue publishing directly. The findings schema remains backward compatible because the new outcome field is optional for older artifacts.

Comment thread packages/warden/src/action/workflow/pr-workflow.ts
Comment thread packages/warden/src/action/workflow/pr-workflow.ts
@jamieQ
jamieQ force-pushed the feat/graceful-action-cancellation branch from 36b27bb to d3947ab Compare August 27, 2026 19:20
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
warden-prod Ready Ready Preview Aug 27, 2026 9:14pm

Request Review

Comment thread action.yml
INPUT_SERVICE_MEMORY: ${{ inputs.service-memory }}
INPUT_SERVICE_TIMEOUT_MS: ${{ inputs.service-timeout-ms }}
run: node ${{ github.action_path }}/dist/action/index.js
run: exec node "${{ github.action_path }}/dist/action/index.js"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this (or something like it) so that when github interrupts/kills the process, the signal makes it to node.

Comment thread packages/warden/src/action/workflow/schedule.ts Outdated
Abort in-flight analysis, preserve partial findings and usage, and finalize findings artifacts with a cancelled outcome. Keep analyze/report publication ownership intact and conclude active checks consistently.

Co-Authored-By: GPT-5 <noreply@anthropic.com>

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The graceful-cancel path is coherent end to end: signal handling with force-on-second-signal, abort propagation distinct from the circuit breaker, cancelled findings artifacts (including split analyze/report ownership), check finalization, and telemetry flush before exit. Prior notes around recalled-memory linkage, cancelCoreCheck Sentry capture, and schedule abort isolation look addressed, and the new coverage locks in the important cancelled publish/no-publish behaviors.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d97dff9. Configure here.

failOnWriteError: inputs.mode === 'analyze',
});
span.setAttribute('warden.finding.count', 0);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cancelled artifacts omit pending triggers

Medium Severity

Cancellation before trigger dispatch finalizes with empty results, so matched triggers never appear as pending in triggerResults or skippedTriggers. executeAllTriggers synthesizes those pending rows, but the early finalizeCancelledPRRun paths skip it, so cancelled artifacts look like nothing matched.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d97dff9. Configure here.

minConfidence,
failCheck,
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cancelled skills still fail checks

Medium Severity

Cancellation is only honored after a clean skill report. If the task returns report.error or throws, the executor still captures a Sentry exception, marks the GitHub check as failed, and drops the report. The run-level execute catch similarly fails the core check and writes a non-cancelled artifact even when cancellation was requested.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d97dff9. Configure here.

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