Repository navigation
Conversation
Deploying infinity with
|
| Latest commit: |
652bbae
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ffaf2d4d.infinity-dc7.pages.dev |
| Branch Preview URL: | https://sandbox-de5de0e5-9054-4dce-9.infinity-dc7.pages.dev |
The model picker (web dropdown and CLI `/model`) always showed the *local*
daemon's `available_models`, even when the loaded session lived on a remote
daemon whose provider/model catalog may differ. Selecting from that list
sent a `SwitchModel` with a `ModelRef` the remote might not have.
Root cause was in the daemon: when connecting to a remote it read the
remote's `Welcome` but kept only `sessions`, discarding `available_models`,
and `RemoteInfo` had no way to carry them to clients.
## Protocol
* `RemoteInfo.status` is now an enum instead of a string:
`Connecting | Connected { available_models } | Disconnected { reason }`.
Connected-without-models / disconnected-with-stale-models are
unrepresentable. The daemon's private `RemoteStatus` is replaced by this
shared type.
## Daemon (`remote.rs`)
* Store the remote's model list from its `Welcome` in the `Connected`
variant; it rides on the existing `Welcome.remotes` / `RemotesUpdated`
broadcast so clients learn the catalog exactly when the remote becomes
usable, and lose it on disconnect.
## Web (`infinity-ui`, `infinity-web`)
* `types.ts`: `RemoteStatus` union mirroring the wire shape, plus helpers
`remoteStatusKind` / `remoteStatusLabel` / `remoteModels` (exported from
`infinity-ui`).
* `SessionSidebar` / `MigratePicker` use the helpers instead of string
comparisons.
* `App.tsx`: the model dropdown renders `currentModels` — the active
session's remote catalog when `currentHost` is set, else the local list.
## CLI (`infinity-agent-cli`)
* `terminal::run` takes the initial `remotes` from `Welcome` plus a new
`remotes_updated_rx` channel (fed from `RemotesUpdated` in
`daemon_client`, mirroring `sessions_updated_rx`).
* `/model` picks the list by the loaded session's `ThreadRef.remote`. If
the remote is not `Connected` it prints why (connecting / disconnected
reason) rather than opening an empty picker.
* `ModelPickerResult::Selected` carries the chosen `ModelInfo`, and the
terminal→client channel carries a `ModelRef` instead of a `usize` index
into a list `daemon_client` had to mirror.
## Tests
* `tui_snapshots.rs`: remote session lists remote models and the switch
request carries the remote `ModelRef`; switching back to a local session
restores local models; `RemotesUpdated` (Connecting → Connected) makes the
remote's models pickable.
BREAKING CHANGE: `RemoteInfo.status` changed from a string to the
`RemoteStatus` enum; `RemoteInfo` no longer has a flat `available_models`.
Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #179
shadaj
force-pushed
the
sandbox-de5de0e5-9054-4dce-9542-932d3403b29c
branch
from
October 27, 2026 20:53
71c4156 to
652bbae
Compare
shadaj
marked this pull request as ready for review
October 27, 2026 20:53
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.
The model picker (web dropdown and CLI
/model) always showed the localdaemon's
available_models, even when the loaded session lived on a remotedaemon whose provider/model catalog may differ. Selecting from that list
sent a
SwitchModelwith aModelRefthe remote might not have.Root cause was in the daemon: when connecting to a remote it read the
remote's
Welcomebut kept onlysessions, discardingavailable_models,and
RemoteInfohad no field to carry them to clients.Protocol / daemon
RemoteInfogainsavailable_models: Vec<ModelInfo>(#[serde(default)],wire-compatible with older daemons).
remote.rs: store each remote's model list from itsWelcomeinRemoteState, clear it on disconnect, and include it in everyRemoteInfoemitted via
Welcome.remotes/RemotesUpdated.Web (
infinity-web/src/App.tsx,infinity-ui/src/types.ts)currentModels: the active session's remoteavailable_modelswhen
currentHostis set, otherwise the local list. The dropdown rendersfrom
currentModels.CLI (
infinity-agent-cli)terminal::runtakes the initialremotesfromWelcomeplus a newremotes_updated_rxchannel (fed fromDaemonMessage::RemotesUpdatedindaemon_client, mirroringsessions_updated_rx)./modelselects the list by the loaded session'sThreadRef.remote. Ifthe remote's list is empty (not connected yet) it prints a hint rather than
opening an empty picker.
ModelPickerResult::Selectednow carries the chosenModelInfo, and theterminal→client channel carries a
ModelRefinstead of ausizeindexinto a list
daemon_clienthad to mirror. This removes the coupling thatmade per-remote lists impossible.
Tests
tui_snapshots.rs: three new tests — remote session lists remote modelsand the switch request carries the remote
ModelRef; switching back to alocal session restores local models;
RemotesUpdatedrefreshes the list.tests/common/mod.rs) gainsremotesoption andremotes_updated_tx.