@@ -21,8 +21,8 @@ import (
2121 "time"
2222
2323 "github.com/fsnotify/fsnotify"
24- "github.com/router-for-me/CLIProxyAPI/v6/internal/config"
2524 kiroauth "github.com/router-for-me/CLIProxyAPI/v6/internal/auth/kiro"
25+ "github.com/router-for-me/CLIProxyAPI/v6/internal/config"
2626 "github.com/router-for-me/CLIProxyAPI/v6/internal/runtime/geminicli"
2727 "github.com/router-for-me/CLIProxyAPI/v6/internal/watcher/diff"
2828 "gopkg.in/yaml.v3"
@@ -203,7 +203,7 @@ func (w *Watcher) watchKiroIDETokenFile() {
203203
204204 // Kiro IDE stores tokens in ~/.aws/sso/cache/
205205 kiroTokenDir := filepath .Join (homeDir , ".aws" , "sso" , "cache" )
206-
206+
207207 // Check if directory exists
208208 if _ , statErr := os .Stat (kiroTokenDir ); os .IsNotExist (statErr ) {
209209 log .Debugf ("Kiro IDE token directory does not exist: %s" , kiroTokenDir )
@@ -657,16 +657,16 @@ func (w *Watcher) handleEvent(event fsnotify.Event) {
657657 normalizedAuthDir := w .normalizeAuthPath (w .authDir )
658658 isConfigEvent := normalizedName == normalizedConfigPath && event .Op & configOps != 0
659659 authOps := fsnotify .Create | fsnotify .Write | fsnotify .Remove | fsnotify .Rename
660- isAuthJSON := strings .HasPrefix (normalizedName , normalizedAuthDir ) && strings .HasSuffix (normalizedName , ".json" ) && event .Op & authOps != 0
661-
660+ isAuthJSON := strings .HasPrefix (normalizedName , normalizedAuthDir ) && strings .HasSuffix (normalizedName , ".json" ) && event .Op & authOps != 0
661+
662662 // Check for Kiro IDE token file changes
663663 isKiroIDEToken := w .isKiroIDETokenFile (event .Name ) && event .Op & authOps != 0
664-
664+
665665 if ! isConfigEvent && ! isAuthJSON && ! isKiroIDEToken {
666666 // Ignore unrelated files (e.g., cookie snapshots *.cookie) and other noise.
667667 return
668668 }
669-
669+
670670 // Handle Kiro IDE token file changes
671671 if isKiroIDEToken {
672672 w .handleKiroIDETokenChange (event )
@@ -765,7 +765,7 @@ func (w *Watcher) handleKiroIDETokenChange(event fsnotify.Event) {
765765 log .Infof ("Kiro IDE token file updated, access token refreshed (provider: %s)" , tokenData .Provider )
766766
767767 // Trigger auth state refresh to pick up the new token
768- w .refreshAuthState ()
768+ w .refreshAuthState (true )
769769
770770 // Notify callback if set
771771 w .clientsMutex .RLock ()
@@ -1381,15 +1381,15 @@ func (w *Watcher) SnapshotCoreAuths() []*coreauth.Auth {
13811381 continue
13821382 }
13831383 t , _ := metadata ["type" ].(string )
1384-
1384+
13851385 // Detect Kiro auth files by auth_method field (they don't have "type" field)
13861386 if t == "" {
13871387 if authMethod , _ := metadata ["auth_method" ].(string ); authMethod == "builder-id" || authMethod == "social" {
13881388 t = "kiro"
13891389 log .Debugf ("SnapshotCoreAuths: detected Kiro auth by auth_method: %s" , name )
13901390 }
13911391 }
1392-
1392+
13931393 if t == "" {
13941394 log .Debugf ("SnapshotCoreAuths: skipping file without type: %s" , name )
13951395 continue
@@ -1452,7 +1452,7 @@ func (w *Watcher) SnapshotCoreAuths() []*coreauth.Auth {
14521452 a .NextRefreshAfter = expiresAt .Add (- 30 * time .Minute )
14531453 }
14541454 }
1455-
1455+
14561456 // Apply global preferred endpoint setting if not present in metadata
14571457 if cfg .KiroPreferredEndpoint != "" {
14581458 // Check if already set in metadata (which takes precedence in executor)
0 commit comments