summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/config
diff options
context:
space:
mode:
Diffstat (limited to 'packages/tui/internal/config')
-rw-r--r--packages/tui/internal/config/config.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/tui/internal/config/config.go b/packages/tui/internal/config/config.go
index 7004b85b1..d20376dd8 100644
--- a/packages/tui/internal/config/config.go
+++ b/packages/tui/internal/config/config.go
@@ -69,6 +69,15 @@ func (s *State) UpdateModelUsage(providerID, modelID string) {
}
}
+func (s *State) RemoveModelFromRecentlyUsed(providerID, modelID string) {
+ for i, usage := range s.RecentlyUsedModels {
+ if usage.ProviderID == providerID && usage.ModelID == modelID {
+ s.RecentlyUsedModels = append(s.RecentlyUsedModels[:i], s.RecentlyUsedModels[i+1:]...)
+ return
+ }
+ }
+}
+
// SaveState writes the provided Config struct to the specified TOML file.
// It will create the file if it doesn't exist, or overwrite it if it does.
func SaveState(filePath string, state *State) error {