feat(watcher): add Gemini models and OAuth model mappings change detection

This commit is contained in:
hkfires
2025-12-30 22:13:42 +08:00
parent e947266743
commit 2c01b2ef64
5 changed files with 150 additions and 0 deletions

View File

@@ -71,6 +71,21 @@ func ComputeCodexModelsHash(models []config.CodexModel) string {
return hashJoined(keys)
}
// ComputeGeminiModelsHash returns a stable hash for Gemini model aliases.
func ComputeGeminiModelsHash(models []config.GeminiModel) string {
keys := normalizeModelPairs(func(out func(key string)) {
for _, model := range models {
name := strings.TrimSpace(model.Name)
alias := strings.TrimSpace(model.Alias)
if name == "" && alias == "" {
continue
}
out(strings.ToLower(name) + "|" + strings.ToLower(alias))
}
})
return hashJoined(keys)
}
// ComputeExcludedModelsHash returns a normalized hash for excluded model lists.
func ComputeExcludedModelsHash(excluded []string) string {
if len(excluded) == 0 {