Skip to content

fix(runs): deny an open approval when its run is stopped - #2171

Merged
elie222 merged 2 commits into
elie222:mainfrom
tc3oliver:fix/cancel-run-open-approval
Oct 25, 2026
Merged

elie222 merged 2 commits into
elie222:mainfrom
tc3oliver:fix/cancel-run-open-approval

Conversation

@tc3oliver

@tc3oliver tc3oliver commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Why

Stopping a run while its approval card was open left the card's effect intended forever. The run can't resume, so nothing ran or settled it.

What changed

clearEndedRunState now marks the effects behind the ended runs' unanswered approval cards denied, the status a declined card already uses. It finds them through the cards' approvalEffectId, so an effect with no card, such as a tool that needs no approval and is still running, keeps its status. The thread stop path and the shared cancel helper now call clearEndedRunState instead of repeating its checkpoint and secret cleanup, so both get the fix.

How tested

A new journey test against Postgres sets an approval rule, waits for the card, stops the thread and checks the effect is denied. It fails without the change. Unit tests cover that only an unanswered card's effect is denied and that nothing changes when no card is open. Typecheck passes and Biome is clean on the changed files; the unit suite passes except the backup script tests, which fail the same way on main on macOS.

@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown

@tc3oliver is attempting to deploy a commit to the Inbox Zero Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous finding is fixed and no new actionable issues were found.

Summary

Stopping a run now denies effects behind its unanswered approval cards without changing effects for tools already running without approval.

  • Stopping a run denies its unanswered approval effect.

The previous finding is fully addressed. No new actionable issues were found. Tests were not run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Cancel selected runs] --> B[Clear turn checkpoints]
  B --> C[Find unanswered approval cards]
  C --> D[Deny linked effects still intended]
  D --> E[Delete waiting secrets]
  C --> F[Leave effects without cards unchanged]
Loading

Reviews (2) · Last reviewed commit: "fix(runs): deny only effects behind an u..." · Reviewed by Greptile

Comment thread packages/db/src/run-secrets.ts Resolved
@elie222
elie222 merged commit 51bec24 into elie222:main Oct 25, 2026
26 of 27 checks passed
@tc3oliver
tc3oliver deleted the fix/cancel-run-open-approval branch November 13, 2026 05:07
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.

2 participants