Skip to content

hosted agents: carry deletion_protected on connections (MARSOHS-2173) - #1171

Merged
SSharma-10 merged 1 commit into
digitalocean:mainfrom
BadhriDO:marsohs-2173-connection-deletion-protected
Oct 16, 2026
Merged

SSharma-10 merged 1 commit into
digitalocean:mainfrom
BadhriDO:marsohs-2173-connection-deletion-protected

Conversation

@BadhriDO

@BadhriDO BadhriDO commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

harness-api returns deletion_protected on every connection object, but HostedAgentConnection has no such field, so encoding/json discards it and no client can read it. This PR adds DeletionProtected. A client can now tell a connection that is safe to revoke from one an agent environment depends on.
Jira: MARSOHS-2173

Scope

 type HostedAgentConnection struct {
 	ID                  string                      `json:"id"`
 	Provider            string                      `json:"provider"`
 	ProviderDisplayName string                      `json:"provider_display_name,omitempty"`
 	ActorID             string                      `json:"user_id"`
 	Status              string                      `json:"status"`
 	OwningUserID        string                      `json:"owning_user_id,omitempty"`
+	DeletionProtected   bool                        `json:"deletion_protected"`
 	CreatedAt           *Timestamp                  `json:"created_at,omitempty"`
 	UpdatedAt           *Timestamp                  `json:"updated_at,omitempty"`
 	OAuth               *HostedAgentConnectionOAuth `json:"oauth,omitempty"`
 }

Out of scope: rendering the field in doctl harness-runtime connections, which bumps godo after this releases (same ticket).

Blast radius

🟢 Services: none, client library only · Customers: none; the field is read-only and additive.

Rollout

  • Rollback: revert; consumers pinned to an older godo are unaffected.
  • Order: the doctl change needs a release that contains this field; until then doctl keeps discarding it.

Decisions

  • Plain bool, not *bool: the API sends the key on every connection, so a caller never has to tell "false" from "absent", and a pointer would put a nil check in every consumer.
  • No omitempty, which matches the server, so a consumer that re-marshals the struct cannot drop false.

Evidence

go test . passes. Without the field the suite fails to build, and TestHostedAgents_ListConnections asserts the whole struct, so a later removal fails the suite.

🤖 Generated with Claude Code

harness-api returns deletion_protected on every connection object, but
HostedAgentConnection had no such field, so encoding/json discarded it
and no client could read it. Add DeletionProtected, without omitempty,
matching the server. A client can now tell a connection that is safe to
revoke from one an agent environment depends on.

Blast radius: client library only, no service behaviour changes; no
customer-visible change until a consumer renders the field.
Rollback: revert; consumers pinned to an older godo are unaffected.

MARSOHS-2173

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@SSharma-10
SSharma-10 merged commit 1a56cf3 into digitalocean:main Oct 16, 2026
8 checks passed
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

⌂ 换网址