Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

fix(models): local models list again; other machines' models are shared, under machine and grid

bitcoinbuilder71506f99d73d
diff --git a/cli/src/core/experimentQueries.spec.ts b/cli/src/core/experimentQueries.spec.ts
index 2375f9812..32ee53a2d 100644
--- a/cli/src/core/experimentQueries.spec.ts
+++ b/cli/src/core/experimentQueries.spec.ts
@@ -110,7 +110,9 @@ describe('what an experiment in its own process may ask of the core', () => {
expect(await answerExperimentQuery(core, withShare, 'sharing', 'account', {})).toEqual({ accountId: 'u-bob', email: '[email protected]' })
identity.mockResolvedValueOnce(null)
expect(await answerExperimentQuery(core, withShare, 'sharing', 'account', {})).toEqual({ error: 'ACCOUNT_UNAVAILABLE' })
- expect(await answerExperimentQuery(core, withShare, 'orchestrator', 'account', {})).toEqual({ error: 'NOT_SHARING' })
+ // Any other service's `account` is its own link's to answer: models asks it for the grid name.
+ expect(await answerExperimentQuery(core, withShare, 'orchestrator', 'account', {})).toBeNull()
+ expect(await answerExperimentQuery(core, withShare, 'models', 'account', {})).toBeNull()
expect(identity).toHaveBeenCalledTimes(2)
})
diff --git a/cli/src/core/experimentQueries.ts b/cli/src/core/experimentQueries.ts
index 8d1c3c817..cce8b0045 100644
--- a/cli/src/core/experimentQueries.ts
+++ b/cli/src/core/experimentQueries.ts
@@ -54,6 +54,10 @@ export function daemonAddress(core: Pick<CoreApi, 'daemon'>): Payload {
/** The answer to an experiment's query, or null when it is not one of these. */
export async function answerExperimentQuery(core: Core, experiments: ReadonlySet<string>, service: string, query: string, payload: Payload): Promise<Payload | null> {
if (!QUERIES.has(query)) return null
+ // `account` is also what models asks for the account's grid name, of its own link (core/modelsLink.ts): only
+ // Share's is answered here. Seen 2026-10-18: since #1376 models got NOT_AN_EXPERIMENT back instead, so the
+ // backend's grid name never reached it, and the picker said "Sign in to find models" to a signed-in person.
+ if (query === 'account' && service !== 'sharing') return null
if (!experiments.has(service)) return { error: 'NOT_AN_EXPERIMENT' }
switch (query) {
case 'shown':
@@ -102,7 +106,6 @@ export async function answerExperimentQuery(core: Core, experiments: ReadonlySet
return {}
}
case 'account': {
- if (service !== 'sharing') return { error: 'NOT_SHARING' }
const known = await core.account.identity()
return known ? { ...known } : { error: 'ACCOUNT_UNAVAILABLE' }
}
diff --git a/desktop/lib/models/model_search_catalog.dart b/desktop/lib/models/model_search_catalog.dart
index 2da4ac354..24b2c002a 100644
--- a/desktop/lib/models/model_search_catalog.dart
+++ b/desktop/lib/models/model_search_catalog.dart
@@ -13,6 +13,12 @@ import 'model_manager_controller.dart';
/// Between a shared model's name and the machine serving it, in its row's title.
const modelMachineSeparator = ' · ';
+/// What a shared model's second line says: the machine serving it, and the grid it serves on.
+String servedOn(String machine, String? grid) => [
+ if (machine.isNotEmpty) machine,
+ if (grid != null && grid.isNotEmpty) grid,
+].join(modelMachineSeparator);
+
enum ModelSearchSection {
subscriptions('Subscriptions'),
apis('APIs'),
@@ -43,6 +49,7 @@ class ModelSearchEntry {
this.searchAliases = const [],
this.controller,
this.own = false,
+ this.elsewhere = false,
this.gridModel,
this.sharedBy,
});
@@ -58,6 +65,10 @@ class ModelSearchEntry {
final List<String> searchAliases;
final ModelManagerController? controller;
final bool own;
+
+ /// Served by another machine — one of yours, or one shared with you. Its row is listed under
+ /// Shared with you even when it is [own], and keeps the controls an own model has.
+ final bool elsewhere;
final GridModel? gridModel;
final String? sharedBy;
@@ -67,7 +78,7 @@ class ModelSearchEntry {
? ModelSearchSection.apis
: isDownload
? ModelSearchSection.catalog
- : own
+ : own && !elsewhere
? ModelSearchSection.local
: ModelSearchSection.shared;
@@ -297,20 +308,24 @@ class ModelSearchCatalog extends ChangeNotifier {
continue;
}
final words = sectionWords(section);
+ // Your models are this computer's. A model another machine serves — on your own grid too —
+ // is shared with you, named with that machine and its grid (owner, 2026-10-18: Muse-Glimmer,
+ // served by another machine on the account's grid, read as if it were on this one).
+ final here = section.own && identical(owner, manager);
+ final machine = owner?.machine?.machine.displayName ?? model.node;
discovered.add(
ModelSearchEntry(
id: id,
// Shown without its quant, as hn shows it; found, and switched onto, by its id.
name: withoutQuant(model.id),
- source: section.own
- ? 'On your machines'
- : 'Shared · ${section.name}',
- node: owner?.machine?.machine.displayName ?? model.node,
- searchAliases: [model.id, model.node, if (section.own) 'local'],
+ source: here ? 'On this computer' : 'Shared · ${gridModel.grid}',
+ node: machine,
+ searchAliases: [model.id, model.node, if (here) 'local'],
own: section.own,
+ elsewhere: !here,
controller: owner,
gridModel: gridModel,
- sharedBy: section.own ? null : model.node,
+ sharedBy: here ? null : servedOn(machine, gridModel.grid),
status:
offlineRowNote(model) ??
words.sentence ??
@@ -362,10 +377,13 @@ class ModelSearchCatalog extends ChangeNotifier {
named[key] = (named[key] ?? 0) + 1;
}
bool twin(ModelManagerController owner, LocalModel model) =>
- (named['${identityHashCode(owner)}:${model.shownName.toLowerCase()}'] ?? 0) >
+ (named['${identityHashCode(owner)}:${model.shownName.toLowerCase()}'] ??
+ 0) >
1;
final all = [
for (final (:owner, :model) in local)
+ // Another machine's — one of yours, or one shared with you — is listed as shared, under
+ // its machine and the grid it serves on, as a model found on a grid is.
ModelSearchEntry(
id: _managedRowIds.putIfAbsent(
_managedKey(owner, model),
@@ -381,8 +399,15 @@ class ModelSearchCatalog extends ChangeNotifier {
status: localStatus(model, controller: owner),
local: model,
own: true,
+ elsewhere: !identical(owner, manager),
controller: owner,
gridModel: served[_managedKey(owner, model)],
+ sharedBy: identical(owner, manager)
+ ? null
+ : servedOn(
+ owner.machine?.machine.displayName ?? '',
+ served[_managedKey(owner, model)]?.grid,
+ ),
searchAliases: [
?owner.machine?.machine.hostname,
?model.quantization,
diff --git a/desktop/test/model_search_catalog_test.dart b/desktop/test/model_search_catalog_test.dart
index 9c27b23aa..336bd688e 100644
--- a/desktop/test/model_search_catalog_test.dart
+++ b/desktop/test/model_search_catalog_test.dart
@@ -226,7 +226,7 @@ void main() {
'DDD catalog',
'EEE catalog',
'[ More models (2) ]',
- 'Shared Qwen · team.lan',
+ 'Shared Qwen · team.lan · Team',
]);
expect(search.rows.map(search.modelSection), [
ModelSearchSection.subscriptions,
@@ -257,7 +257,7 @@ void main() {
for (final letter in ['A', 'B', 'C', 'D', 'E', 'F', 'G'])
'${letter * 3} catalog',
'[ Show fewer ]',
- 'Shared Qwen · team.lan',
+ 'Shared Qwen · team.lan · Team',
]);
expect(search.selected!.title, 'AAA catalog');
expect(search.modelRowAction(search.selected!), isNull);
@@ -332,13 +332,13 @@ void main() {
search.rows.singleWhere(test);
final subscription = row((r) => r.title == 'OpenAI');
final api = row((r) => r.title == 'Custom API');
- final shared = row((r) => r.title == 'Shared Qwen · team.lan');
+ final shared = row((r) => r.title == 'Shared Qwen · team.lan · Team');
final more = row(search.isModelDownloadsRow);
// One line a row: every other row keeps its own title, who shares a model included.
expect(search.modelRowTitle(subscription), 'OpenAI');
expect(search.modelRowTitle(api), 'Custom API');
- expect(search.modelRowTitle(shared), 'Shared Qwen · team.lan');
+ expect(search.modelRowTitle(shared), 'Shared Qwen · team.lan · Team');
// The fold is named for what Enter does, with how many it holds.
expect(search.modelRowTitle(more), 'More models (2)');
search.move(search.rows.indexOf(more) - search.cursor);
@@ -385,130 +385,135 @@ void main() {
}
});
- test(
- 'own models precede shared models even without local inventory',
- () async {
- app.localReadFails = true;
- app.inventory = const GridModels(
- gridName: 'home',
- models: [],
- grids: [
- GridSection(
- name: 'Team',
- own: false,
- models: [GridModel(id: 'Shared model', node: 'team.lan')],
- ),
- GridSection(
- name: 'home',
- own: true,
- models: [GridModel(id: 'qwen3.8-27b', node: 'mac.lan')],
- ),
- ],
- );
- await app.modelManager.refresh();
- expect(catalog.rows.map((row) => row.title), [
- 'qwen3.8-27b',
- 'Shared model · team.lan',
- ]);
- final own = catalog.entries[catalog.rows.first.modelId]!;
- expect(own.source, 'On your machines');
- expect(own.node, 'mac.lan');
- expect(own.local, isNull);
- final search = SwarmSearchController(app, const [], models: catalog)
- ..setQuery(':local');
- addTearDown(search.dispose);
- expect(search.rows.map((row) => row.title), ['qwen3.8-27b']);
- search.setQuery(':mac.lan');
- expect(search.rows.map((row) => row.title), ['qwen3.8-27b']);
- expect(app.actions, isEmpty);
- expect(app.downloads, isEmpty);
- },
- );
-
- test(
- 'a catalog model running here is one row, matched to the name grid serves it under',
- () async {
- Map<String, Object?> running() => {
- 'models': [
- {
- 'id': 'unsloth/Qwen3.8-27B-GGUF',
- 'name': 'Qwen3.8-27B',
- 'state': 'running',
- 'canStop': true,
- 'app': 'Grid',
- 'servedAs': ['Qwen3.8-27B-UD-Q4_K_M'],
- },
- ],
- };
- app.localInventory = running();
- app.inventory = const GridModels(
- gridName: 'home',
- models: [],
- grids: [
- GridSection(
- name: 'home',
- own: true,
- models: [GridModel(id: 'Qwen3.8-27B-UD-Q4_K_M', node: 'This Mac')],
- ),
- ],
- );
- await app.modelManager.refresh();
- final served = catalog.entries.values.where(
- (entry) => entry.local?.id == 'unsloth/Qwen3.8-27B-GGUF',
- );
- expect(catalog.entries, hasLength(1));
- expect(served.single.gridModel?.id, 'Qwen3.8-27B-UD-Q4_K_M');
- },
- );
+ // The owner, 2026-10-18: a model another machine serves — on your own grid too — is shared with
+ // you, named with that machine and its grid; Your models are this computer's.
+ test('a model another machine serves on your own grid is shared, under its machine and grid', () async {
+ app.localReadFails = true;
+ app.inventory = const GridModels(
+ gridName: 'home',
+ models: [],
+ grids: [
+ GridSection(
+ name: 'Team',
+ own: false,
+ models: [GridModel(id: 'Shared model', node: 'team.lan')],
+ ),
+ GridSection(
+ name: 'home',
+ own: true,
+ models: [GridModel(id: 'qwen3.8-27b', node: 'mac.lan')],
+ ),
+ ],
+ );
+ await app.modelManager.refresh();
+ // Your own grid's first, then other teams'.
+ expect(catalog.rows.map((row) => row.title), [
+ 'qwen3.8-27b · mac.lan · home',
+ 'Shared model · team.lan · Team',
+ ]);
+ final other = catalog.entries[catalog.rows.first.modelId]!;
+ expect(other.section, ModelSearchSection.shared);
+ expect(other.source, 'Shared · home');
+ expect(other.node, 'mac.lan');
+ expect(other.local, isNull);
+ final search = SwarmSearchController(app, const [], models: catalog)
+ ..setQuery(':local');
+ addTearDown(search.dispose);
+ expect(search.rows.map((row) => row.title), isEmpty);
+ search.setQuery(':mac.lan');
+ expect(search.rows.map((row) => row.title), [
+ 'qwen3.8-27b · mac.lan · home',
+ ]);
+ expect(app.actions, isEmpty);
+ expect(app.downloads, isEmpty);
+ });
- test('a name is shown without the quant its file ends in, as hn shows it', () {
- const cases = {
- 'Qwen3.8-27B-UD-Q4_K_M': 'Qwen3.8-27B',
- 'Qwen3-4B-Instruct-2507-Q4_K_M': 'Qwen3-4B-Instruct-2507',
- 'qwen3:4b-instruct-2507-q4_k_m': 'qwen3:4b-instruct-2507',
- 'Kev-0.8B-Q8_0': 'Kev-0.8B',
- 'gpt-oss-20b-MXFP4': 'gpt-oss-20b',
- 'Mistral-7B-v0.1.IQ4_XS': 'Mistral-7B-v0.1',
- 'gemma-4-E4B-it-BF16': 'gemma-4-E4B-it',
- 'Qwen3.6-35B-A3B-UD_Q5_K_XL': 'Qwen3.6-35B-A3B',
- 'Qwen3.6-35B-A3B': 'Qwen3.6-35B-A3B',
- 'llama3.2:3b': 'llama3.2:3b',
- 'Qwen-Q3-Coder': 'Qwen-Q3-Coder',
- 'Q4_K_M': 'Q4_K_M',
- '-Q4': '-Q4',
- 'Qwen/Qwen3.8-27B': 'Qwen/Qwen3.8-27B',
+ test('a catalog model running here is one row, matched to the name grid serves it under', () async {
+ Map<String, Object?> running() => {
+ 'models': [
+ {
+ 'id': 'unsloth/Qwen3.8-27B-GGUF',
+ 'name': 'Qwen3.8-27B',
+ 'state': 'running',
+ 'canStop': true,
+ 'app': 'Grid',
+ 'servedAs': ['Qwen3.8-27B-UD-Q4_K_M'],
+ },
+ ],
};
- for (final MapEntry(:key, :value) in cases.entries) {
- expect(withoutQuant(key), value, reason: key);
- }
+ app.localInventory = running();
+ app.inventory = const GridModels(
+ gridName: 'home',
+ models: [],
+ grids: [
+ GridSection(
+ name: 'home',
+ own: true,
+ models: [GridModel(id: 'Qwen3.8-27B-UD-Q4_K_M', node: 'This Mac')],
+ ),
+ ],
+ );
+ await app.modelManager.refresh();
+ final served = catalog.entries.values.where(
+ (entry) => entry.local?.id == 'unsloth/Qwen3.8-27B-GGUF',
+ );
+ expect(catalog.entries, hasLength(1));
+ expect(served.single.gridModel?.id, 'Qwen3.8-27B-UD-Q4_K_M');
});
test(
- 'a model shared from another machine reads as it does there, without its quant',
- () async {
- app.localInventory = {'models': <Object>[]};
- app.inventory = const GridModels(
- gridName: 'home',
- models: [],
- grids: [
- GridSection(
- name: 'scholes-f8d388e6',
- own: false,
- models: [GridModel(id: 'Qwen3.8-27B-UD-Q4_K_M', node: 'harness')],
- ),
- ],
- );
- await app.modelManager.refresh();
- expect(catalog.rows.single.title, 'Qwen3.8-27B · harness');
- final entry = catalog.entries.values.single;
- expect(entry.gridModel?.id, 'Qwen3.8-27B-UD-Q4_K_M');
- final search = SwarmSearchController(app, const [], models: catalog)
- ..setQuery(':Q4_K_M');
- addTearDown(search.dispose);
- expect(search.rows.map((row) => row.title), ['Qwen3.8-27B · harness']);
+ 'a name is shown without the quant its file ends in, as hn shows it',
+ () {
+ const cases = {
+ 'Qwen3.8-27B-UD-Q4_K_M': 'Qwen3.8-27B',
+ 'Qwen3-4B-Instruct-2507-Q4_K_M': 'Qwen3-4B-Instruct-2507',
+ 'qwen3:4b-instruct-2507-q4_k_m': 'qwen3:4b-instruct-2507',
+ 'Kev-0.8B-Q8_0': 'Kev-0.8B',
+ 'gpt-oss-20b-MXFP4': 'gpt-oss-20b',
+ 'Mistral-7B-v0.1.IQ4_XS': 'Mistral-7B-v0.1',
+ 'gemma-4-E4B-it-BF16': 'gemma-4-E4B-it',
+ 'Qwen3.6-35B-A3B-UD_Q5_K_XL': 'Qwen3.6-35B-A3B',
+ 'Qwen3.6-35B-A3B': 'Qwen3.6-35B-A3B',
+ 'llama3.2:3b': 'llama3.2:3b',
+ 'Qwen-Q3-Coder': 'Qwen-Q3-Coder',
+ 'Q4_K_M': 'Q4_K_M',
+ '-Q4': '-Q4',
+ 'Qwen/Qwen3.8-27B': 'Qwen/Qwen3.8-27B',
+ };
+ for (final MapEntry(:key, :value) in cases.entries) {
+ expect(withoutQuant(key), value, reason: key);
+ }
},
);
+ test('a model shared from another machine reads as it does there, without its quant', () async {
+ app.localInventory = {'models': <Object>[]};
+ app.inventory = const GridModels(
+ gridName: 'home',
+ models: [],
+ grids: [
+ GridSection(
+ name: 'scholes-f8d388e6',
+ own: false,
+ models: [GridModel(id: 'Qwen3.8-27B-UD-Q4_K_M', node: 'harness')],
+ ),
+ ],
+ );
+ await app.modelManager.refresh();
+ expect(
+ catalog.rows.single.title,
+ 'Qwen3.8-27B · harness · scholes-f8d388e6',
+ );
+ final entry = catalog.entries.values.single;
+ expect(entry.gridModel?.id, 'Qwen3.8-27B-UD-Q4_K_M');
+ final search = SwarmSearchController(app, const [], models: catalog)
+ ..setQuery(':Q4_K_M');
+ addTearDown(search.dispose);
+ expect(search.rows.map((row) => row.title), [
+ 'Qwen3.8-27B · harness · scholes-f8d388e6',
+ ]);
+ });
+
test('legacy own-grid replies remain visible in models', () async {
app.localInventory = {'models': <Object>[]};
app.inventory = const GridModels(
@@ -516,8 +521,8 @@ void main() {
models: [GridModel(id: 'Qwen', node: 'mac.lan')],
);
await app.modelManager.refresh();
- expect(catalog.rows.single.title, 'Qwen');
- expect(catalog.entries.values.single.source, 'On your machines');
+ expect(catalog.rows.single.title, 'Qwen · mac.lan · home');
+ expect(catalog.entries.values.single.source, 'Shared · home');
});
test('Use identifies only the subscription available on the pane host', () {
@@ -581,11 +586,18 @@ void main() {
catalog.entries.values.where((entry) => entry.local != null),
hasLength(1),
);
+ // This computer's is yours; mac.lan's is shared with you.
expect(
catalog.entries.values.where(
- (entry) => entry.source == 'On your machines',
+ (entry) => entry.source == 'On this computer',
),
- hasLength(2),
+ hasLength(1),
+ );
+ expect(
+ catalog.entries.values.where(
+ (entry) => entry.source == 'Shared · home',
+ ),
+ hasLength(1),
);
},
);
@@ -718,8 +730,12 @@ void main() {
..setQuery(':')
..setModelSelection('codex', app.inventory, machineId: 'm');
try {
- final resting = search.rows.firstWhere((row) => row.title == 'Resting');
- final offline = search.rows.firstWhere((row) => row.title == 'Offline');
+ final resting = search.rows.firstWhere(
+ (row) => row.title == 'Resting · mac.lan · home',
+ );
+ final offline = search.rows.firstWhere(
+ (row) => row.title == 'Offline · rig.lan · home',
+ );
expect(search.modelRowAction(resting), 'Use');
expect(search.modelRowAction(offline), isNull);
expect(search.canSelectModel(offline), isFalse);
diff --git a/desktop/test/resource_picker_test.dart b/desktop/test/resource_picker_test.dart
index 0044e9c4e..afe555a6c 100644
--- a/desktop/test/resource_picker_test.dart
+++ b/desktop/test/resource_picker_test.dart
@@ -853,8 +853,9 @@ void main() {
expect(app.downloads, isEmpty);
await key(tester, LogicalKeyboardKey.escape);
await key(tester, LogicalKeyboardKey.keyI, cmd: true);
+ // Served by another machine on your grid: listed under its machine and grid.
final usable = search(tester).rows
- .firstWhere((row) => row.title == 'qwen3.8-27b');
+ .firstWhere((row) => row.title.startsWith('qwen3.8-27b · '));
search(tester)
.move(search(tester).rows.indexOf(usable) - search(tester).cursor);
await tester.pump();
@@ -959,7 +960,7 @@ void main() {
);
app.notifyListeners();
await key(tester, LogicalKeyboardKey.keyI, cmd: true);
- expect(search(tester).selected!.title, 'qwen3.8-27b');
+ expect(search(tester).selected!.title, 'qwen3.8-27b · M2 · home');
await tester.enterText(field, ':Anthropic');
await tester.pumpAndSettle();
expect(search(tester).canSelectModel(search(tester).selected), isFalse);
@@ -1046,9 +1047,10 @@ void main() {
(row) => '${machine.key}'.contains('model-row-machine:${row.id}'),
);
final name = sharedRow.title.substring(0, sharedRow.title.indexOf(' · '));
+ // The machine, and the grid it serves on.
expect(
machine.text.substring(machine.from),
- sharedRow.title.split(' · ').last,
+ sharedRow.title.substring(name.length + ' · '.length),
);
final nameLine = tester.widget<SearchResultText>(
find.byWidgetPredicate(
@@ -1108,13 +1110,14 @@ void main() {
);
expect(app.focusedPaneId, pane);
expect(
- search(tester).rows.any((row) => row.title == 'qwen3.8-27b'),
+ search(tester).rows
+ .any((row) => row.title.startsWith('qwen3.8-27b · ')),
isTrue,
);
await tester.enterText(field, ':mac.lan');
await tester.pump();
- expect(search(tester).selected!.title, 'qwen3.8-27b');
- expect(find.text('On your machines'), findsOneWidget);
+ expect(search(tester).selected!.title, 'qwen3.8-27b · mac.lan · home');
+ expect(find.text('Shared · home'), findsOneWidget);
expect(find.text('mac.lan'), findsOneWidget);
if (mac) await capture(tester, 'own-machine-model');
await key(tester, LogicalKeyboardKey.escape);
diff --git a/desktop/test/resource_preview_actions_test.dart b/desktop/test/resource_preview_actions_test.dart
index fcdfb5ff5..c9f558d8e 100644
--- a/desktop/test/resource_preview_actions_test.dart
+++ b/desktop/test/resource_preview_actions_test.dart
@@ -231,43 +231,45 @@ void main() {
expect(app.actions, isEmpty);
});
- testWidgets('own-machine models remain visible when local discovery fails', (
- tester,
- ) async {
- await mount(tester, ':mac.lan');
- expect(find.text('qwen3.8-27b'), findsOneWidget);
- expect(find.text('On your machines'), findsOneWidget);
- expect(find.text('mac.lan'), findsOneWidget);
- expect(
- find.byKey(const ValueKey('resource-action:picker.accept')),
- findsOneWidget,
- );
- expect(
- find.byKey(const ValueKey('resource-action:picker.model_stop')),
- findsNothing,
- );
- final selected = search.selected!.id;
- app.localReadFails = true;
- await invoke(tester, 'picker.refresh');
- expect(search.selected!.id, selected);
- expect(
- find.textContaining('Local models · Models are unavailable'),
- findsOneWidget,
- );
- search.setQuery(':Shared Qwen');
- await tester.pumpAndSettle();
- expect(
- find.textContaining('Local models · Models are unavailable'),
- findsOneWidget,
- );
- app.localReadFails = false;
- await invoke(tester, 'picker.refresh');
- expect(
- find.byKey(const ValueKey('local-model-inventory-notice')),
- findsNothing,
- );
- expect(app.actions, isEmpty);
- });
+ // A model another machine serves on your grid is shared with you, under that machine and grid.
+ testWidgets(
+ 'another machine\'s models remain visible when local discovery fails',
+ (tester) async {
+ await mount(tester, ':mac.lan');
+ expect(find.text('qwen3.8-27b'), findsOneWidget);
+ expect(find.text('Shared · home'), findsOneWidget);
+ expect(find.text('mac.lan'), findsOneWidget);
+ expect(
+ find.byKey(const ValueKey('resource-action:picker.accept')),
+ findsOneWidget,
+ );
+ expect(
+ find.byKey(const ValueKey('resource-action:picker.model_stop')),
+ findsNothing,
+ );
+ final selected = search.selected!.id;
+ app.localReadFails = true;
+ await invoke(tester, 'picker.refresh');
+ expect(search.selected!.id, selected);
+ expect(
+ find.textContaining('Local models · Models are unavailable'),
+ findsOneWidget,
+ );
+ search.setQuery(':Shared Qwen');
+ await tester.pumpAndSettle();
+ expect(
+ find.textContaining('Local models · Models are unavailable'),
+ findsOneWidget,
+ );
+ app.localReadFails = false;
+ await invoke(tester, 'picker.refresh');
+ expect(
+ find.byKey(const ValueKey('local-model-inventory-notice')),
+ findsNothing,
+ );
+ expect(app.actions, isEmpty);
+ },
+ );
testWidgets('running model details and refresh report real inventory', (
tester,
@@ -321,8 +323,9 @@ void main() {
catalog.setVisible(true);
await tester.pumpAndSettle();
expect(search.selected!.id, id);
+ // Another machine of yours: shared with you, under that machine and the grid it serves on.
expect(
- search.rows.where((row) => row.title == 'qwen3.8-27b'),
+ search.rows.where((row) => row.title == 'qwen3.8-27b · M2 · home'),
hasLength(1),
);
expect(find.text('M2'), findsOneWidget);
diff --git a/tui/src/models.rs b/tui/src/models.rs
index 006269764..742510667 100644
--- a/tui/src/models.rs
+++ b/tui/src/models.rs
@@ -961,18 +961,21 @@ pub fn rows(app: &App, query: &str) -> Vec<Row> {
}
// Your models: this computer's — being started, running, downloaded, in the daemon's order
- // within each — then the own grid's models the account's other machines serve.
+ // within each. The own grid's models another machine serves are shared with you, below, as on
+ // the desktop (owner, 2026-10-18: Muse-Glimmer, served by another machine, read as this one's).
if let Some(t) = t.filter(|t| v.grids.contains_key(&machine) && !can_run(app, &t.engine)) {
out.push(note("engine", &format!("{} can only run on its own login.", engine_label(&t.engine)), YOUR_MODELS));
}
let own = |g: &Grids| -> Vec<(Section, GridModel)> {
g.sections.iter().filter(|s| s.own).flat_map(|s| s.models.iter().map(move |x| (s.clone(), x.clone()))).collect()
};
+ // The own grid's models another machine serves: the first of Shared with you.
+ let mut theirs: Vec<(Section, GridModel)> = Vec::new();
match snap {
None => {
out.push(note("local", if !up(app, &machine) { "Connect this computer to see its models." } else { v.local_error.get(&machine).map(String::as_str).unwrap_or("Finding models that fit…") }, YOUR_MODELS));
// (Without this computer's list yet, the own grid's models as they come.)
- if let Some(g) = v.grids.get(&machine) { for (s, x) in own(g) { out.push(grid_row(app, &s, &x, t, YOUR_MODELS)) } }
+ if let Some(g) = v.grids.get(&machine) { theirs = own(g) }
}
Some(s) => {
if let Some(n) = &s.notice { out.push(note("notice", n, YOUR_MODELS)) }
@@ -982,14 +985,12 @@ pub fn rows(app: &App, query: &str) -> Vec<Row> {
mine.sort_by_key(|(r, i, _)| (*r, *i));
// (This computer's running ones are listed by their local names, above.)
let here: Vec<&LocalModel> = s.models.iter().filter(|m| m.running()).collect();
- let theirs: Vec<Row> = v.grids.get(&machine).map(own).unwrap_or_default().into_iter()
- .filter(|(_, x)| !here.iter().any(|m| m.answers_to(&x.id)))
- .map(|(s, x)| grid_row(app, &s, &x, t, YOUR_MODELS)).collect();
+ theirs = v.grids.get(&machine).map(own).unwrap_or_default().into_iter()
+ .filter(|(_, x)| !here.iter().any(|m| m.answers_to(&x.id))).collect();
// (Only with something below to get: Enter goes to it.)
let to_get = s.models.iter().any(|m| !m.downloaded() && !m.can_stop);
- if mine.is_empty() && theirs.is_empty() && !searching && to_get { out.push(note("none", "No models here yet — get one below", YOUR_MODELS)) }
+ if mine.is_empty() && !searching && to_get { out.push(note("none", "No models here yet — get one below", YOUR_MODELS)) }
out.extend(mine.into_iter().map(|(_, _, r)| r));
- out.extend(theirs);
}
}
@@ -1009,6 +1010,11 @@ pub fn rows(app: &App, query: &str) -> Vec<Row> {
// Shared with you: every grid shared with this account, one section as on the desktop — each
// row naming the machine and the grid it is on, and a resting grid saying so.
+ // Your own grid's first: what your other machines serve, each under its machine and grid.
+ for (s, x) in &theirs {
+ let detail = [x.node.as_str(), s.name.as_str()].into_iter().filter(|w| !w.is_empty()).collect::<Vec<_>>().join(" · ");
+ out.push(grid_row(app, s, x, t, SHARED).detail(vec![span(detail, fg(theme::MUTED))]));
+ }
if let Some(g) = v.grids.get(&machine) {
for s in g.sections.iter().filter(|s| !s.own) {
let words = section_words(s, v.asking.contains(&s.name));
@@ -2677,17 +2683,23 @@ mod tests {
app.fleet.agents.insert(key, a);
}
- /// Your models, as the desktop's: this computer's — running, then downloaded — then the own
- /// grid's models the account's other machines serve, in the grid's order.
+ /// Your models, as the desktop's: this computer's — running, then downloaded. What the account's
+ /// other machines serve on its own grid is shared with you, first there, under its machine and
+ /// grid (owner, 2026-10-18: Muse-Glimmer, served by another machine, read as this one's).
#[test]
- fn your_models_are_this_computer_s_then_the_own_grid_s() {
+ fn your_models_are_this_computer_s_and_the_own_grid_s_other_machines_are_shared() {
let mut app = app();
on_local(&mut app, "local", Ok(local_reply(qwen("running", Value::Null), false)));
let mut g = grids_reply(&["box-model"]);
g["grids"][0]["models"].as_array_mut().unwrap().push(json!({ "id": "away-model", "node": "lap", "unavailable": { "reason": "offline", "machine": "lap" } }));
on_grids(&mut app, "local", Ok(g));
- let mine: Vec<String> = super::rows(&app, "").into_iter().filter(|r| r.group.as_deref() == Some("Your models") && is_row(&r.id)).map(|r| r.id).collect();
- assert_eq!(mine, vec!["mv:local:qwen-35b".to_string(), "mv:local:gemma-12b".into(), "mv:grid:own-grid\tstudio\tbox-model".into(), "mv:grid:own-grid\tlap\taway-model".into()]);
+ let rows = super::rows(&app, "");
+ let in_group = |group: &str| -> Vec<String> { rows.iter().filter(|r| r.group.as_deref() == Some(group) && is_row(&r.id)).map(|r| r.id.clone()).collect() };
+ assert_eq!(in_group("Your models"), vec!["mv:local:qwen-35b".to_string(), "mv:local:gemma-12b".into()]);
+ let shared = in_group("Shared with you");
+ assert_eq!(shared[..2], ["mv:grid:own-grid\tstudio\tbox-model".to_string(), "mv:grid:own-grid\tlap\taway-model".into()]);
+ let line = |id: &str| rows.iter().find(|r| r.id == id).map(|r| r.detail.iter().map(|s| s.content.to_string()).collect::<String>()).unwrap_or_default();
+ assert_eq!(line("mv:grid:own-grid\tstudio\tbox-model"), "studio · own-grid");
}
/// A harness just opened reads as its terminal until the daemon sees the engine in it (OpenCode: