Skip to content

fix: support ALIBABA_CLOUD_REGION_ID env var as fallback for region_id#92

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-region-id-logic
Draft

fix: support ALIBABA_CLOUD_REGION_ID env var as fallback for region_id#92
Copilot wants to merge 2 commits intomainfrom
copilot/fix-region-id-logic

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

Config only fell back to AGENTRUN_REGION / FC_REGION for region_id, breaking the ALIBABA_CLOUD_* convention followed by every other credential parameter. Users who set ALIBABA_CLOUD_REGION_ID (standard Alibaba Cloud SDK env var) received cn-hangzhou instead of their configured region.

Changes

  • agentrun/utils/config.py — add ALIBABA_CLOUD_REGION_ID to the region_id fallback chain; update docstring to document all supported env vars
    • Lookup order: explicit param → AGENTRUN_REGIONFC_REGIONALIBABA_CLOUD_REGION_ID"cn-hangzhou"
  • tests/unittests/utils/test_config_extended.py — add tests for ALIBABA_CLOUD_REGION_ID resolution and priority ordering
# Now works without requiring AGENTRUN_REGION
os.environ["ALIBABA_CLOUD_REGION_ID"] = "cn-shanghai"
config = Config()
config.get_region_id()  # "cn-shanghai"

Copilot AI linked an issue Apr 22, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix logic for retrieving region_id in Config method fix: support ALIBABA_CLOUD_REGION_ID env var as fallback for region_id Apr 22, 2026
Copilot AI requested a review from OhYee April 22, 2026 13:44
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.

region_id 获取值的逻辑有问题

2 participants