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.

New Harness offers only models a harness can run, in the Models picker's look (#985)

scholes-autonomous36c87225ed3c
diff --git a/desktop/lib/core/models.dart b/desktop/lib/core/models.dart
index c7b674512..7a02f0e1f 100644
--- a/desktop/lib/core/models.dart
+++ b/desktop/lib/core/models.dart
@@ -1353,6 +1353,14 @@ class GridSection {
this.lastKnownAge,
this.wakeOutcome,
});
+
+ /// The models a harness can run on: [models] without the decision models, which answer only at
+ /// `/v1/systemone` and cannot chat. The New Harness menu listed tev1 and kev-0.8b among the chat
+ /// models, where choosing one started a harness on a model that cannot answer it.
+ List<GridModel> get harnessModels => [
+ for (final model in models)
+ if (!model.decision) model,
+ ];
}
/// `gridName` is null when the machine has no grid yet — told apart from "a grid with nothing on
diff --git a/desktop/lib/shared/theme/app_icons.dart b/desktop/lib/shared/theme/app_icons.dart
index 599b1e8c1..684fc64e5 100644
--- a/desktop/lib/shared/theme/app_icons.dart
+++ b/desktop/lib/shared/theme/app_icons.dart
@@ -30,6 +30,7 @@ abstract final class AppIcons {
static const bookOpen = LucideIcons.bookOpen400;
static const bot = LucideIcons.bot400;
static const box = LucideIcons.box400;
+ static const brain = LucideIcons.brain400;
static const brainCircuit = LucideIcons.brainCircuit400;
static const bug = LucideIcons.bug400;
static const calendarDays = LucideIcons.calendarDays400;
diff --git a/desktop/lib/state/app_state.dart b/desktop/lib/state/app_state.dart
index ae3cd36cf..38886fc6f 100644
--- a/desktop/lib/state/app_state.dart
+++ b/desktop/lib/state/app_state.dart
@@ -10775,7 +10775,9 @@ class AppNotifier extends ChangeNotifier {
!models.sections.any(
(section) =>
section.name == choices['gridName'] &&
- section.models.any((model) => model.id == choices['gridModel']),
+ section.harnessModels.any(
+ (model) => model.id == choices['gridModel'],
+ ),
)) {
return creation._complete(
'The selected model is unavailable. Refresh models or use your subscription.',
diff --git a/desktop/lib/state/new_harness.dart b/desktop/lib/state/new_harness.dart
index a45252cc2..054aea4a2 100644
--- a/desktop/lib/state/new_harness.dart
+++ b/desktop/lib/state/new_harness.dart
@@ -361,8 +361,13 @@ class NewHarnessOption {
this.synthetic = false,
this.risky = false,
this.why,
+ this.meta,
});
+ /// What the row says of itself at its end — a subscription's allowance left ("79% remaining"),
+ /// where the Models picker shows it too, rather than run on after the account in its detail.
+ final String? meta;
+
/// A row the box adds rather than finds — "New project", "Use this folder".
/// It is never a match, so it is in neither half of the `2 of 14`.
final bool synthetic;
@@ -956,7 +961,7 @@ class NewHarnessController extends ChangeNotifier {
_modelCatalog!.sections.any(
(section) =>
section.name == model.grid &&
- section.models.any((candidate) => candidate.id == model.id),
+ section.harnessModels.any((candidate) => candidate.id == model.id),
);
String? get modelNotice {
@@ -975,7 +980,7 @@ class NewHarnessController extends ChangeNotifier {
if (_model != null && !_modelAvailable(_model!)) {
return 'The selected model is unavailable. Choose another model or your subscription.';
}
- if (catalog.sections.every((section) => section.models.isEmpty)) {
+ if (catalog.sections.every((section) => section.harnessModels.isEmpty)) {
return 'No models are running on your machines. Open Manage Models to start one.';
}
return null;
@@ -1017,10 +1022,11 @@ class NewHarnessController extends ChangeNotifier {
NewHarnessOption(
id: defaultModelId,
title: subscriptionLabel,
- detail: [
- '${_profile?.label ?? 'Default account'} on $machineLabel',
- if (subscription?['status'] case final String status) status,
- ].join(' · '),
+ detail: '${_profile?.label ?? 'Default account'} on $machineLabel',
+ meta: switch (subscription?['status']) {
+ final String status => status,
+ _ => null,
+ },
group: 'Subscription',
engine: _engine,
machineId: _machineId,
@@ -1030,7 +1036,7 @@ class NewHarnessController extends ChangeNotifier {
catalog!.canRunLocally(_engine))
for (final section in catalog.sections)
..._ranked([
- for (final model in section.models)
+ for (final model in section.harnessModels)
NewHarnessOption(
id: _modelId(
GridModel(id: model.id, node: model.node, grid: section.name),
@@ -1042,9 +1048,9 @@ class NewHarnessController extends ChangeNotifier {
final offline? => offlineNodeLabel(offline.machine),
null => model.node,
},
- group: section.own
- ? 'On your machines'
- : 'Shared · ${section.name}',
+ // The Models picker's names for the same two lists. Its machine on the row's second
+ // line tells two grids' copies of a model apart, as it does there.
+ group: section.own ? 'Your models' : 'Shared with you',
model: GridModel(
id: model.id,
node: model.node,
@@ -1070,7 +1076,7 @@ class NewHarnessController extends ChangeNotifier {
(catalog?.supportsModelLaunch == true && catalog!.canRunLocally(_engine)
? catalog.sections.fold<int>(
0,
- (count, section) => count + section.models.length,
+ (count, section) => count + section.harnessModels.length,
)
: 0);
return groups;
diff --git a/desktop/lib/widgets/grid_model_picker.dart b/desktop/lib/widgets/grid_model_picker.dart
index 517464348..a30d2b89b 100644
--- a/desktop/lib/widgets/grid_model_picker.dart
+++ b/desktop/lib/widgets/grid_model_picker.dart
@@ -470,7 +470,9 @@ class _GridModelPickerState extends State<GridModelPicker> {
/// Unless it has something to SAY ([SectionWords.speaks] — only ever from a newer daemon).
List<GridSection> _sectionsToDraw(GridModels answer) {
final sections = answer.sections
- .where((s) => s.own || s.models.isNotEmpty || sectionWords(s).speaks)
+ .where(
+ (s) => s.own || s.harnessModels.isNotEmpty || sectionWords(s).speaks,
+ )
.toList();
if (sections.any((s) => s.own)) return sections;
return [
@@ -690,9 +692,9 @@ class _ModelPickerPanelState extends State<_ModelPickerPanel>
/// zeus" is the same question as "where is DeepSeek", and a search that read only ids would
/// answer one of them.
List<GridModel> _matching(GridSection section) {
- if (_needle.isEmpty) return section.models;
+ if (_needle.isEmpty) return section.harnessModels;
final needle = _needle.toLowerCase();
- return section.models
+ return section.harnessModels
.where(
(m) =>
m.id.toLowerCase().contains(needle) ||
diff --git a/desktop/lib/widgets/new_harness_form.dart b/desktop/lib/widgets/new_harness_form.dart
index 4cfd8ad25..f9ce71f95 100644
--- a/desktop/lib/widgets/new_harness_form.dart
+++ b/desktop/lib/widgets/new_harness_form.dart
@@ -406,7 +406,9 @@ class NewHarnessFormState extends State<NewHarnessForm> {
'title': _picking ? _label(_row) : 'New Harness',
'label': _picking ? option?.title ?? 'No matches' : _label(_row),
'detail': _picking
- ? option?.detail ?? ''
+ ? option == null
+ ? ''
+ : _detailWithMeta(option)
: _row == _Row.start
? '${box.launchAgentLabel}\n${box.launchProjectLabel}'
: _value(_row),
@@ -1938,7 +1940,7 @@ class NewHarnessFormState extends State<NewHarnessForm> {
_desktopField(
order: 5,
anchor: _desktopAnchors[_Row.model]!,
- child: _desktopChoiceButton(_Row.model, AppIcons.sparkles),
+ child: _desktopChoiceButton(_Row.model, AppIcons.brain),
),
if (box.hasModes)
_desktopField(
@@ -2336,24 +2338,42 @@ class NewHarnessFormState extends State<NewHarnessForm> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (_headingBefore(i))
- SizedBox(
- height: _desktopGroupHeight,
- child: Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: 8,
- ),
- child: Align(
- alignment: Alignment.centerLeft,
- child: Text(
- box.options[i].group!,
- style: DesktopChrome.text(
- size: 11,
- color: DesktopChrome.muted,
- ),
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- ),
- ),
+ Container(
+ height:
+ _desktopGroupHeight(i) -
+ _desktopHeadingGap(i),
+ // Each list after the first starts under a line, so where
+ // Subscription ends and Shared with you begins is seen, not read.
+ margin: EdgeInsets.only(
+ top: _desktopHeadingGap(i),
+ ),
+ decoration: _desktopModelRows && i > 0
+ ? BoxDecoration(
+ border: Border(
+ top: BorderSide(
+ color: DesktopChrome.rim,
+ ),
+ ),
+ )
+ : null,
+ // On the model rows' text edge: they carry no mark before it.
+ padding: EdgeInsets.symmetric(
+ horizontal: _desktopModelRows ? 10 : 8,
+ ),
+ alignment: Alignment.centerLeft,
+ child: Text(
+ box.options[i].group!,
+ style: _desktopModelRows
+ ? DesktopChrome.text(
+ size: 13,
+ color: DesktopChrome.foreground,
+ ).copyWith(fontWeight: FontWeight.w600)
+ : DesktopChrome.text(
+ size: 11,
+ color: DesktopChrome.muted,
+ ),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
),
),
if (_desktopRecentDivider(i))
@@ -2406,7 +2426,19 @@ class NewHarnessFormState extends State<NewHarnessForm> {
double _desktopLineHeight(String text, double size) =>
_desktopTextSize(text, size).height.ceilToDouble();
- double get _desktopGroupHeight => _desktopLineHeight('Ag', 11) + 12;
+ /// The model chooser reads as the Models picker does: a row with no mark on it, the name at the
+ /// picker's size with the machine under it, what the row says of itself at its end, and the
+ /// picker's headings. The same mark on every row said nothing, and the smaller type made the
+ /// same models look like a different list.
+ bool get _desktopModelRows => box.field == NewHarnessField.model;
+ double get _desktopTitleSize => _desktopModelRows ? 14 : 13;
+
+ /// A heading's slot, with the line and gap above every model list after the first. The model
+ /// lists' headings are the menu's landmarks: the picker's muted small type read as one more row.
+ double _desktopGroupHeight(int i) => _desktopModelRows
+ ? _desktopLineHeight('Ag', 13) + 16 + _desktopHeadingGap(i)
+ : _desktopLineHeight('Ag', 11) + 12;
+ double _desktopHeadingGap(int i) => _desktopModelRows && i > 0 ? 6 : 0;
double get _desktopSearchHeight =>
_desktopLineHeight('Ag', 14).clamp(32.0, double.infinity);
bool _desktopRecentDivider(int i) =>
@@ -2415,12 +2447,15 @@ class NewHarnessFormState extends State<NewHarnessForm> {
!box.options[i].synthetic &&
box.options[i - 1].synthetic;
double _desktopChoiceHeight(int i) =>
- 16 +
- _desktopLineHeight(_desktopOptionTitle(box.options[i]), 13) +
+ (_desktopModelRows ? 20 : 16) +
+ _desktopLineHeight(
+ _desktopOptionTitle(box.options[i]),
+ _desktopTitleSize,
+ ) +
(_desktopOptionDetail(box.options[i]).isEmpty
? 0
: 3 + _desktopLineHeight(_desktopOptionDetail(box.options[i]), 12)) +
- (_headingBefore(i) ? _desktopGroupHeight : 0) +
+ (_headingBefore(i) ? _desktopGroupHeight(i) : 0) +
(_desktopRecentDivider(i) ? 13 : 0);
bool _desktopOpensFolderPicker(NewHarnessOption option) =>
@@ -2489,7 +2524,7 @@ class NewHarnessFormState extends State<NewHarnessForm> {
NewHarnessField.project ||
NewHarnessField.projectName => AppIcons.folder,
NewHarnessField.projectRepository => AppIcons.code,
- NewHarnessField.model => AppIcons.sparkles,
+ NewHarnessField.model => AppIcons.brain,
NewHarnessField.profile => AppIcons.user,
NewHarnessField.mode => AppIcons.shieldCheck,
_ => AppIcons.code,
@@ -2506,10 +2541,11 @@ class NewHarnessFormState extends State<NewHarnessForm> {
? DesktopChrome.selectionDetail
: DesktopChrome.muted;
final titleStyle = DesktopChrome.text(
- size: 13,
+ size: _desktopTitleSize,
color: option.enabled ? ink : muted,
);
final detail = _desktopOptionDetail(option);
+ final meta = _desktopModelRows ? option.meta : null;
final current = box.isCurrent(option) && !_isDoor(option);
final note = box.field == NewHarnessField.machine
? _unlinked(option)
@@ -2549,10 +2585,14 @@ class NewHarnessFormState extends State<NewHarnessForm> {
onTap: !box.locked ? () => _acceptChoice(option) : null,
child: Padding(
key: highlighted ? _choiceKey : null,
- padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
+ padding: EdgeInsets.symmetric(
+ horizontal: 10,
+ vertical: _desktopModelRows ? 10 : 8,
+ ),
child: Row(
children: [
- if (box.field != NewHarnessField.machine) ...[
+ if (box.field != NewHarnessField.machine &&
+ !_desktopModelRows) ...[
if ((box.field == NewHarnessField.harness ||
box.field == NewHarnessField.agent) &&
!_isDoor(option))
@@ -2599,7 +2639,9 @@ class NewHarnessFormState extends State<NewHarnessForm> {
const SizedBox(height: 3),
Text(
detail,
- style: DesktopChrome.text(size: 12, color: muted),
+ style: _desktopModelRows
+ ? DesktopChrome.metadata(color: muted)
+ : DesktopChrome.text(size: 12, color: muted),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@@ -2607,6 +2649,19 @@ class NewHarnessFormState extends State<NewHarnessForm> {
],
),
),
+ if (meta?.isNotEmpty == true) ...[
+ const SizedBox(width: 12),
+ // Shares the row with the name rather than pushing past its end: at 390
+ // points and twice the text size, a fixed "79% remaining" overflowed by 111.
+ Flexible(
+ child: Text(
+ meta!,
+ style: DesktopChrome.metadata(color: muted),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ ),
+ ),
+ ],
if (note?.isNotEmpty == true) ...[
const SizedBox(width: 8),
ConstrainedBox(
@@ -3443,10 +3498,15 @@ class NewHarnessFormState extends State<NewHarnessForm> {
return machine.isLocalMachine ? 'This machine' : null;
}
+ /// A choice's description with what it says of itself ([NewHarnessOption.meta]) after it, for the
+ /// layouts that have no column at the row's end.
+ String _detailWithMeta(NewHarnessOption option) =>
+ [if (option.detail.isNotEmpty) option.detail, ?option.meta].join(' · ');
+
/// Whether a choice carries a description under its name.
bool _showsDetail(NewHarnessOption option) =>
(_row == _Row.model || _row == _Row.profile) &&
- option.detail.isNotEmpty &&
+ _detailWithMeta(option).isNotEmpty &&
!_isDoor(option);
/// A machine this computer has not linked yet. On screen it looks like
@@ -3533,7 +3593,7 @@ class NewHarnessFormState extends State<NewHarnessForm> {
Expanded(
child: _oneRow(
Text(
- option.detail,
+ _detailWithMeta(option),
style: _ink(_faint),
maxLines: 1,
overflow: TextOverflow.ellipsis,
diff --git a/desktop/test/new_harness_models_test.dart b/desktop/test/new_harness_models_test.dart
index 4b48c28e4..28af8170b 100644
--- a/desktop/test/new_harness_models_test.dart
+++ b/desktop/test/new_harness_models_test.dart
@@ -219,8 +219,8 @@ void main() {
await load(box);
expect(box.options.where((o) => !o.synthetic).map((o) => o.group), [
'Subscription',
- 'On your machines',
- 'Shared · team-grid',
+ 'Your models',
+ 'Shared with you',
]);
final remote = localChoice(box, 'team-grid');
box.applyOption(remote);
@@ -530,6 +530,34 @@ void main() {
);
}
});
+ test('decision models are never offered to run a harness on', () async {
+ final box = controller();
+ final decisions = [
+ {'id': 'tev1', 'node': 'Mac Studio', 'kind': 'decision'},
+ {'id': 'kev-0.8b', 'node': 'Mac Studio', 'kind': 'decision'},
+ ];
+ final mixed = catalog();
+ final own = (mixed['grids'] as List).first as Map<String, dynamic>;
+ own['models'] = [...own['models'] as List, ...decisions];
+ connections.putIfAbsent('m', _Connection.new).answer = mixed;
+ await load(box);
+ expect(
+ box.options.where((o) => o.model != null).map((o) => o.title).toList(),
+ ['Qwen-35B', 'Qwen-35B'],
+ );
+ expect(box.modelNotice, isNull);
+
+ // A grid serving only decision models runs nothing a harness can use.
+ connections['m']!.answer = {
+ ...catalog(),
+ 'grids': [
+ {'name': 'my-grid', 'own': true, 'models': decisions},
+ ],
+ };
+ await load(box);
+ expect(box.options.where((o) => o.model != null), isEmpty);
+ expect(box.modelNotice, contains('No models are running'));
+ });
test('disposed controllers ignore outstanding model reads', () async {
final box = NewHarnessController(
app,
@@ -590,11 +618,12 @@ void main() {
final box = controller(usage: menu);
await load(box);
expect(box.options.first.title, 'OpenAI');
- expect(box.options.first.detail, contains('60% remaining'));
+ expect(box.options.first.meta, '60% remaining');
+ expect(box.options.first.detail, isNot(contains('remaining')));
select(box, NewHarnessField.agent, 'claude');
await load(box);
expect(box.options.first.title, 'Anthropic');
- expect(box.options.first.detail, isNot(contains('60%')));
+ expect(box.options.first.meta, isNot(contains('60%')));
});
for (final width in [1100.0, 600.0]) {
testWidgets(
@@ -630,8 +659,8 @@ void main() {
expect(positions, orderedEquals([...positions]..sort()));
await openLaunchRow(tester, 'model');
expect(find.text('Subscription'), findsOneWidget);
- expect(find.text('On your machines'), findsOneWidget);
- expect(find.text('Shared · team-grid'), findsOneWidget);
+ expect(find.text('Your models'), findsOneWidget);
+ expect(find.text('Shared with you'), findsOneWidget);
await typeHarnessQuery(tester, 'studio');
await tester.sendKeyEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();