Skip to content

fix(workflow-executor): file no approval request on a step that refuses approvals - #2074

Open
Scra3 wants to merge 4 commits into
feature/prd-29-handle-action-approvals-within-workflowsfrom
fix/prd-29-no-request-when-step-refuses-approvals
Open

Scra3 wants to merge 4 commits into
feature/prd-29-handle-action-approvals-within-workflowsfrom
fix/prd-29-no-request-when-step-refuses-approvals

Conversation

@Scra3

@Scra3 Scra3 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Part of PRD-29 (QA bug 16)

Bug: in Full AI, a Trigger Action step saved without approval branches whose action now requires approval errored as a configuration error, but agent-client had already filed an approval request that stayed open with no run. Approving it ran the action outside the workflow.

Fix: on such a step the executor runs the action with a new agent-client option, skipApprovalRequest, so the agent's refusal comes back as ActionRequiresApprovalError and the step errors with ApprovalBranchesMissingError and no open request. The message no longer names a request. agent-client's default is unchanged: it still files the request for every other caller.

Tests

  • agent-client: skipApprovalRequest throws ActionRequiresApprovalError without calling the request creator; the existing tests still cover the default filing.
  • Adapter: the flag is forwarded to execute.
  • Executor: a step that refuses approvals (formless and with a form) errors with the configuration error, files no request and names none; a validation rejection still hands the form back; a step with branches, or with approvalOutcomes absent, sends no flag and still files and links its request.

Refactor: the step's approval handling moved out of trigger-record-action-step-executor.ts into trigger-action-approvals.ts (TriggerActionApprovals), in its own commit with no behaviour change.

Out of scope: Manual and AI-assisted. There the front's native form files the request, so a step without branches still ends with an open request named in the error.

🤖 Generated with Claude Code

Note

Skip approval request when a trigger-action step has no approval branches

  • Adds skipApprovalRequest to ExecuteActionQuery and ActionExecuteOptions, and forwards it from agent-client-agent-port.ts to Action.execute
  • TriggerRecordActionStepExecutor.executeOnExecutor sets the flag for steps saved without approval branches. If the action still requires approval, it deletes the saved executing record and throws ApprovalBranchesMissingError
  • Extracts approval-outcome logic from the executor into a new TriggerActionApprovals helper in trigger-action-approvals.ts
  • Behavioral Change: steps without approval branches no longer file approval requests; a required approval now results in a configuration error and executing-record cleanup instead of a pause

Macroscope summarized 9a3f9d2.

…es approvals

A Trigger Action step saved without approval branches whose action now
requires approval errored as a configuration error in Full AI, but
agent-client had already filed an approval request that stayed open
with no run. Approving it ran the action outside the workflow.

The executor now runs the action with agent-client's new
`skipApprovalRequest` option on such a step, so the agent's refusal
surfaces as ActionRequiresApprovalError and the step errors with no
open request. agent-client's default still files the request.

Part of PRD-29 (QA bug 16)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Scra3
Scra3 requested a review from matthv November 9, 2026 20:08
@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

PRD-29

@Scra3 Scra3 left a comment

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.

Spec (PRD-29): conforms to QA bug 16, a Full AI step saved without branches errors as configuration and files no request.

PRD-29 has 13 unvalidated decisions: not final.

Comment thread packages/workflow-executor/CLAUDE.md Resolved
@qltysh

qltysh Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Qlty


Coverage Impact

⬇️ Merging this pull request will decrease total coverage on feature/prd-29-handle-action-approvals-within-workflows by 0.1%.

Modified Files with Diff Coverage (4)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
...-executor/src/executors/trigger-record-action-step-executor.ts100.0%
Coverage rating: A Coverage rating: A
packages/agent-client/src/domains/action.ts100.0%
Coverage rating: A Coverage rating: A
...ages/workflow-executor/src/adapters/agent-client-agent-port.ts100.0%
New file Coverage rating: A
...es/workflow-executor/src/executors/trigger-action-approvals.ts100.0%
Total100.0%
Commit 9a3f9d2 · 🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@Scra3

Scra3 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member Author

Forest Validator · Review: findings posted

When (UTC) Commit Step Result
09/11 20:38 0303b1b Review findings posted · run 2074-20261109203327-Scra3
1 earlier step
When (UTC) Commit Step Result
09/11 20:15 935b21a Review findings posted · run 2074-20261109200927-Scra3

alban bertolini and others added 2 commits November 9, 2026 21:18
…spatched again

The refusal left the `executing` write-ahead record, so a re-dispatch read
the step as interrupted instead of erroring on the missing branches. Nothing
ran, so the record is deleted before the configuration error is raised.

Part of PRD-29 (QA bug 16)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing to its own module

The step executor mixed what its approval outcomes decide with mode dispatch,
AI form filling and action selection, and the last four changes to it were all
about approvals. TriggerActionApprovals now owns the outcome getters, the pause,
the settlement of a filed request, the replay of its review, the decline on a
branch and the refusal on a step saved without branches. No behaviour change.

Part of PRD-29

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qltysh

qltysh Bot commented Nov 9, 2026

Copy link
Copy Markdown

2 new issues

Tool Category Rule Count
qlty Structure Function with many returns (count = 4): checkIdempotency 1
qlty Structure Function with high complexity (count = 12): checkIdempotency 1

@Scra3 Scra3 left a comment

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.

Spec (PRD-29): conforms to QA bug 16, a Full AI step saved without branches errors as configuration and files no request.

PRD-29 has 14 unvalidated decisions: not final.

…e that made it

The executor writes the `executing` record in `beforeCall`, so it now clears it
in its own catch instead of in the approvals module, and a failed delete is
logged rather than hiding the configuration error. The refusal tests also
assert the caller argument of `executeAction`.

Part of PRD-29 (QA bug 16)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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