feat(desktop): read a custom relay's model catalog before saving - #3700
Open
rootkiller6788 wants to merge 1 commit into
Open
feat(desktop): read a custom relay's model catalog before saving#3700rootkiller6788 wants to merge 1 commit into
rootkiller6788 wants to merge 1 commit into
Conversation
…he connection Reading the catalog a relay endpoint serves needs only the endpoint and credential the user has typed — it must not require first saving a connection. Probe it through the runtime-host onboarding-verify operation against a transient connection (base URL support landed upstream for managed-Host discovery), and offer the discovered models as a chooser in the custom-relay add form instead of forcing a hand-typed model id. The probe persists nothing. Generated-by: Claude Code
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
A custom relay has no published model catalog — the only place its catalog can be read from is the endpoint the user is typing into the form, and there was no way to read it before the connection exists. The form therefore forced a hand-typed model id.
This adds a "read model catalog" action that probes the endpoint and key the user already filled in, then turns the default-model field into a chooser.
Nothing in the runtime host needed changing. The base-url plumbing for
onboarding-verifylanded upstream for managed-Host discovery, and it already runs the credential → catalog discovery this needs against a transient connection without persisting anything.This change only wires the desktop side to it:
The probe persists nothing and cannot break a reference. It targets
connectionId: nullagainst a transient connection — the same shape the post-create discovery fetch uses — so probing never creates, edits, or names a connection.Staleness
The read is against whatever endpoint and key are in the fields at click time. If either changes while the probe is in flight, the result is discarded rather than attached to the new inputs — a picked model can never belong to a catalog probed from a different endpoint.
Rejected → form copy
The host returns a closed set of rejection reasons. Most map straight onto a sentence in the form:
credential_not_configuredbase_url_not_configuredprovider_unsupportedOne —
connection_not_found— cannot describe this probe because it targets no existing connection, so it is folded into a generic failure instead of a reason the form cannot render.Verification
Eight new tests, each rule pinned by reverting it:
The following all pass:
The full workspace suite does not pass on this machine, and does not pass identically on a clean
main— the failures are Windows-environment related:EPERMsymlinkEBUSYsqliteI confirmed the biggest cluster by stashing this branch and rerunning
goal-coordinator: it fails 8/8 on cleanmainexactly as it does here.Unrelated to this change, reported rather than left unmentioned.
AI use
Tool(s) and scope: Claude Code — traced the existing
onboarding-verifypath to confirm the desktop was the only missing layer, wrote the shared contract, the IPC handler and its projection, the draft logic and the form row, and their tests. The commit carries aGenerated-bytrailer.Checklist
Does this PR entail a change in behavior?