Skip to content

Close steering someone else's workflow run - #213

Merged
artempartos merged 1 commit into
developfrom
fix/run-owner-control-gate
Sep 5, 2026
Merged

artempartos merged 1 commit into
developfrom
fix/run-owner-control-gate

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

Opening someone else's session is gated. Steering their run was not: any project member could cancel a run, or approve / retry / skip its steps — decisions only the person who started it is really in a position to make, since they are the one who knows whether a waiting step should go ahead.

The rule

WorkflowRun#controllable_by? — the run's own user, plus company admins, who keep an override because a run nobody can cancel blocks the board card behind it and its owner may well be asleep.

Enforced in:

  • WorkflowRunsPolicy — cancel? / approve_step? / retry_step? / skip_step?
  • the four personal-MCP tools that reach the same actions (cancel_workflow_run, approve_step_run, retry_step_run, skip_step_run), via a shared find_controllable_run!

Reading a run is untouched — the whole team still watches the board's automation.

What the refusal says

This run was started by Dana Operator — only they or a company admin can control it.

…rather than the generic role denial, which would imply their role changed. A read-only member still gets the generic denial: they are refused for their role, not for whose run this is.

The run screen matches: the Cancel button and the per-step Approve / Skip / Retry / Finish buttons are replaced by that same line, so nobody clicks something that would only bounce back with a flash. controllableByViewer on the resource is presentation; the policy is the enforcement.

Deliberately left open

trigger_task_workflow's force. It cancels a run only as a step of relaunching a board card's automation, which belongs to the team rather than to whoever started the previous attempt — and repairing a card launched under the wrong account is exactly what it exists for.

Checks

docker compose exec -T web make check_all — green.

🤖 Generated with Claude Code

Opening someone's session was already gated; steering their RUN was not. Any
project member could cancel a run, or approve, retry and skip its steps —
decisions only the person who started it is in a position to make, since they
are the one who knows whether a waiting step should go ahead.

WorkflowRun#controllable_by? is the single rule: the run's own user, plus company
admins, who keep an override because a run nobody can cancel blocks the board
card behind it and its owner may well be asleep. It is enforced in
WorkflowRunsPolicy (cancel / approve_step / retry_step / skip_step) and in the
four personal-MCP tools that reach the same actions.

Reaching a run is untouched — the whole team still watches the board's
automation. And the refusal says what it is: "This run was started by <name> —
only they or a company admin can control it", rather than the generic role
denial, which would imply their role changed. A read-only member still gets the
generic denial: they are refused for their role, not for whose run this is.

trigger_task_workflow's `force` is deliberately left open. It cancels a run only
as a step of relaunching a board card's automation, which belongs to the team
rather than to whoever started the previous attempt — repairing a card launched
under the wrong account is exactly what it is for.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit f30727c into develop Sep 5, 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