Repository navigation
Description
Today /connect → Something else can hold exactly one custom connection, and the experience has three gaps that make custom connections hard to use.
1. No name step. The connect flow prompts for an address and a key, then auto-derives the display name from the URL hostname (modelServiceSlug). For an IP-literal host there is no usable label, and the slug can collapse to a meaningless name, so the connection and all its models show up under a garbage prefix. There is no way to type your own name.
2. Only one custom connection. The custom path is hardcoded to a single "custom" id, and persistConnectedSource upserts by id — so connecting a second custom service replaces the first. There is no way to keep several custom connections side by side.
3. No easy switching. A model row is bound to its source, and there is no first-class "active connection" to flip. Moving between OpenRouter and a custom connection means re-navigating the model picker rather than switching a connection.
Proposal
Custom connections — named and multi-instance. "Something else" becomes a reusable connection kind:
- add a name step to the connect flow (default = slugged hostname, editable, validated against existing names),
- mint a per-instance id instead of the single literal
"custom", so several custom connections coexist, - make
modelServiceSlughandle IP-literal hosts gracefully instead of producing an unusable name.
The same add/manage path exposed in /settings, driven by the same backend. The Providers tab (the models category, which already leads with the model + lane rows and the service keys) gains the ability to add and edit a custom connection inline — name, address, key — by calling the same functions /connect uses (ConnectService, the probe, the name derivation, Collides). One code path, two doors; the interactive sheet and the settings rows both feed ConnectService, never a parallel reimplementation. This means lifting a reusable "validate + persist a custom connection" out of internal/tui3/modelservices.go into internal/config / internal/connect so both surfaces call it.
A connection switcher. A first-class "active connection" concept: flip the active connection from /connect, as a row in /settings → Providers, and see connections grouped in /model. Switching between OpenRouter and a custom connection becomes one action, not a re-setup.
Smooth end-to-end for any custom connection. When a custom connection fronts a model with a different wire contract, recover cleanly (the single provider-object-off retry) instead of burning the relaxation ladder and surfacing "the request could not be sent as it was."
Naming
The public word stays connection (matches /connect and "your connected accounts"); internally these are services. We deliberately do not call them "providers" — that word already means the OpenRouter lane/routing axis, and a custom connection is a different axis (the whole account) from a provider inside OpenRouter.
Where each piece lands
/connect— interactive add/validate (name, address, key), rename, switch active./settings→ Providers tab — inline add/edit (same backend), rename row, active-connection switcher row./model— models grouped by connection.internal/provider/endpoints.go— the wire-recovery fix for custom connections.
Acceptance
- Connect a custom service and be prompted for a name; it shows up under that name.
- Connect a second custom service; both coexist, neither replaces the other.
- An IP-literal address (
http://127.0.0.1:PORT/...) produces a sensible name, not a garbage one. - Add, rename, and switch the active connection from
/settings→ Providers without opening/connect. - A custom connection fronting a non-OpenAI-dialect model completes a turn instead of failing with "the request could not be sent as it was".
Drafted with CodeAF · reviewed and owned by the author
Activity
test+docs: pin #1089 connection interfaces; prove the provider-object…
task: Implement #1089: named, multiple, switchable custom connections
connect, settings: named and multiple custom connections (#1089)
docs: the #1089 change entry and the pages it rewrites
connect, settings: named, multiple, switchable custom connections (#1092
santoshkumarradha commentedon Sep 23, 2026
Fixed on
santos/dev2by #1092 (825ef2c): custom connections are named, multiple, and switchable, with the settings path and the retry. Follow-up #1114 (a service connected mid-conversation) is merged there too.Closing as done.
drafted with CodeAF