refactor(client): Improve auth file handling and client lifecycle

This commit is contained in:
hkfires
2025-09-19 08:04:53 +08:00
parent 6bd37b2a2b
commit 39518ec633
4 changed files with 32 additions and 27 deletions

View File

@@ -172,6 +172,7 @@ func NewGeminiWebClient(cfg *config.Config, ts *gemini.GeminiWebTokenStorage, to
go client.backgroundInitRetry()
} else {
client.cookieRotationStarted = true
client.registerModelsOnce()
// Persist immediately once after successful init to capture fresh cookies
_ = client.SaveTokenToFile()
client.startCookiePersist()