diff --git a/internal/client/gemini-web_client.go b/internal/client/gemini-web_client.go index ea002380..3f7e0535 100644 --- a/internal/client/gemini-web_client.go +++ b/internal/client/gemini-web_client.go @@ -80,10 +80,9 @@ func (c *GeminiWebClient) unregisterClient(reason interfaces.UnregisterReason) { util.RemoveCookieSnapshots(c.tokenFilePath) } case interfaces.UnregisterReasonAuthFileUpdated: - if c.snapshotManager != nil { - if err := c.snapshotManager.Persist(); err != nil { - log.Errorf("Failed to persist Gemini Web cookies for %s: %v", filepath.Base(c.tokenFilePath), err) - } + if c.snapshotManager != nil && c.tokenFilePath != "" { + log.Debugf("skipping Gemini Web snapshot flush because auth file was updated: %s", filepath.Base(c.tokenFilePath)) + util.RemoveCookieSnapshots(c.tokenFilePath) } default: // Flush cookie snapshot to main token file and remove snapshot diff --git a/internal/client/qwen_client.go b/internal/client/qwen_client.go index a6c4e156..74e2416a 100644 --- a/internal/client/qwen_client.go +++ b/internal/client/qwen_client.go @@ -525,8 +525,9 @@ func (c *QwenClient) unregisterClient(reason interfaces.UnregisterReason) { util.RemoveCookieSnapshots(c.tokenFilePath) } case interfaces.UnregisterReasonAuthFileUpdated: - if err := c.snapshotManager.Persist(); err != nil { - log.Errorf("Failed to persist Qwen cookies for %s: %v", filepath.Base(c.tokenFilePath), err) + if c.tokenFilePath != "" { + log.Debugf("skipping Qwen snapshot flush because auth file was updated: %s", filepath.Base(c.tokenFilePath)) + util.RemoveCookieSnapshots(c.tokenFilePath) } case interfaces.UnregisterReasonShutdown, interfaces.UnregisterReasonReload: if err := c.snapshotManager.Flush(); err != nil {