Repository navigation
fix(mothership): keep a started call's result after Stop, and let a blocked owner stop their run - #9114
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] The PR appears safe to merge; both Stop changes preserve the relevant ownership and execution checks. SummaryThis PR fixes two Stop paths:
No actionable issues found. Tests were inspected, not run.
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two independent run-stopping fixes, one commit each.
Stopped run's tool call (executor)
runningrow. If another process's handler was still executing that call under a live lease, the call actually ran, its real result was lost (the owner's fenced write then failed), and the call read as both not-run and executedpendingrow (completePendingAsyncToolCall); a call something already started falls through to the existing observer path and reports the owner's durable result (or lets an expired lease be revoked as lost). The common case publishes exactly the same cancellationStop for a blocked owner (run controls)
resolveOwnedChatContexttakes an explicitallowBlockedOwneroption, passed only by Stop when resolving an already-admitted run. Ownership, chat, run and scope checks are unchanged; steer, send and every other caller keep the ban check, and a Stop recorded ahead of admission still requires an unblocked accountType of Change
Testing
executor.test.ts: a closed claim on a pending row is cancelled exactly as before; on a row another controller started, the row is not overwritten and the call returns that controller's real result (fails before)removal-stops-runs.integration.ts(real Postgres + Redis): a blocked owner can Stop their run and the worker receives it (fails before); the same owner is refused steer and send; another workspace member cannot Stop the runChecklist