feat(v1.5.0): fix rate limiting (#4) + dynamic endpoints + official h…#8
feat(v1.5.0): fix rate limiting (#4) + dynamic endpoints + official h…#8luanweslley77 wants to merge 1 commit intogustavodiasdev:mainfrom
Conversation
…s + official headers Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
@luanweslley77 hey thanks for the good updated fork as title says it happens too much and not happening in the cli |
Thank you for letting me know. I've been working on my fork, and I'll be posting another PR here soon. You can download the source code from my main branch at https://github.com/luanweslley77/opencode-qwencode-auth, take the directory and replace ~/.config/opencode/node_modules/opencode-qwencode-auth with my code. It's also necessary to replace ~/.cache/opencode/node_modules/opencode-qwencode-auth. This is working well for me. If you encounter any problems, initially delete the file ~/.qwen/oauth_creds.json. |
|
I don't think Qwen has 2000 req/day. The official docs say 1000 req/day here: https://qwenlm.github.io/qwen-code-docs/en/users/configuration/auth/
|
📋 Summary
This PR resolves the critical rate limiting issue (#4) and introduces dynamic API endpoint resolution with official Qwen Code headers for proper quota recognition.
Fixes #4
✨ Key Changes
Rate Limiting Fix (Issue #4)
Added QWEN_OFFICIAL_HEADERS with required identification headers
Session tracking with unique sessionId per plugin instance
Prompt tracking with unique promptId per request
Full 2,000 requests/day quota now available
Dynamic API Endpoint Resolution
Automatic region detection based on OAuth token resource_url
Support for portal.qwen.ai, dashscope, and dashscope-intl
Works globally with any Qwen account region
Latest Model Support
Added qwen3.5-plus – Latest flagship hybrid model
Vision capabilities with dynamic modalities
Enhanced config hook with proper headers
📁 Files Modified
src/constants.ts – Official headers + qwen3.5-plus model
src/index.ts – Session tracking + headers in loader
src/plugin/auth.ts – loadCredentials() + resolveBaseUrl()
package.json – Version 1.5.0
🧪 Testing
Tested with:
Fresh OAuth authentication
Multiple consecutive requests (no rate limiting)
Session persistence across restarts
qwen3.5-plus model
🔄 Comparison with PR #7
This PR includes all features from PR #7 plus:
✅ Complete official headers (not just DashScope-specific)
✅ Session and prompt tracking for quota recognition
✅ qwen3.5-plus model support
✅ Vision capabilities in modalities
✅ Direct fix for Issue #4