feat(cloud): active-target selection core (set_active_target)#67
Merged
sourcehawk merged 6 commits intoMay 31, 2026
Merged
Conversation
…owup) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ication Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…gured Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Provider interface gained ConfiguredTargets and ActiveTargetEnv, so the gcp and aws realizations and the providers-package probe double must implement them to keep the tree compiling. gcp pins CLOUDSDK_CORE_PROJECT and returns no configured set (its set is scope/inventory); aws pins AWS_PROFILE. The deployment-configured aws accounts list arrives with the AWS accounts config. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Description
Towards #44
Adds the provider-agnostic core that lets the operator agent pick which project (GCP) or account (AWS) subsequent
run_clicommands run against, from a deployment-pinned set. The cloud MCPServernow holds the active target as in-memory session state and injects a provider-supplied env var into eachrun_clichild process, never viaos.Setenv— the same per-exec discipline the identity probe follows. This is PR A of the feature: it lands theProviderinterface extension, the server state and selectable-set logic, theset_active_targettool, and therun_cliguard, all driven against the in-package fake. The GCP/AWS account config and launcher wiring follow in PR B.Changes
Providerinterface gainsConfiguredTargets() []TargetandActiveTargetEnv(targetID string) []string; newTarget{ID,Name}type.Servertracks anactiveTarget;selectableTargetsresolves it from configured targets →scope.Projects→ live inventory, andsetActiverejects any id outside that set so the agent can never name an arbitrary target.subprocessEnvappends the provider's active-target env per exec; a single selectable target is default-active from session start.set_active_targettool (registered betweensession_statusandrun_cli, added toToolSpecs()); the wire test enforces the catalog match.run_clireturns an actionable error pointing atset_active_targetwhen no target is active and more than one is selectable.session_statusreports the active target via a newIdentityStatus.ActiveTargetfield.CLOUDSDK_CORE_PROJECT; aws:AWS_PROFILE); PR B fleshes out the AWS accounts/profile generation.Challenges
Widening the
Providerinterface broke the compile-time conformance assertions in the gcp/aws providers and a probe test double. Rather than land a red build, this PR gives them the methods now — gcp in its final form, aws in the minimal correct shape that PR B's profile-name logic replaces.Related
docs/superpowers/specs/2026-05-31-cloud-active-target-selection-design.md.Testing
make test-go(race-clean, 43 packages, 0 failures) andmake lint(0 issues) both green. New tests inpkg/mcp/cloudcover: the fake satisfying the extended interface;selectableTargetsacross all three fallback sources;setActivemembership rejection;subprocessEnvtarget injection; single- vs multi-target default-active; theset_active_targettool (valid + rejected ids);run_cli's no-active-target guard and its release once a target is set; andsession_statusreporting the active target. The wire test fails ifset_active_targetregistration drifts fromToolSpecs(). Nofrontend/changes.🤖 Generated with Claude Code