Skip to content

hosted agents: always encode resume_on_topoff on sessions (MARSOHS-2563) - #1204

Merged
DO-rrao merged 2 commits into
mainfrom
jkosanam/marsohs-2563-emit-false-resume-on-topoff
Nov 4, 2026
Merged

DO-rrao merged 2 commits into
mainfrom
jkosanam/marsohs-2563-emit-false-resume-on-topoff

Conversation

@jkosanam

@jkosanam jkosanam commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

HostedAgentSession.ResumeOnTopoff is now tagged json:"resume_on_topoff" instead of json:"resume_on_topoff,omitempty".

Why: the API leaves resume_on_topoff out 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 of omitempty. doctl harness-runtime show <session> -o json is one: after doctl harness-runtime update <session> --resume-on-topoff=false, the output had no resume_on_topoff at all, so a revoked consent looked the same as a missing field. With the tag change it prints "resume_on_topoff": false.

HostedAgentSession is only used for responses, so nothing godo sends changes. The request types (HostedAgentManifestCreateOptions, HostedAgentSessionFromConfigRequest, HostedAgentSessionUpdateRequest) keep omitempty; on the update request it is what keeps an unmentioned field from revoking consent.

Testing: go test ./... passes. TestHostedAgentSession_JSONOmitsFalseResumeOnTopoff is replaced by TestHostedAgentSession_JSONEmitsFalseResumeOnTopoff, which decodes a session without the key and checks that it encodes as false.

A doctl change that updates its tests for this will follow once a godo release includes it.

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>
@DO-rrao
DO-rrao merged commit d7ba0ec into main Nov 4, 2026
8 checks passed
@DO-rrao
DO-rrao deleted the jkosanam/marsohs-2563-emit-false-resume-on-topoff branch November 4, 2026 08:54
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.

3 participants

⌂ 换网址