Repository navigation
feat(settings): Pick the Completer endpoint from a list, or type one - #520
Merged
Merged
Conversation
Ports read off each project's current docs, not recalled. The pick fills the Base URL field rather than the file, so the endpoint rows still apply together (#279), and it freezes with the field when the env owns it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Populating it drew a live-looking dropdown that writes nothing, which is the failure #465 set out to remove. Also pick the macOS selector by row id rather than by whether options happen to be empty.
Four shots of Settings → Director on macOS: the picker at rest, the popup open over its eight rows, the frozen case under AI_BUDDY_DIRECTOR_BASE_URL, and the blank first draw the picker inherits from #279's staged guard. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The order carries the grouping, and localhost in the URL says the rest. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merges main and resolves the form.rs test conflict, keeping both sides. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Why
Settings → Director asked for the endpoint as free text. Every user types a URL,
and almost every user is typing one of a dozen well-known strings.
That is the wrong shape twice over. It asks people to remember
http://localhost:11434to reach something already running on their ownmachine, and it turns a typo into a silent failure — a wrong host does not
announce itself, it leaves the buddy on
StaticDirectorwith a line in stderrnobody is reading.
What changed
A Base URL picker — a
FormRow::Compositeholding oneCompositeControl::Popup— sits above the existing Base URL field. The field isuntouched: same id, same label, same
batched, samefrozenrule.The pick writes into the field, not the file. That is why it is a composite
control rather than a
FormRow::Popup: a popup that saved on its own wouldcommit the endpoint while the Model field held an unapplied edit, which is what
#279 forbids. Apply is still the only thing that reaches disk.
Each row stores the host alone, because
model::completions_url(
src-tauri/src/model.rs:528) appends/v1and the path. Every upstream docspells the
/v1this column drops.http://localhost:11434http://localhost:1234http://localhost:8000http://localhost:8080https://api.openai.comhttps://api.anthropic.comhttps://api.x.aiEvery port was read off that project's current documentation rather than
recalled, then independently re-checked by a second reviewer against the same
sources.
Grouping rides in the title, not in header rows: GTK draws these choices as
a radio group, where an inert "header" radio is a click that silently does
nothing.
vLLM and
mlx_lm.serverare deliberately absent. They default to 8000 and8080, already taken by oMLX and llama.cpp, so each would be a second name for a
URL already on the list. The field takes both.
Windows draws the box but leaves it empty, as it did before this PR. That
port commits no popup pick at all until #461, and populating the choices would
have given Windows a live-looking picker that writes nothing — the failure this
issue set out to remove, not to add.
Not done: probing
GET /v1/modelsto validate the endpoint, and populatingthe Model field. Both are named as follow-ons in the issue.
How to verify
Four new tests in
src-tauri/src/settings/form.rs: the local runtimes and theirports are one pick away; every title round-trips through
endpoint_url/endpoint_titlewith Custom the only one that writes nothing; the frozen case;the unfrozen case.
By hand, on macOS: open Settings → Director, pick
Ollama, confirm theBase URL field fills and Apply lights up, and that nothing is written until you
press it. Then export
AI_BUDDY_DIRECTOR_BASE_URLand confirm the picker isdisabled and the help line says why.
Screenshots
macOS, Settings → Director, from a worktree build at 2x.
The picker sits directly above the Base URL field and rests on the title for the
endpoint in force — here
oMLX (http://localhost:8000), which is whatthe file holds.
Custom first, then the four local rows and the three hosted rows,
each carrying the URL it writes. The check marks the endpoint the field holds.
Nothing is clipped: the popup's 360pt width fits the longest title.
With
AI_BUDDY_DIRECTOR_BASE_URL=http://localhost:11434exported: the picker isgreyed, still resting on the title the variable names, and its help line reads
"Off, for the same reason the Base URL below is." The field below carries
(overridden by env: AI_BUDDY_DIRECTOR_BASE_URL).The first draw is blank, and the picker is where it shows
Open Settings, switch to Director, and the picker draws with no items at
all — an empty box that will not open — while Base URL and Model show their
placeholders instead of the saved values. The resting shot above was taken after
one press of Cancel, which is the redraw that fills them.
This is not new here.
buildends inrefresh(), which isdraw(false), sodirector_stagedreads the still-empty fields as a staged edit and #279'sif !staged.base_urlguard skips filling them; both the guard and thatrefresh()are onmain. The picker is only where the symptom stops beingdeniable — a text field showing a placeholder still looks plausible, an empty
popup does not. Read off
set_director_buttonsrather than tested: the samefirst draw leaves Apply armed over a patch that would write
""to both rows.The frozen case above escapes it, because a frozen row contributes no draft and
so is never staged — which is why that shot is correct on the first open.
Worth its own issue against the first draw, not a change to this PR.
The blank first draw in that last shot is not this PR — it is #530, which
predates the branch:
build's closingrefresh()runs while the fields arestill empty, so #279's staged guard skips filling them. #520 inherits it and
makes it louder, because an empty popup reads as broken where a placeholder
reads as unfilled. #530 also carries a config-wipe path this uncovered.
Notes
The frozen shot above still shows the previous
Local — …titles. It could notbe recaptured: exporting
AI_BUDDY_DIRECTOR_BASE_URLputs the endpoint in forcefor the Director —
director: http://localhost:11434 unreachablein the log —but the Director tab now opens with the file's value in an editable field, so
the row never appears frozen. That looks like the reset-on-open #530 describes,
and it is not this branch's doing. The other three are current.
The GTK half has never been compiled.
src-tauri/src/platform.rs:200-208cfg-gates x11 out on macOS, so the 67 lines in
x11/settings_window.rsareunbuilt and untested anywhere — CI is the first thing that will compile them.
The change is modelled line-for-line on the existing
FormRow::Popuparm. Thesame caveat applies to the 24 lines in
windows/settings_window.rs. I make nobuild claim for either.
A follow-up worth doing but not done here:
x11/settings_window.rsnowreproduces ~14 lines of the existing
FormRow::Popupradio scaffold. Extractingone
radio_grouphelper would remove it, but refactoring code that cannot becompiled on this machine seemed the wrong trade inside this PR.
docs/DEVELOPMENT.mdstill lists local-server ports independently of this list.Left alone deliberately: different rows, different audience, and no generated
lane covers that file.
— Claude Code, on @omesser's behalf.
Closes #465