You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] International site: console commands still report NotLogined after AK/SK auto-refresh (GenerateCLIAccessToken token rejected) #195
After bl auth login --open-api, a console command that hits NotLogined silently refreshes the access token from AK/SK and retries successfully.
Actual
The refresh runs and GenerateCLIAccessToken returns 200 with a cliAccessToken, but the retried console call still fails with Console session is not logged in or has expired. (exit 3). Every console command is affected (usage token-plan, usage free, workspace list).
Two separate problems observed:
1. Region resolution falls back to cn for non-DashScope base URLs
packages/core/src/auth/refresh-token.ts → resolveRegion() only matches the three REGIONS DashScope URLs. A token-plan profile (*.ap-southeast-1.maas.aliyuncs.com) doesn't match, so the refresh goes to modelstudio.cn-beijing.aliyuncs.com for an international account.
> POST https://bailian-singapore-cs.alibabacloud.com/cli/api.json?action=IntlBroadScopeAspnGateway&...
< 200
Refreshing access token...
> POST https://modelstudio.cn-beijing.aliyuncs.com/modelstudio/cli/generateAccessToken
< 200 OK
> POST https://bailian-singapore-cs.alibabacloud.com/cli/api.json?...
< 200
Error: Console session is not logged in or has expired.
2. Even with the correct intl host, the token is rejected
To rule out (1) I created a profile with base_url=https://dashscope-intl.aliyuncs.com, console_site=international, console_region=ap-southeast-1, then bl auth login --open-api. The refresh now hits modelstudio.ap-southeast-1.aliyuncs.com and gets a token, but the intl console gateway still answers NotLogined for all console commands.
So on the international site the token produced by GenerateCLIAccessToken does not appear to be accepted by IntlBroadScopeAspnGateway (at least for a RAM user). Is there a required RAM permission / workspace membership / site setting for this to work, or is intl not supported yet?
Side effect worth noting
bl auth login --open-api and every failed auto-refresh overwrite access_token in config.json, which replaces a still-valid browser-login console session with an unusable token. A guard (only overwrite when the new token actually passes a console call) would avoid that.
Repro
International account, RAM user with AliyunBailianFullAccess, Permanent AccessKey.
Adding impact context from another international-site Token Plan user (Linux, bl 2.3.1, token-plan profile on ap-southeast-1).
We rely on bl through CodexBar for always-on Token Plan usage monitoring. The browser console ticket expires within days (detailed in #202), so the AK/SK auto-refresh described here would be our only unattended recovery path — but per this issue it does not currently work against the international gateway, and we have no other silent way to renew the session. The result is that monitoring goes dark every few days until someone does an interactive bl auth login --console --console-site international.
We have not configured AK/SK on this account yet, so this is not an independent repro of the token rejection — just noting that the international Token Plan audience blocked by #202 is the same audience that needs this refresh path to work.
Activity
Josephur commentedon Oct 17, 2026
Adding impact context from another international-site Token Plan user (Linux,
bl2.3.1,token-planprofile onap-southeast-1).We rely on
blthrough CodexBar for always-on Token Plan usage monitoring. The browser console ticket expires within days (detailed in #202), so the AK/SK auto-refresh described here would be our only unattended recovery path — but per this issue it does not currently work against the international gateway, and we have no other silent way to renew the session. The result is that monitoring goes dark every few days until someone does an interactivebl auth login --console --console-site international.We have not configured AK/SK on this account yet, so this is not an independent repro of the token rejection — just noting that the international Token Plan audience blocked by #202 is the same audience that needs this refresh path to work.