feat(config): unify region/domain/internal settings#4
Open
vaaandark wants to merge 3 commits intoTencentCloudAgentRuntime:mainfrom
Open
feat(config): unify region/domain/internal settings#4vaaandark wants to merge 3 commits intoTencentCloudAgentRuntime:mainfrom
vaaandark wants to merge 3 commits intoTencentCloudAgentRuntime:mainfrom
Conversation
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.
Unify region/domain/internal settings
Summary
Consolidate duplicated
region,domain, andinternalconfiguration fields from backend-specific[e2b]/[cloud]sections into unified top-level fields, reducing configuration complexity and ensuring consistent endpoint construction across all backends.Motivation
Previously, users had to set
e2b.region,e2b.domain,cloud.region, andcloud.internalseparately under each backend section, even though these values were almost always identical. This PR introduces top-levelregion,domain, andinternalfields as the single source of truth.Changes
Config & CLI
region,domain,internalconfig fields with corresponding--region,--domain,--internalCLI flags andAGS_REGION,AGS_DOMAIN,AGS_INTERNALenv vars--e2b-region,--e2b-domain,--cloud-region,--cloud-internalflags (with deprecation warnings)resolveDeprecatedFields()to migrate legacy fields with clear priority: top-level > current-backend legacy > cross-backend fallback > defaultinternalflag intodomainat config resolution time (internal=true→domain = "internal." + domain), so downstream code only readsdomainviper.IsSet("internal")to distinguish explicitinternal=falsefrom the default zero valueClient Layer
config.GetRegion()/config.GetDomain()instead of backend-specific accessorsDocs & Config
docs/ags-config.md/docs/ags-config-zh.md— dedicated configuration referenceconfig.example.tomlwith unified fields and deprecation notesags.md,ags-zh.md) with new flagsTests
resolveDeprecatedFields, setter functions, endpoint construction, and validation (all priority/branch combinations from the review checklist)Backward Compatibility
All deprecated fields and flags remain functional with automatic migration. A deprecation warning is printed to stderr when legacy fields are used. No breaking changes.