Skip to content

fix(workflows): preserve cancellation scope assertions - #7368

Closed
j15z wants to merge 1 commit into
stagingfrom
feat/let-mship-cancel-workflow-runs
Closed

fix(workflows): preserve cancellation scope assertions#7368
j15z wants to merge 1 commit into
stagingfrom
feat/let-mship-cancel-workflow-runs

Conversation

@j15z

@j15z j15z commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • preserve workflow parent assertions for internal and v2 cancellation routes
  • keep Mothership cancellation executionId-only while asserting trusted Copilot workspace scope
  • cover canonical execution resolution and cross-workspace concealment

Type of Change

  • Bug fix

Testing

  • bun run lint
  • bun run check:audits
  • 71 focused workflow and route tests
  • cancellation schema parity check against the sibling Mothership contract
  • full app type-check remains blocked by the existing pi-sdk ResourceLoader mismatch on staging

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 1, 2026 7:59pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR restores parent-scope assertions on internal and v2 workflow cancellation and binds Copilot cancellation to its trusted workspace.

  • Passes route workflow IDs into cancellation context resolution.
  • Passes the Copilot workspace ID as an execution lookup assertion.
  • Adds focused coverage for canonical execution resolution and workspace mismatch concealment.

Confidence Score: 5/5

The PR appears safe to merge, with cancellation assertions consistently failing closed on workflow or workspace mismatches.

The changed adapters preserve trusted parent scope while cancellation continues to resolve canonical execution ownership and authorize the resulting workflow context before performing the operation.

Important Files Changed

Filename Overview
apps/sim/lib/workflows/application/cancel-run.ts Extends cancellation input with optional workflow and workspace assertions and forwards them to canonical run-context resolution.
apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/cancel/route.ts Preserves the workflow path parameter as an assertion when cancelling a v2 run.
apps/sim/app/api/workflows/[id]/executions/[executionId]/cancel/route.ts Preserves the internal route’s workflow parent as an assertion while retaining request cancellation propagation.
apps/sim/lib/copilot/tools/handlers/workflow/mutations.ts Constrains execution-ID-only Copilot cancellation to the trusted workspace in its execution context.
apps/sim/lib/workflows/application/context.test.ts Adds coverage for canonical execution resolution and concealed workspace mismatches.

Reviews (1): Last reviewed commit: "fix(workflows): preserve cancellation sc..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 9 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Re-trigger cubic

@j15z j15z closed this Sep 1, 2026
@waleedlatif1
waleedlatif1 deleted the feat/let-mship-cancel-workflow-runs branch September 1, 2026 22:55
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