Skip to content

feat(alibaba): fix SSL issues and improve error handling#628

Open
XWind18 wants to merge 1 commit intosteipete:mainfrom
XWind18:feature/Alibaba
Open

feat(alibaba): fix SSL issues and improve error handling#628
XWind18 wants to merge 1 commit intosteipete:mainfrom
XWind18:feature/Alibaba

Conversation

@XWind18
Copy link
Copy Markdown

@XWind18 XWind18 commented Mar 31, 2026

Summary

Fix SSL connection issues for Alibaba Coding Plan provider in mainland China region and improve error messaging when API Key mode is unavailable.
Problem:

  • bailian-beijing-cs.aliyuncs.com and other *-cs.aliyuncs.com endpoints frequently fail SSL handshake in CN region
  • API Key mode is unavailable for some CN accounts, but error messages were unclear
    Solution:
  1. Use bailian.console.aliyun.com instead of RPC endpoints to bypass SSL issues
  2. Add new apiKeyUnavailableInRegion error type with actionable guidance
  3. Improve error handling logic to properly distinguish login required vs API Key unavailable scenarios
    Changed Files:
  • AlibabaCodingPlanAPIRegion.swift - Endpoint URL fix
  • AlibabaCodingPlanProviderDescriptor.swift - Error retry logic
  • AlibabaCodingPlanUsageFetcher.swift - New error type and messaging

Commands Run

# Build verification
swift build -c release
# Test verification
swift test --filter "AlibabaCodingPlan"
# Code formatting
swiftformat Sources Tests
swiftlint --strict
Test Result: ✅ 32/32 Alibaba-related tests passed
---
Screenshots
No UI changes.
---
Linked Issue / Reference
- Related to: #574 (Add Alibaba Coding Plan provider)
- Fixes CN region SSL handshake failures reported in production
---
Checklist
- [x] Code follows SwiftFormat/SwiftLint rules
- [x] Tests pass (swift test)
- [x] Commit message follows project conventions
- [x] No new dependencies added
- [x] Error handling improved

- Use bailian.console.aliyun.com to bypass SSL handshake failures on CN region
- Add apiKeyUnavailableInRegion error with actionable guidance
- Update error handling logic for console login responses
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