| 735 | } |
| 736 | |
| 737 | func (s *Service) applyCoreAuthRemoval(ctx context.Context, id string) { |
| 738 | if s == nil || id == "" { |
| 739 | return |
| 740 | } |
| 741 | if s.coreManager == nil { |
| 742 | return |
| 743 | } |
| 744 | id = strings.TrimSpace(id) |
| 745 | var provider string |
| 746 | if existing, ok := s.coreManager.GetByID(id); ok && existing != nil { |
| 747 | provider = strings.TrimSpace(existing.Provider) |
| 748 | } |
| 749 | GlobalModelRegistry().UnregisterClient(id) |
| 750 | s.coreManager.Remove(ctx, id) |
| 751 | if strings.EqualFold(provider, "codex") { |
| 752 | executor.CloseCodexWebsocketSessionsForAuthID(id, "auth_removed") |
| 753 | } |
| 754 | if strings.EqualFold(provider, "xai") { |
| 755 | executor.CloseXAIWebsocketSessionsForAuthID(id, "auth_removed") |
| 756 | } |
| 757 | s.syncPluginRuntime(ctx) |
| 758 | } |
| 759 | |
| 760 | func (s *Service) applyRetryConfig(cfg *config.Config) { |
| 761 | if s == nil || s.coreManager == nil || cfg == nil { |