Add cancel-execution command for Hosted Agents triggers - #1995
Merged
Merged
Conversation
harness-trigger now exposes POST .../executions/{id}/cancel (a supported
way to end a stuck webhook/cron execution instead of waiting on the
platform's reclaim sweep or destroying the session by hand).
doctl harness-runtime triggers cancel-execution <trigger-id> <execution-id> [--force]
Mirrors get-execution's command shape and displayer. --force reuses the
existing ArgForce/ArgShortForce constants (delete's flag) but a different
purpose here: it bypasses a server-side guard against a dispatch race, not
a client confirmation prompt -- an execution that has not started a run
yet otherwise returns an error.
Depends on digitalocean/godo#1129 (Cancel method). go.mod currently
pins a pseudo-version of that commit so this builds and tests today;
bump to the real tagged release once that PR merges and ships, per
godo's own CONTRIBUTING.md release process.
SSharma-10
approved these changes
Sep 30, 2026
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.
What
Adds
doctl harness-runtime triggers cancel-execution <trigger-id> <execution-id> [--force](also reachable via the
agent/agents/ohraliases), wrappingharness-trigger's new
POST /v2/agents/triggers/{trigger_id}/executions/{execution_id}/cancel(MARSOHS-1686) -- a supported way to end a stuck webhook/cron execution
instead of waiting on the platform's reclaim sweep or destroying the session
by hand.
Shape
get-execution's command shape anddisplayers.HostedAgentTriggerExecutioncard/JSON output -- the response is the same execution shape.
--forcereuses the existingArgForce/ArgShortForceconstants (delete'sflag), though the purpose differs: it bypasses a server-side guard against a
dispatch race, not a client confirmation prompt. Without it, cancelling an
execution that has not started a run yet returns an error.
go.modcurrently pinsgithub.com/digitalocean/godo v1.215.1-0.20260924162540-187a35d4a803-- a pseudo-version of the commit adding
Cancelin godo#1129 -- so thisbuilds and passes tests today. Once that PR merges and ships a real tag
(per godo's own
CONTRIBUTING.md, version bump/tag/release is its ownfollow-up PR there), this branch's
go.mod/go.sum/vendor/need bumping tothe real released version before this can merge. Flagging prominently so
that step isn't missed.
Testing
go build ./commands/... ./do/... .andgo test ./commands/... ./do/... .-- new cases for JSON mode, text/card mode, and
--forceactually reachingthe service call as
true. Also fixedTestAgentTriggersCommand's exhaustivesubcommand-name assertion to include
cancel-execution.(
TestRegistryLogoutfails locally on this machine with "credentials notfound in native keychain" -- a local OS keychain issue unrelated to this
change; confirmed it's untouched by this diff.)
Not in this PR
godomock regenerated viago install go.uber.org/mock/mockgen@latest+scripts/regenmocks.sh's exact command, per the repo's own documentedprocess -- no manual mock edits.