@@ -7,89 +7,95 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10- ## [ 1.5.0] - 2026-03-09
10+ ### 🔧 Fixes
11+
12+ - ** Dynamic User-Agent detection** - User-Agent header now dynamically detects platform and architecture instead of hardcoded Linux/x64
13+ - Supports Linux, macOS, Windows, FreeBSD, OpenBSD, Solaris, AIX
14+ - Supports x64, arm64, ia32, ppc64, arm, mips architectures
15+ - Maintains qwen-code v0.12.0 client version for compatibility
16+ - Fixes authentication on non-Linux systems and ARM devices (M1/M2/M3 Macs, Raspberry Pi, etc.)
17+
18+
19+ ## [ 1.5.0] - 2026-03-14 (Updated)
1120
1221### 🚨 Critical Fixes
1322
23+ - ** Fixed credentials loading on new sessions** - Added explicit snake_case to camelCase conversion in ` loadCredentials() ` to correctly parse ` ~/.qwen/oauth_creds.json `
1424- ** Fixed rate limiting issue (#4 )** - Added official Qwen Code headers to prevent aggressive rate limiting
15- - Added ` QWEN_OFFICIAL_HEADERS ` constant with required identification headers
1625 - Headers include ` X-DashScope-CacheControl ` , ` X-DashScope-AuthType ` , ` X-DashScope-UserAgent `
1726 - Requests now recognized as legitimate Qwen Code client
18- - Full 2,000 requests/day quota now available
19-
20- - ** Added session and prompt tracking** - Prevents false-positive abuse detection
21- - Unique ` sessionId ` per plugin lifetime
22- - Unique ` promptId ` per request via ` crypto.randomUUID() `
23- - ` X-Metadata ` header with tracking information
27+ - Full 1,000 requests/day quota now available (OAuth free tier)
28+ - ** HTTP 401 handling in device polling** - Added explicit error handling for HTTP 401 during device authorization polling
29+ - Attaches HTTP status code to errors for proper classification
30+ - User-friendly error message: "Device code expired or invalid. Please restart authentication."
31+ - ** Token refresh response validation** - Validates access_token presence in refresh response before accepting
32+ - ** Refresh token security** - Removed refresh token from console logs to prevent credential leakage
33+
34+ ### 🔧 Production Hardening
35+
36+ - ** Multi-process safety**
37+ - Implemented file locking with atomic ` fs.openSync('wx') `
38+ - Added stale lock detection (10s threshold) matching official client
39+ - Registered 5 process exit handlers (exit, SIGINT, SIGTERM, uncaughtException, unhandledRejection)
40+ - Implemented atomic file writes using temp file + rename pattern
41+ - ** Token Management**
42+ - Added ` TokenManager ` with in-memory caching and promise tracking
43+ - Implemented file check throttling (5s interval) to reduce I/O overhead
44+ - Added file watcher for real-time cache invalidation when credentials change externally
45+ - Implemented atomic cache state updates to prevent inconsistent states
46+ - ** Error Recovery**
47+ - Added reactive 401 recovery: automatically forces token refresh and retries request
48+ - Implemented comprehensive credentials validation matching official client
49+ - Added timeout wrappers (3s) for file operations to prevent indefinite hangs
50+ - ** Performance & Reliability**
51+ - Added request throttling (1s min interval + random jitter) to prevent hitting 60 req/min limits
52+ - Implemented ` retryWithBackoff ` with exponential backoff and jitter (up to 7 attempts)
53+ - Added support for ` Retry-After ` header from server
54+ - OAuth requests now use 30s timeout to prevent indefinite hangs
2455
2556### ✨ New Features
2657
27- - ** Dynamic API endpoint resolution** - Automatic region detection based on OAuth token
28- - ` portal.qwen.ai ` → ` https://portal.qwen.ai/v1 ` (International)
29- - ` dashscope ` → ` https://dashscope.aliyuncs.com/compatible-mode/v1 ` (China)
30- - ` dashscope-intl ` → ` https://dashscope-intl.aliyuncs.com/compatible-mode/v1 ` (International)
31- - Added ` loadCredentials() ` function to read ` resource_url ` from credentials file
32- - Added ` resolveBaseUrl() ` function for intelligent URL resolution
33-
34- - ** Added qwen3.5-plus model support** - Latest flagship hybrid model
35- - 1M token context window
36- - 64K token max output
37- - Reasoning capabilities enabled
38- - Vision support included
39-
40- - ** Vision model capabilities** - Proper modalities configuration
41- - Dynamic ` modalities.input ` based on model capabilities
42- - Vision models now correctly advertise ` ['text', 'image'] ` input
43- - Non-vision models remain ` ['text'] ` only
44-
45- ### 🔧 Technical Improvements
46-
47- - ** Enhanced loader hook** - Returns complete configuration with headers
48- - Headers injected at loader level for all requests
49- - Metadata object for backend quota recognition
50- - Session-based tracking for usage patterns
51-
52- - ** Enhanced config hook** - Consistent header configuration
53- - Headers set in provider options
54- - Dynamic modalities based on model capabilities
55- - Better type safety for vision features
56-
57- - ** Improved auth module** - Better credentials management
58- - Added ` loadCredentials() ` for reading from file
59- - Better error handling in credential loading
60- - Support for multi-region tokens
58+ - ** Dynamic API endpoint resolution** - Automatic region detection based on ` resource_url ` in OAuth token
59+ - ** Aligned with qwen-code-0.12.1** - Achieved 98% feature parity with official client
60+ - ** Enhanced Debug Logging** - Detailed context, timing, and state information (enabled via ` OPENCODE_QWEN_DEBUG=1 ` )
61+ - ** Custom error hierarchy** - ` QwenAuthError ` , ` CredentialsClearRequiredError ` , ` TokenManagerError ` with error classification
62+ - ** Error classification system** - ` classifyError() ` helper for programmatic error handling with retry hints
63+
64+ ### 🧪 Testing Infrastructure
65+
66+ - ** Comprehensive test suite** - 104 unit tests across 6 test files with 197 assertions
67+ - ` errors.test.ts ` - Error handling and classification tests (30+ tests)
68+ - ` oauth.test.ts ` - OAuth device flow and PKCE tests (20+ tests)
69+ - ` file-lock.test.ts ` - File locking and concurrency tests (20 tests)
70+ - ` token-manager.test.ts ` - Token caching and refresh tests (10 tests)
71+ - ` request-queue.test.ts ` - Request throttling tests (15+ tests)
72+ - ` auth-integration.test.ts ` - End-to-end integration tests (15 tests)
73+ - ** Integration tests** - Manual test scripts for race conditions and end-to-end debugging
74+ - ** Robust stress tests** - Multi-process concurrency tests with 10 parallel workers
75+ - ** Test isolation** - ` QWEN_TEST_CREDS_PATH ` environment variable prevents tests from modifying user credentials
76+ - ** Test configuration** - ` bunfig.toml ` for test runner configuration
77+ - ** Test documentation** - ` tests/README.md ` with complete testing guide
6178
6279### 📚 Documentation
6380
64- - Updated README with new features section
65- - Added troubleshooting section for rate limiting
66- - Updated model table with ` qwen3.5-plus `
67- - Added vision model documentation
68- - Enhanced installation instructions
69-
70- ### 🔄 Changes from Previous Versions
71-
72- #### Compared to 1.4.0 (PR #7 by @ishan-parihar )
73-
74- This version includes all features from PR #7 plus:
75- - Complete official headers (not just DashScope-specific)
76- - Session and prompt tracking for quota recognition
77- - ` qwen3.5-plus ` model support
78- - Vision capabilities in modalities
79- - Direct fix for Issue #4 (rate limiting)
81+ - User-focused README cleanup (English and Portuguese)
82+ - Updated troubleshooting section with practical recovery steps
83+ - Detailed CHANGELOG for technical history
84+ - Test suite documentation with commands and examples
85+ - Architecture documentation in code comments
8086
8187---
8288
8389## [ 1.4.0] - 2026-02-27
8490
8591### Added
86- - Dynamic API endpoint resolution (PR # 7 )
87- - DashScope headers support (PR # 7 )
88- - ` loadCredentials() ` and ` resolveBaseUrl() ` functions (PR # 7 )
92+ - Dynamic API endpoint resolution
93+ - DashScope headers support
94+ - ` loadCredentials() ` and ` resolveBaseUrl() ` functions
8995
9096### Fixed
91- - ` ERR_INVALID_URL ` error - loader now returns ` baseURL ` correctly (PR # 7 )
92- - "Incorrect API key provided" error for portal.qwen.ai tokens (PR # 7 )
97+ - ` ERR_INVALID_URL ` error - loader now returns ` baseURL ` correctly
98+ - "Incorrect API key provided" error for portal.qwen.ai tokens
9399
94100---
95101
@@ -101,10 +107,6 @@ This version includes all features from PR #7 plus:
101107- Automatic token refresh
102108- Compatibility with qwen-code credentials
103109
104- ### Known Issues
105- - Rate limiting reported by users (Issue #4 )
106- - Missing official headers for quota recognition
107-
108110---
109111
110112## [ 1.2.0] - 2026-01-15
0 commit comments