Repository navigation
hosted agents: always encode resume_on_topoff on sessions (MARSOHS-2563) - #1204
Merged
Merged
Conversation
HostedAgentSession.ResumeOnTopoff was tagged omitempty, so a session whose consent was never granted, or was revoked, re-encoded without the key. Clients that print the decoded struct (doctl -o json) therefore could not show false, and a revoked consent looked the same as a missing field. The request types keep omitempty. Co-authored-by: Cursor <cursoragent@cursor.com>
sdharavath
approved these changes
Nov 3, 2026
sdharavath
approved these changes
Nov 3, 2026
DO-rrao
approved these changes
Nov 4, 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.
HostedAgentSession.ResumeOnTopoffis now taggedjson:"resume_on_topoff"instead ofjson:"resume_on_topoff,omitempty".Why: the API leaves
resume_on_topoffout of a session when it is false. Decoding that is fine, but any client that prints the decoded struct again also dropped the key, because ofomitempty.doctl harness-runtime show <session> -o jsonis one: afterdoctl harness-runtime update <session> --resume-on-topoff=false, the output had noresume_on_topoffat all, so a revoked consent looked the same as a missing field. With the tag change it prints"resume_on_topoff": false.HostedAgentSessionis only used for responses, so nothing godo sends changes. The request types (HostedAgentManifestCreateOptions,HostedAgentSessionFromConfigRequest,HostedAgentSessionUpdateRequest) keepomitempty; on the update request it is what keeps an unmentioned field from revoking consent.Testing:
go test ./...passes.TestHostedAgentSession_JSONOmitsFalseResumeOnTopoffis replaced byTestHostedAgentSession_JSONEmitsFalseResumeOnTopoff, which decodes a session without the key and checks that it encodes asfalse.A doctl change that updates its tests for this will follow once a godo release includes it.