[bug] International site: console commands still report NotLogined after AK/SK auto-refresh (GenerateCLIAccessToken token rejected)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- authentication, cli
Rechercherichtung
Beginne mit packages/core/src/auth/refresh-token.ts, insbesondere mit resolveRegion() und den REGIONS-Zuordnungen, und reproduziere anschließend den internationalen Ablauf mit den im Issue aufgeführten Profilen und Befehlen. Vergleiche den Host des generierten Tokens und die Konsolenantwort und untersuche, wie access_token in config.json überschrieben wird. Als abgeschlossen gilt die Untersuchung, wenn das internationale Verhalten verstanden ist und für die gemeldeten Fälle von Refresh, Ablehnung und Sitzungsüberschreibung klare Tests oder dokumentierte Grenzen vorhanden sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Environment
bl1.20.0, macOS- Alibaba Cloud international account, console gateway
ap-southeast-1/international - Profile:
token-plan(base_urlhttps://token-plan.ap-southeast-1.maas.aliyuncs.com) - Credentials: RAM user (Permanent AccessKey only) with
AliyunBailianFullAccess
Expected (per #95)
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. bl auth login --console(works), thenbl auth login --open-api --access-key-id ... --access-key-secret ...bl usage token-plan --verbose→ refresh 200, console still NotLogined.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 333
- Forks
- 28
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 33
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelstudioai/cli
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
modelstudioai/cli#211 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
modelstudioai/cli#202 · 1 Kommentar · 1 Reaktion ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 63/100
modelstudioai/cli#200 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
modelstudioai/cli#190 · 1 Kommentar ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 74/100
modelstudioai/cli#131 ·
Alle Issues in modelstudioai/cli
Ähnliche Issues
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Offenclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
supermomonga/zcode-acp#24 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
growthbook/growthbook#7100 ·
-
triage
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100