Add token refresh handling for 401 responses across clients

- Implemented `RefreshTokens` method in client interfaces and Gemini clients.
- Updated handlers to call `RefreshTokens` on 401 responses and retry requests if token refresh succeeds.
- Enhanced error handling and retry logic to accommodate token refresh flow.

Update README to include Qwen login instructions

- Added Qwen OAuth login command instructions in both English and Chinese README files.
- Made minor updates to existing command examples for consistency.
This commit is contained in:
Luis Pater
2025-08-30 16:44:35 +08:00
parent 512c8b600a
commit 0331660fe2
3 changed files with 16 additions and 2 deletions

View File

@@ -263,6 +263,7 @@ func StartService(cfg *config.Config, configPath string) {
for {
select {
case <-ctxRefresh.Done():
log.Debugf("refreshing tokens stopped...")
return
case <-ticker.C:
checkAndRefresh()