Repository navigation
agents: revoke a connection by actor (MARSOHS-2183) - #2094
Merged
Merged
Conversation
`harness-runtime connections revoke` accepted only the connection id. That id is assigned by the server, so a user who knew the actor had to run `connections list --actor` first and copy the id. Revoke now also takes `--actor`: it looks up the actor's connection for the provider and revokes it. It refuses when the actor has no connection or more than one, and when both an id and `--actor` are given. Revoke by id is unchanged. Blast radius: doctl harness-runtime connections revoke; new opt-in --actor flag, existing usage unchanged. Rollback: revert; no state or stored data is involved. MARSOHS-2183 Co-authored-by: Cursor <cursoragent@cursor.com>
sdharavath
approved these changes
Nov 2, 2026
DO-rrao
reviewed
Nov 2, 2026
| @@ -93,12 +93,15 @@ This is the actor-scoped flow. The older ` + agentCLI + ` auth <provider> comman | |||
| AddStringFlag(cmdGet, doctl.ArgAgentConnProvider, "", "github", "External provider") | |||
| cmdGet.Example = agentCLI + ` connections get ` + "`<connection-id>`" | |||
Contributor
There was a problem hiding this comment.
Right now, connectionIDForActor only reads the first page of results (PerPage: 100). Since the API is paginated, an actor with more than 100 connections might have exactly one result on the first page, with the rest appearing on subsequent pages. If that happens, the command will go ahead and revoke that first connection, which breaks the safety guarantee that it should refuse when there are multiple connections.
Contributor
Author
There was a problem hiding this comment.
Fixed in 8af7f48: connectionIDForActor now reads every page and counts matches across all of them
The actor lookup read only the first page of connections. One match on page 1 was then revoked, even when a later page held another connection for the same actor, so the "refuse when there is more than one" rule did not hold. The lookup now reads every page and stops early once it finds a second match. If the server keeps returning full pages past a cap of 50, revoke refuses instead of deciding on a partial read. MARSOHS-2183 Co-authored-by: Cursor <cursoragent@cursor.com>
DO-rrao
approved these changes
Nov 3, 2026
BadhriDO
added a commit
to BadhriDO/doctl
that referenced
this pull request
Nov 3, 2026
Resolves the conflict with digitalocean#2094 (revoke a connection by actor) in commands/agent_connections.go: keep connectionIDForActor from main, and this branch's completeConnectionAuth comment, which now also covers reconnect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
doctl harness-runtime connections revokeaccepts only the connection id, which the server assigns. A user who knows the actor has to runconnections list --actorand copy the id first. Revoke now also takes--actor, looks up that actor's connection for the provider, and revokes it.Jira: MARSOHS-2183
Scope
Blast radius
🟡 Services: doctl (
harness-runtime connections revoke) · Customers: new opt-in--actorflag; revoke by id behaves as before.Rollout
Decisions
connectionIDForActor)alice-botforalicecannot cause a wrong revoke.Evidence
New revoke tests (by actor, none, several, other actor's row, a second match on page 2, the page cap, id plus
--actor, 501 on lookup) pass;go test ./commands/... ./do/...passes exceptTestRegistryLoginandTestRegistryLogout, which fail the same way onmain. Not run: against a live environment.