Repository navigation
feat(MARSOHS-2085): expose region on Hosted Agents sessions and environments - #1192
Merged
SSharma-10 merged 1 commit intoOct 24, 2026
Conversation
…onments Sessions and Environments are regional resources: the API host a request reaches decides where a create is placed and where a resource can be found. Add Region to HostedAgentSession, HostedAgentConfig and HostedAgentConfigSummary, Region (placement check) to HostedAgentSessionFromEnvironmentRequest, lift the create response's Location header onto the created resource, and add HostedAgentsRegionalBaseURL so callers can point a client at api-<region>.digitalocean.com. No new dialers; empty fields are omitted so existing bodies are unchanged.
sk09-dev
approved these changes
Oct 23, 2026
Merged
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.
Why
Hosted Agents resources are now regional (
MARSOHS-2085). The API host a request reaches decides where a create is placed and where a resource can be found:api.digitalocean.complaces in and serves the default region (ric1);api-<region>.digitalocean.complaces in and serves that region. A resource is a 404 on every other region's host; there is no redirect, forwarding or fan-out. godo had no way to see or state a region.What
HostedAgentSession.Region,HostedAgentConfig.Region,HostedAgentConfigSummary.Region(json:"region,omitempty"), returned on create/get/list for teams on the regional routing rollout, omitted otherwise.HostedAgentSessionFromEnvironmentRequest.Region(omitempty): an optional placement check that must match the host called, else the server answers 4xxregion_mismatch. Not sent when empty, so today's body is byte-for-byte unchanged. The YAML manifest create and the Environment create carry no region (the server rejects unknown body fields); placement is the host.Location(json:"-") onHostedAgentSessionandHostedAgentConfig, lifted from the create response'sLocationheader on every create method; the canonical URL on the owning region's host.HostedAgentsRegionalBaseURL(region): returnshttps://api-<region>.digitalocean.com/in the formSetBaseURLaccepts (empty region → default base URL). No new dialers: callers build a client per region.Tests
TestHostedAgents_CreateSessionFromEnvironment_RegionAndLocation: body region sent as given;Region,LocationandX-DO-Regionsurface.TestHostedAgents_CreateSessionFromEnvironment_NoRegionIsOmitted: noregionkey when empty; no header → emptyLocation.TestHostedAgents_CreateEnvironment_RegionAndLocation,TestHostedAgents_ListEnvironments_Region: environment create has no body region; responseregion/Locationsurface on create and list.TestHostedAgentsRegionalBaseURL.go vet ./... && go test .green. CHANGELOG left for the release PR per CONTRIBUTING.