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.

test(super-tabs): an offline machine still attaches a running agent from "Offline · N"

bitcoinbuildercc01217a4014
diff --git a/desktop/test/super_tab_machines_test.dart b/desktop/test/super_tab_machines_test.dart
index a0bb08521..4ee575b8e 100644
--- a/desktop/test/super_tab_machines_test.dart
+++ b/desktop/test/super_tab_machines_test.dart
@@ -533,6 +533,51 @@ void main() {
},
);
+ testWidgets(
+ 'an offline machine is reached through "Offline · N", and its details still attach a running agent',
+ (tester) async {
+ final server = ConversationServer();
+ server.state['machines'] = [
+ {
+ 'machineId': 'gone',
+ 'name': 'Old Mini',
+ 'contributorId': 'owner',
+ 'observation': {
+ 'receivedAt': DateTime.now()
+ .subtract(const Duration(minutes: 10))
+ .millisecondsSinceEpoch,
+ },
+ },
+ ];
+ final c = server.controller();
+ await c.refresh();
+ final attached = <String>[];
+ await tester.pumpWidget(
+ MaterialApp(
+ home: Scaffold(
+ body: SuperTabMachines(
+ controller: c,
+ onAddAgent: (group) => attached.add(group.id),
+ ),
+ ),
+ ),
+ );
+ await tester.pumpAndSettle();
+ final row = find.byKey(const ValueKey('super-machine-gone'));
+ expect(row, findsNothing);
+ await tester.tap(find.byKey(const ValueKey('super-machines-offline')));
+ await tester.pumpAndSettle();
+ await tester.tap(row);
+ await tester.pumpAndSettle();
+ await tester.tap(find.widgetWithText(TextButton, 'Attach running agent'));
+ await tester.pumpAndSettle();
+ expect(attached, [c.selected!.id]);
+ await tester.pumpWidget(const SizedBox());
+ await c.flush();
+ c.dispose();
+ },
+ );
+
for (final brightness in [Brightness.dark, Brightness.light]) {
for (final textScale in [1.0, 2.0]) {
for (final width in [280.0, 380.0]) {