Improve endpoint model setup UX#778
Merged
Merged
Conversation
| return matchingModel.id | ||
| } | ||
|
|
||
| return firstModel.id |
Contributor
There was a problem hiding this comment.
When a user has a non-empty manual model that is not returned by /models, this fallback returns the first discovered model and refreshEndpointModels() persists it. Servers can return a filtered catalog while still accepting hidden model IDs, so opening the pane or pressing Refresh can silently move future completions to a different model.
Suggested change
| return firstModel.id | |
| return current.isEmpty ? firstModel.id : nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Simplify Local Endpoint setup by keeping one always-visible model control, automatically selecting a stable discovered model, and presenting the API format explicitly. Fix the underlying state bug where choosing a model or API format cleared the discovered catalog and reset the connection to Not connected.
The settings UI also removes duplicate SwiftUI field labels, keeps manual model entry available, shows compact inline connection feedback, and updates settings-search terminology.
Validation
xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination platform=macOS test -derivedDataPath build/DerivedData CODE_SIGNING_ALLOWED=NOxcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination platform=macOS build-for-testing -derivedDataPath build/DerivedData CODE_SIGNING_ALLOWED=NOswiftlint --strictLinked issues
No linked issue.
Risk / rollout notes
When discovery returns models and the saved selection is missing or stale, Cotabby now chooses the alphabetically first discovered model. A manual identifier is preserved when the endpoint returns an empty catalog. No settings migration is required.
Greptile Summary
This PR improves the OpenAI-compatible endpoint setup flow. The main changes are:
Confidence Score: 4/5
The endpoint setup flow has one persisted-model selection bug to fix before merging.
Cotabby/Models/OpenAICompatibleEndpointModels.swift
Important Files Changed
Reviews (1): Last reviewed commit: "Improve endpoint model setup UX" | Re-trigger Greptile