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.

desktop: offer Circuit and Workshop as one-click tiles

deea5bccb2d5ffb
diff --git a/desktop/lib/widgets/agent_picker.dart b/desktop/lib/widgets/agent_picker.dart
index d8056dfff..2ed090c9e 100644
--- a/desktop/lib/widgets/agent_picker.dart
+++ b/desktop/lib/widgets/agent_picker.dart
@@ -19,7 +19,15 @@ class AgentPicker extends StatelessWidget {
final ValueChanged<String> onChanged;
final bool compact;
final Size? tileSize;
- static const quickAgents = ['codex', 'claude', 'cursor'];
+ /// The one-click choices: the two engines most people run, then the two
+ /// first-party domain harnesses. In the tile layout the third tile follows
+ /// the selection, so a harness is one tap away without crowding the row.
+ static const quickAgents = [
+ 'codex',
+ 'claude',
+ 'autonomous/circuit',
+ 'autonomous/workshop',
+ ];
@override
Widget build(BuildContext context) => AppChoicePicker<String>(
@@ -37,9 +45,7 @@ class AgentPicker extends StatelessWidget {
trailing: option.trailing,
),
],
- preferredValues: tileSize != null
- ? const ['codex', 'claude', 'opencode']
- : quickAgents,
+ preferredValues: quickAgents,
onChanged: onChanged,
optionKey: (id) => ValueKey('new-agent-quick-$id'),
moreKey: const Key('new-agent-engine-field'),
diff --git a/desktop/lib/widgets/new_agent_dialog.dart b/desktop/lib/widgets/new_agent_dialog.dart
index 540abc704..68a312dda 100644
--- a/desktop/lib/widgets/new_agent_dialog.dart
+++ b/desktop/lib/widgets/new_agent_dialog.dart
@@ -10,6 +10,7 @@ import '../analytics/analytics.dart';
import '../state/pane_arrangement.dart';
import '../core/engine_availability.dart';
import '../core/codex_profiles.dart';
+import '../core/dsh_catalog.dart';
import '../core/project_folder.dart';
import '../core/repository_clone.dart';
import '../shared/theme/app_theme.dart' as grid;
@@ -135,6 +136,11 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
bool _advancedOpen = false;
bool _submitting = false;
+ /// A harness install is running ahead of the create. Its progress line is
+ /// read off the machine's catalog on every rebuild; this only decides what
+ /// the button says.
+ bool _installing = false;
+
@override
void dispose() {
_folderFocus.dispose();
@@ -147,7 +153,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
void initState() {
super.initState();
final remembered = widget.notifier.agentPreference.value;
- if (allEngines.any((identity) => identity.id == remembered)) {
+ if (_knownChoice(remembered)) {
_engine = remembered!;
_engineChosenByUser = true;
} else {
@@ -171,16 +177,88 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
// actionable control once the route and its focus tree are mounted.
_folderFocus.requestFocus();
unawaited(_probeEngines(initialProbe: widget.initialEngineProbe));
+ unawaited(_probeHarnesses());
unawaited(_loadAgentPreference());
}
});
}
+ /// Whether [id] is something this dialog can offer: an engine, or a harness
+ /// this build ships a face for, or one the machine has named.
+ bool _knownChoice(String? id) =>
+ id != null &&
+ (allEngines.any((identity) => identity.id == id) ||
+ knownHarnesses.any((identity) => identity.id == id) ||
+ _harness(id) != null);
+
+ /// Which harnesses this machine has or could install — asked on every open,
+ /// for the reason `_probeEngines` gives: an install this very dialog starts
+ /// is what makes the stored answer stale.
+ Future<void> _probeHarnesses() =>
+ widget.notifier.probeDsh(_machineId, force: true);
+
+ /// The machine's row for harness [id], or null while it has not answered
+ /// (or does not know the request). Null is "unknown", never "absent".
+ DshEntry? _harness(String id) {
+ final machine = widget.notifier.stateOf(_machineId);
+ if (machine == null || !machine.dsh.loaded) return null;
+ return machine.dsh[id];
+ }
+
+ bool get _engineIsHarness => isHarnessId(_engine);
+
+ /// The engine a choice actually launches: a harness runs ON one of them, and
+ /// that is what travels as `engine` beside the harness id.
+ String _baseEngine(String id) => isHarnessId(id)
+ ? _harness(id)?.engine ?? knownHarnessBase[id] ?? 'claude'
+ : id;
+
+ /// What to call [id] on screen: the machine's name for a harness when it has
+ /// answered, else this build's.
+ String _labelOf(String id) =>
+ _harness(id)?.name ??
+ (id == 'claude' ? 'Claude Code' : engineIdentity(id).label);
+
+ /// The harness is absent from this machine and Harness would install it
+ /// before launching. False until the machine has answered: a harness cannot
+ /// be called missing on the strength of a request that has not come back.
+ bool _willInstallHarness(String id) {
+ final entry = _harness(id);
+ return entry != null && !entry.installed;
+ }
+
+ /// The harnesses to list after the engines: what the machine named when it
+ /// has answered, else the ones this build ships a face for.
+ List<DshEntry> get _harnessOptions {
+ final machine = widget.notifier.stateOf(_machineId);
+ if (machine != null &&
+ machine.dsh.loaded &&
+ machine.dsh.entries.isNotEmpty) {
+ return machine.dsh.entries;
+ }
+ return [
+ for (final identity in knownHarnesses)
+ DshEntry(
+ id: identity.id,
+ name: identity.label,
+ engine: knownHarnessBase[identity.id] ?? 'claude',
+ ),
+ ];
+ }
+
+ /// The one-line install status while a harness install is running, read off
+ /// the machine's own narration (`dsh_install_status`), or null.
+ String? get _installStatus {
+ if (!_installing) return null;
+ final progress = widget.notifier.stateOf(_machineId)?.dsh.installs[_engine];
+ return progress?.label ?? 'Installing…';
+ }
+
Future<void> _loadAgentPreference() async {
await widget.notifier.agentPreference.load();
if (!mounted || _choicesLocked || _engineChosenByUser) return;
final remembered = widget.notifier.agentPreference.value;
- if (allEngines.any((identity) => identity.id == remembered)) {
+ if (_knownChoice(remembered)) {
setState(() {
_engineChosenByUser = true;
if (_engine != remembered) {
@@ -193,6 +271,9 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
}
String _preferredInstalledEngine() {
+ // A harness is not in the engine probe at all; its own install state is
+ // the machine's catalog, and a remembered harness stays chosen.
+ if (_engineIsHarness) return _engine;
final engines = widget.notifier.stateOf(_machineId)?.engines;
if (engines?.loaded != true || engines?[_engine]?.installed == true) {
return _engine;
@@ -267,7 +348,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
/// Create waits while the Codex profile list is still loading on a machine
/// that can launch into one, so a click cannot land before the choice does.
bool get _waitingForCodexProfile =>
- _engine == 'codex' &&
+ _baseEngine(_engine) == 'codex' &&
_availability('codex')?.supportsCodexHome == true &&
_codexProfilesBusy;
@@ -313,7 +394,9 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
(!_confirmationPending && _waitingForCodexProfile)) {
return;
}
- final engine = _engine;
+ final choice = _engine;
+ final harness = _engineIsHarness ? choice : null;
+ final engine = _baseEngine(choice);
final profile = _codexProfile;
final bypassPermission =
_bypassPermission && kEngineBypassPermissionFlag.containsKey(engine);
@@ -323,6 +406,27 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
_submitting = true;
_error = null;
});
+ // A harness the machine does not have yet is installed FIRST, as its own
+ // step with its own words: minutes of clone and toolchain under a button
+ // that said "Creating agent…" would read as a create that hung.
+ if (harness != null &&
+ !_confirmationPending &&
+ _willInstallHarness(harness)) {
+ setState(() => _installing = true);
+ final failure = await widget.notifier.installDsh(_machineId, harness);
+ if (!mounted) return;
+ setState(() => _installing = false);
+ if (failure != null) {
+ setState(() {
+ _submitting = false;
+ _error = failure;
+ });
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (mounted) _actionFocus.requestFocus();
+ });
+ return;
+ }
+ }
final error = await widget.notifier.createAgent(
_machineId,
engine: engine,
@@ -334,6 +438,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
// Keep the explicit choice even if machine discovery changes mid-submit.
// The notifier must reject a now-remote target, never use its default login.
codexHome: engine == 'codex' ? profile?.path : null,
+ dsh: harness,
attempt: _creation,
);
if (!mounted) return;
@@ -355,7 +460,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
});
return;
}
- analytics.agentCreated(engine: engine, bypassPermission: bypassPermission);
+ analytics.agentCreated(engine: choice, bypassPermission: bypassPermission);
Navigator.of(context).pop(NewAgentDialogResult.created);
}
@@ -388,7 +493,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
}
Widget _buildDialog(BuildContext context) {
- final bypassFlag = kEngineBypassPermissionFlag[_engine];
+ final bypassFlag = kEngineBypassPermissionFlag[_baseEngine(_engine)];
final canCreate =
(_preparedFolder != null ||
(_folderSource == _FolderSource.local
@@ -550,6 +655,8 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
_FolderSource.remote &&
_preparedFolder == null
? 'Cloning and starting…'
+ : _installing
+ ? 'Installing ${_labelOf(_engine)}…'
: 'Creating agent…',
),
],
@@ -631,6 +738,20 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
label: identity.label,
leading: () => EngineMark(engine: identity.id, size: 14),
),
+ // The domain harnesses, after the engines they run on. What the
+ // machine named when it has answered, else this build's own two.
+ for (final harness in _harnessOptions)
+ SelectOption(
+ value: harness.id,
+ label: harness.name,
+ note: 'on ${_labelOf(harness.engine)}',
+ detail: harness.description,
+ leading: () => EngineMark(
+ engine: harness.id,
+ displayName: harness.name,
+ size: 14,
+ ),
+ ),
],
onChanged: (value) {
if (_choicesLocked) return;
@@ -641,12 +762,27 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
_error = null;
_codexProfile = null;
_codexProfilesBusy = true;
- if (!kEngineBypassPermissionFlag.containsKey(value)) {
+ if (!kEngineBypassPermissionFlag.containsKey(
+ _baseEngine(value),
+ )) {
_bypassPermission = false;
}
});
},
),
+ if (!_confirmationPending && _installStatus != null) ...[
+ const SizedBox(height: 6),
+ Semantics(
+ liveRegion: true,
+ child: Text(
+ key: const Key('new-agent-install-status'),
+ 'Installing ${_labelOf(_engine)} on $_machineName… '
+ '$_installStatus',
+ style: Theme.of(context).textTheme.bodySmall
+ ?.copyWith(color: grid.AppPalette.textSecondary),
+ ),
+ ),
+ ],
if (!_confirmationPending && _engineCheckFailed) ...[
const SizedBox(height: 6),
Row(
@@ -654,7 +790,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
children: [
Expanded(
child: Text(
- 'Couldn’t check whether ${engineIdentity(_engine).label} is installed. '
+ 'Couldn’t check whether ${_labelOf(_baseEngine(_engine))} is installed. '
'You can still try creating an agent.',
style: Theme.of(context).textTheme.bodySmall
?.copyWith(color: grid.AppPalette.textSecondary),
@@ -706,6 +842,18 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
},
);
+ /// What a harness choice means for the launch, in one line beside the
+ /// other settings: the engine it runs on is the one whose profile and
+ /// permission flag apply here.
+ Widget _harnessNote() => Text(
+ key: const Key('new-agent-runs-on'),
+ 'Runs on ${_labelOf(_baseEngine(_engine))}. '
+ 'Skills, toolchain and viewer come from the harness.',
+ style: Theme.of(
+ context,
+ ).textTheme.bodySmall?.copyWith(color: grid.AppPalette.textSecondary),
+ );
+
Widget _profileOptions() => Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
@@ -774,7 +922,8 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
: (value) => setState(() => _bypassPermission = value),
),
),
- if (_engine == 'codex') _setting(_profileOptions()),
+ if (_baseEngine(_engine) == 'codex') _setting(_profileOptions()),
+ if (_engineIsHarness) _setting(_harnessNote()),
],
);
@@ -861,6 +1010,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
_error = null;
});
unawaited(_probeEngines());
+ unawaited(_probeHarnesses());
},
);
}
diff --git a/desktop/test/agent_creation_recovery_test.dart b/desktop/test/agent_creation_recovery_test.dart
index 197bdacc7..4f88f082d 100644
--- a/desktop/test/agent_creation_recovery_test.dart
+++ b/desktop/test/agent_creation_recovery_test.dart
@@ -63,6 +63,7 @@ class _Connection extends WsConn {
Duration timeout = const Duration(seconds: 20),
}) {
if (type == 'engines_probe') return Future.value({'engines': []});
+ if (type == 'dsh_list') return Future.value({'dsh': []});
if (type == 'codex_profiles_list') return Future.value({'profiles': []});
final request = _Request(type, Map.of(payload));
calls.add(request);
diff --git a/desktop/test/first_workspace_test.dart b/desktop/test/first_workspace_test.dart
index d6cde358d..4396f6a95 100644
--- a/desktop/test/first_workspace_test.dart
+++ b/desktop/test/first_workspace_test.dart
@@ -16,6 +16,7 @@ import 'package:harness/state/pane_arrangement.dart';
import 'package:harness/state/swarm_catalog.dart';
import 'package:harness/terminal/terminal_binary.dart';
import 'package:harness/terminal/terminal_session.dart';
+import 'package:harness/widgets/agent_picker.dart';
import 'package:xterm/xterm.dart';
import 'swarm_screen_test.dart' show mount, terminal;
@@ -862,7 +863,7 @@ void main() {
await tester.pump();
if (chooseExplicitly) {
await tester.tap(
- find.byKey(const ValueKey('new-agent-quick-cursor')),
+ find.byKey(const ValueKey('new-agent-quick-autonomous/circuit')),
);
await tester.pump();
}
@@ -877,7 +878,7 @@ void main() {
final engine = tester.widget<AppSelectField<String>>(
find.byKey(const Key('new-agent-engine-field')),
);
- expect(engine.value, chooseExplicitly ? 'cursor' : 'codex');
+ expect(engine.value, chooseExplicitly ? 'autonomous/circuit' : 'codex');
expect(app.launches, isEmpty);
await tester.pumpWidget(const SizedBox());
app.dispose();
diff --git a/desktop/test/new_agent_dsh_test.dart b/desktop/test/new_agent_dsh_test.dart
new file mode 100644
index 000000000..8bc78c1c5
--- /dev/null
+++ b/desktop/test/new_agent_dsh_test.dart
@@ -0,0 +1,336 @@
+// A domain harness in the Create dialog: one tile, its base engine under
+// Advanced, an install-first step on a machine that lacks it, and a create that
+// names both the harness and the engine it runs on.
+import 'dart:async';
+
+import 'package:file_selector_platform_interface/file_selector_platform_interface.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/auth/auth_session.dart';
+import 'package:harness/core/config.dart';
+import 'package:harness/core/dsh_catalog.dart';
+import 'package:harness/core/engine_availability.dart';
+import 'package:harness/core/models.dart';
+import 'package:harness/state/app_state.dart';
+import 'package:harness/state/pane_arrangement.dart';
+import 'package:harness/shared/widgets/app_select_field.dart';
+import 'package:harness/widgets/new_agent_dialog.dart';
+
+const _folder = '/work/air-monitor';
+
+class _Folders extends FileSelectorPlatform {
+ @override
+ Future<String?> getDirectoryPath({
+ String? initialDirectory,
+ String? confirmButtonText,
+ }) async => _folder;
+}
+
+const _circuit = DshEntry(
+ id: 'autonomous/circuit',
+ name: 'Circuit',
+ engine: 'claude',
+ description: 'Chat with AI → a board you can order',
+ installed: false,
+ viewer: true,
+ tier: 2,
+);
+
+/// Stands in for the machine: the engine probe answers at once, the harness
+/// catalog answers what the test seeded, and installs/creates are recorded.
+class _Notifier extends AppNotifier {
+ _Notifier()
+ : super(
+ config: AppConfig.dev,
+ authSession: AuthSession(),
+ configStore: null,
+ );
+
+ final installs = <String>[];
+ final launches = <Map<String, Object?>>[];
+ Completer<String?>? pendingInstall;
+ int harnessProbes = 0;
+
+ @override
+ Future<void> probeEngines(String machineId, {bool force = false}) async {}
+
+ @override
+ Future<void> probeDsh(String machineId, {bool force = false}) async {
+ harnessProbes++;
+ }
+
+ @override
+ Future<Map<String, dynamic>> listCodexProfiles(
+ String machineId, {
+ Set<String> observedPaths = const {},
+ }) async => {'profiles': <dynamic>[]};
+
+ @override
+ Future<String?> installDsh(String machineId, String id) {
+ installs.add(id);
+ final machine = machineStates[machineId]!;
+ machine.dsh.installs[id] = DshInstallProgress(id: id, phase: 'setup');
+ notifyListeners();
+ final pending = pendingInstall;
+ if (pending == null) {
+ machine.dsh.replace([_circuit.copyWith(installed: true)]);
+ return Future.value(null);
+ }
+ return pending.future.then((error) {
+ if (error == null) {
+ machine.dsh.replace([_circuit.copyWith(installed: true)]);
+ }
+ return error;
+ });
+ }
+
+ @override
+ Future<String?> createAgent(
+ String machineId, {
+ required String engine,
+ required String folder,
+ bool bypassPermission = false,
+ String? codexHome,
+ String? dsh,
+ String? swarmId,
+ PaneSplitRequest? split,
+ AgentCreationAttempt? attempt,
+ }) async {
+ launches.add({
+ 'machine': machineId,
+ 'engine': engine,
+ 'dsh': dsh,
+ 'folder': folder,
+ 'bypass': bypassPermission,
+ });
+ return 'Test launch refused.';
+ }
+}
+
+extension on DshEntry {
+ DshEntry copyWith({bool? installed}) => DshEntry(
+ id: id,
+ name: name,
+ engine: engine,
+ description: description,
+ installed: installed ?? this.installed,
+ viewer: viewer,
+ tier: tier,
+ );
+}
+
+void main() {
+ TestWidgetsFlutterBinding.ensureInitialized();
+ setUp(() => FileSelectorPlatform.instance = _Folders());
+
+ const machine = Machine(
+ machineId: 'machine-1',
+ authMode: MachineAuthMode.remote,
+ name: 'harness-remote-box',
+ );
+
+ Future<_Notifier> open(
+ WidgetTester tester, {
+ required void Function(MachineState state) seed,
+ }) async {
+ final notifier = _Notifier();
+ addTearDown(notifier.dispose);
+ final state = MachineState(machine)..localOnly = true;
+ state.engines.replace(const [
+ EngineAvailability(engine: 'claude', installed: true),
+ EngineAvailability(engine: 'codex', installed: true),
+ ]);
+ seed(state);
+ notifier.machineStates['machine-1'] = state;
+ await tester.pumpWidget(
+ MaterialApp(
+ home: Builder(
+ builder: (context) => Scaffold(
+ body: TextButton(
+ onPressed: () => showNewAgentDialog(
+ context,
+ notifier,
+ 'machine-1',
+ source: 'machine_row',
+ ),
+ child: const Text('open'),
+ ),
+ ),
+ ),
+ ),
+ );
+ await tester.tap(find.text('open'));
+ await tester.pumpAndSettle();
+ await tester.tap(find.text('Browse…'));
+ await tester.pumpAndSettle();
+ return notifier;
+ }
+
+ String engineField(WidgetTester tester) => tester
+ .widget<AppSelectField<String>>(
+ find.byKey(const Key('new-agent-engine-field')),
+ )
+ .value;
+
+ testWidgets(
+ 'Circuit is one click, says what it runs on, and creates on its base engine',
+ (tester) async {
+ final app = await open(
+ tester,
+ seed: (state) =>
+ state.dsh.replace([_circuit.copyWith(installed: true)]),
+ );
+ expect(app.harnessProbes, 1, reason: 'asked on open, like the engines');
+ await tester.tap(
+ find.byKey(const ValueKey('new-agent-quick-autonomous/circuit')),
+ );
+ await tester.pumpAndSettle();
+ expect(engineField(tester), 'autonomous/circuit');
+ expect(find.text('Runs on Claude Code'), findsOneWidget);
+ // Installed, so nothing to announce.
+ expect(find.textContaining('Harness will install'), findsNothing);
+ await tester.tap(find.byKey(const Key('new-agent-advanced')));
+ await tester.pumpAndSettle();
+ expect(find.byKey(const Key('new-agent-runs-on')), findsOneWidget);
+ expect(
+ find.textContaining('Runs on Claude Code. The harness brings'),
+ findsOneWidget,
+ );
+ // Its base engine's bypass flag is the one offered: a harness has no
+ // flag of its own, and without the base's it would say "Managed by".
+ await tester.ensureVisible(find.text('Bypass permission prompts'));
+ expect(find.text('Bypass permission prompts'), findsOneWidget);
+ expect(find.textContaining('Managed by'), findsNothing);
+
+ await tester.tap(find.widgetWithText(FilledButton, 'Create Agent'));
+ await tester.pump();
+ expect(app.installs, isEmpty);
+ expect(app.launches.single, {
+ 'machine': 'machine-1',
+ 'engine': 'claude',
+ 'dsh': 'autonomous/circuit',
+ 'folder': _folder,
+ 'bypass': false,
+ });
+ expect(tester.takeException(), isNull);
+ },
+ );
+
+ testWidgets(
+ 'a harness the machine lacks is installed first, with its own words',
+ (tester) async {
+ final app = await open(
+ tester,
+ seed: (state) => state.dsh.replace([_circuit]),
+ );
+ app.pendingInstall = Completer<String?>();
+ await tester.tap(
+ find.byKey(const ValueKey('new-agent-quick-autonomous/circuit')),
+ );
+ await tester.pumpAndSettle();
+ expect(
+ find.text(
+ 'Harness will install Circuit on harness-remote-box before starting.',
+ ),
+ findsOneWidget,
+ );
+ await tester.tap(find.widgetWithText(FilledButton, 'Create Agent'));
+ await tester.pump();
+ expect(app.installs, ['autonomous/circuit']);
+ expect(
+ app.launches,
+ isEmpty,
+ reason: 'no create until the install lands',
+ );
+ expect(find.text('Installing Circuit…'), findsOneWidget);
+ expect(
+ find.textContaining('Setting up the toolchain…'),
+ findsOneWidget,
+ reason: 'the machine narrates the install through the status line',
+ );
+ app.pendingInstall!.complete(null);
+ await tester.pump();
+ await tester.pump();
+ expect(app.launches.single['dsh'], 'autonomous/circuit');
+ expect(app.launches.single['engine'], 'claude');
+ expect(tester.takeException(), isNull);
+ },
+ );
+
+ testWidgets('a failed install is a sentence and no create', (tester) async {
+ final app = await open(
+ tester,
+ seed: (state) => state.dsh.replace([_circuit]),
+ );
+ app.pendingInstall = Completer<String?>();
+ await tester.tap(
+ find.byKey(const ValueKey('new-agent-quick-autonomous/circuit')),
+ );
+ await tester.pumpAndSettle();
+ await tester.tap(find.widgetWithText(FilledButton, 'Create Agent'));
+ await tester.pump();
+ app.pendingInstall!.complete('kicad-cli is not on harness-remote-box');
+ await tester.pump();
+ await tester.pump();
+ expect(app.launches, isEmpty);
+ expect(find.text('kicad-cli is not on harness-remote-box'), findsOneWidget);
+ // Retryable: the button is back.
+ expect(find.widgetWithText(FilledButton, 'Create Agent'), findsOneWidget);
+ expect(tester.takeException(), isNull);
+ });
+
+ testWidgets(
+ 'a machine that has not answered offers the tiles without a verdict',
+ (tester) async {
+ final app = await open(tester, seed: (_) {});
+ await tester.tap(
+ find.byKey(const ValueKey('new-agent-quick-autonomous/workshop')),
+ );
+ await tester.pumpAndSettle();
+ expect(engineField(tester), 'autonomous/workshop');
+ expect(find.text('Runs on Codex'), findsOneWidget);
+ expect(find.textContaining('Harness will install'), findsNothing);
+ await tester.tap(find.widgetWithText(FilledButton, 'Create Agent'));
+ await tester.pump();
+ expect(app.installs, isEmpty);
+ expect(app.launches.single['engine'], 'codex');
+ expect(app.launches.single['dsh'], 'autonomous/workshop');
+ expect(tester.takeException(), isNull);
+ },
+ );
+
+ testWidgets('More lists the machine\'s harnesses after the engines', (
+ tester,
+ ) async {
+ await open(
+ tester,
+ seed: (state) => state.dsh.replace([
+ _circuit,
+ const DshEntry(
+ id: 'someone/robot-arm',
+ name: 'Robot Arm',
+ engine: 'codex',
+ ),
+ ]),
+ );
+ await tester.tap(find.byTooltip('More agents'));
+ await tester.pumpAndSettle();
+ // Far down a list of fourteen engines: scrolled into view first, or the
+ // tap lands on the menu's edge and quietly selects nothing.
+ await tester.ensureVisible(find.text('Robot Arm'));
+ await tester.pumpAndSettle();
+ expect(find.text('Robot Arm'), findsOneWidget);
+ expect(find.text('on Codex'), findsOneWidget);
+ await tester.tap(find.text('Robot Arm'));
+ await tester.pumpAndSettle();
+ expect(engineField(tester), 'someone/robot-arm');
+ expect(find.text('Runs on Codex'), findsOneWidget);
+ expect(
+ find.text(
+ 'Harness will install Robot Arm on harness-remote-box before starting.',
+ ),
+ findsOneWidget,
+ );
+ expect(tester.takeException(), isNull);
+ });
+}