Skip to content

feat(console): resolve gateway URL from region + site, add switchAgent#56

Open
lishengzxc wants to merge 11 commits into
mainfrom
feat/console-gateway-region-site
Open

feat(console): resolve gateway URL from region + site, add switchAgent#56
lishengzxc wants to merge 11 commits into
mainfrom
feat/console-gateway-region-site

Conversation

@lishengzxc

Copy link
Copy Markdown
Contributor

feat(console): resolve gateway URL from region + site, add switchAgent support

Console gateway URL and action are now resolved from a region + site mapping table instead of a single hardcoded config value. Supports cn-beijing and ap-southeast-1 with domestic/international site variants.

  • Add ConsoleSite type, REGION_GATEWAYS mapping, and resolveGateway()
  • Add switchAgent to cornerstoneParam for delegated access
  • Add console_site, console_region, console_switch_agent to config
  • Remove consoleGatewayUrl from Config (replaced by region+site resolution)
  • login-console callback now persists baseUrl, site, region, switchAgent
  • bl console call gains --site and --switch-agent flags
  • All callers delegate region default to callConsoleGateway (no more hardcoded cn-beijing)

lishengzxc and others added 11 commits June 14, 2026 20:17
…t support

Console gateway URL and action are now resolved from a region + site
mapping table instead of a single hardcoded config value. Supports
cn-beijing and ap-southeast-1 with domestic/international site variants.

- Add ConsoleSite type, REGION_GATEWAYS mapping, and resolveGateway()
- Add switchAgent to cornerstoneParam for delegated access
- Add console_site, console_region, console_switch_agent to config
- Remove consoleGatewayUrl from Config (replaced by region+site resolution)
- login-console callback now persists baseUrl, site, region, switchAgent
- bl console call gains --site and --switch-agent flags
- All callers delegate region default to callConsoleGateway (no more hardcoded cn-beijing)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract hasConfig variable to deduplicate the multi-field condition check,
remove the changed flag pattern in favor of direct write-through.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… from POST body

These fields were only extracted from query params but the console
sends them in the JSON POST body. Add parseExtrasFromRawBody() to
handle JSON and form-urlencoded bodies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…with callback's baseUrl

Move apiKey validation into login-console.ts so it uses the baseUrl
from the same callback (not stale config). All fields are now persisted
in one place: config fields first, then apiKey validated + written.

Remove onApiKey callback indirection from runConsoleLogin signature.
Clean up debug logging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When used with --api-key, validates the key against the specified
base URL and persists it to config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… login-console.ts

Export validateAndPersistApiKey from login-console.ts and reuse in
login.ts. Remove duplicated canRetry, RETRY_DELAY_BASE_MS, and
validateKeyAndPersist from login.ts. Unify validation model to
qwen3.7-max. Reorder base_url write before apiKey validation in
the --api-key path to avoid double read-modify-write.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Field was replaced by region+site gateway resolution but ConfigFile
definition, parseConfigFile logic, and test case were left behind.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adapts to bailian-cli-login af06baf which added workspace_id to the
notifyToken payload. The field is parsed from query/body and written
to config.json as workspace_id.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant