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.

Super Tab desktop: terminal input and alert notes, "Limited until" status (#1650)

0xken15377804a893d3
diff --git a/desktop/lib/super_tabs/agent_details.dart b/desktop/lib/super_tabs/agent_details.dart
index b6cd8b8dd..dd3586b39 100644
--- a/desktop/lib/super_tabs/agent_details.dart
+++ b/desktop/lib/super_tabs/agent_details.dart
@@ -116,6 +116,12 @@ class SuperTabAgentInfo {
HarnessActivity.starting) {
return activity!.label;
}
+ // A usage limit holds the agent whatever its task says, until the reset.
+ if (agent.limitedUntil?.toLocal() case final until?
+ when until.isAfter(DateTime.now())) {
+ String two(int n) => n.toString().padLeft(2, '0');
+ return 'Limited until ${two(until.hour)}:${two(until.minute)}';
+ }
final workStatus = taskGroup?.assignment?['status'];
if (hasQuestion || workStatus == 'needs_human') {
return 'Waiting for a person to answer';
diff --git a/desktop/lib/super_tabs/model.dart b/desktop/lib/super_tabs/model.dart
index 6864aa452..a022b9862 100644
--- a/desktop/lib/super_tabs/model.dart
+++ b/desktop/lib/super_tabs/model.dart
@@ -44,9 +44,14 @@ class SuperTabAgent {
machineOwnerId =
row['machineOwnerId'] as String? ?? _text(row, 'contributorId'),
role = row['role'] as String?,
+ limitedUntil = DateTime.tryParse(row['limitedUntil'] as String? ?? ''),
configuration = Map.unmodifiable(superTabMap(row['configuration']));
final String id, projectId, name, machineId, harnessId, contributorId;
+ /// Until when routing skips it: its machine saw a usage limit on its screen
+ /// (spec/2026-10-23-lead-sees-agent-terminal.md). Null when none was seen.
+ final DateTime? limitedUntil;
+
/// The account whose computer runs it; a contributor may run agents on a computer another account shared with them.
final String machineOwnerId;
// Keep the legacy default for callers while allowing group-based roster ownership.
@@ -384,6 +389,10 @@ class SuperTabMessage {
bool get fromTerminal => source['kind'] == 'native';
SuperTabRoute? get route => SuperTabRoute.fromSource(source);
bool get routeOverride => source['kind'] == 'route-override';
+
+ /// A note the backend writes about a terminal: a Lead's typing, or an alert.
+ bool get terminalEvent =>
+ source['kind'] == 'terminal-input' || source['kind'] == 'terminal-alert';
String? get terminalNote {
if (!fromTerminal) return null;
final phase = source['phase'];
diff --git a/desktop/lib/super_tabs/terminal_row.dart b/desktop/lib/super_tabs/terminal_row.dart
new file mode 100644
index 000000000..fa637b559
--- /dev/null
+++ b/desktop/lib/super_tabs/terminal_row.dart
@@ -0,0 +1,67 @@
+import 'package:flutter/material.dart';
+
+import '../shared/theme/app_icons.dart';
+import '../shared/theme/app_theme.dart' as grid;
+import '../widgets/desktop_chrome.dart';
+import 'message_row.dart';
+import 'model.dart';
+
+/// A Lead's typing into a worker's terminal, or a worker's machine telling its
+/// Lead it waits at a prompt or hit a usage limit
+/// (spec/2026-10-23-lead-sees-agent-terminal.md). The backend writes what
+/// happened as one sentence; it is a note in the group, not chat from the
+/// agent, so it has no author heading, reply or receipt.
+class SuperTabTerminalRow extends StatelessWidget {
+ const SuperTabTerminalRow({super.key, required this.message});
+ final SuperTabMessage message;
+
+ @override
+ Widget build(BuildContext context) {
+ grid.AppTheme.watch(context);
+ final alert = message.source['kind'] == 'terminal-alert';
+ final style = DesktopChrome.metadata(
+ color: Theme.of(context).colorScheme.onSurfaceVariant,
+ );
+ return Padding(
+ padding: const EdgeInsets.fromLTRB(
+ SuperTabMessageRow.bodyInset,
+ 4,
+ SuperTabMessageRow.horizontalInset,
+ 4,
+ ),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(top: 1, right: 6),
+ child: Icon(
+ alert ? AppIcons.triangleAlert : AppIcons.keyboard,
+ size: 14,
+ color: alert ? grid.AppPalette.warn : style.color,
+ ),
+ ),
+ Expanded(child: Text.rich(_typed(message.text, style), style: style)),
+ ],
+ ),
+ );
+ }
+
+ /// The backend wraps what was typed in one pair of backticks
+ /// (`` `2` + Enter ``), and the text inside is the Lead's as typed, backticks
+ /// included (`` `echo `date`` ``): so the first and the last backtick are the
+ /// wrapper, and what lies between is shown whole, in the terminal's face.
+ static TextSpan _typed(String text, TextStyle style) {
+ final open = text.indexOf('`'), close = text.lastIndexOf('`');
+ if (open < 0 || close == open) return TextSpan(text: text);
+ return TextSpan(
+ children: [
+ TextSpan(text: text.substring(0, open)),
+ TextSpan(
+ text: text.substring(open + 1, close),
+ style: style.copyWith(fontFamily: grid.AppType.monoFamily),
+ ),
+ TextSpan(text: text.substring(close + 1)),
+ ],
+ );
+ }
+}
diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dart
index de1015d6c..17ccd3720 100644
--- a/desktop/lib/super_tabs/view.dart
+++ b/desktop/lib/super_tabs/view.dart
@@ -21,6 +21,7 @@ import 'model.dart';
import 'message_row.dart';
import 'message_receipt.dart';
import 'route_row.dart';
+import 'terminal_row.dart';
import 'work_details.dart';
import 'project_sidebar.dart';
import 'project_options.dart';
@@ -961,6 +962,12 @@ class _SuperTabViewState extends State<SuperTabView>
Map<String, SuperTabMessage> byId, {
bool showReceipt = false,
}) {
+ if (message.terminalEvent) {
+ return SuperTabTerminalRow(
+ key: ValueKey('super-message-${message.id}'),
+ message: message,
+ );
+ }
final route = message.route;
if (route != null) {
return SuperTabRouteRow(
diff --git a/desktop/test/super_tab_roster_test.dart b/desktop/test/super_tab_roster_test.dart
index 40d1987e2..41968b867 100644
--- a/desktop/test/super_tab_roster_test.dart
+++ b/desktop/test/super_tab_roster_test.dart
@@ -168,6 +168,52 @@ void main() {
.single
.message!;
+ testWidgets(
+ 'an agent whose screen showed a usage limit reads "Limited until" its reset, in local time, until it passes',
+ (tester) async {
+ final f = await fixture(tester);
+ final agents = f.server.state['agents'] as List;
+ // Working on a task, so its status would otherwise say so.
+ (f.server.state['conversations'] as List)[1]['assignment'] = {
+ 'agentId': 'agent-1',
+ 'status': 'working',
+ };
+ agents[1]['limitedUntil'] = DateTime(
+ 2099,
+ 1,
+ 2,
+ 9,
+ 5,
+ ).toUtc().toIso8601String();
+ await f.controller.refresh();
+ await f.show(tester);
+ expect(f.inRow(1, find.text('Limited until 09:05')), findsOneWidget);
+ expect(rowTooltip(tester, f, 1), contains('Limited until 09:05'));
+ await captureBoundary(
+ tester,
+ f.boundary.currentContext!.findRenderObject()! as RenderRepaintBoundary,
+ captureDir,
+ 'roster-limited',
+ );
+ // A reset already past, or none, is no limit.
+ for (final until in [DateTime(2000).toUtc().toIso8601String(), null]) {
+ if (until == null) {
+ (agents[1] as Map).remove('limitedUntil');
+ } else {
+ agents[1]['limitedUntil'] = until;
+ }
+ await f.controller.refresh();
+ await tester.pumpAndSettle();
+ expect(find.textContaining('Limited until'), findsNothing);
+ expect(
+ f.inRow(1, find.text('Assigned to "Offline editing"')),
+ findsOneWidget,
+ );
+ }
+ await f.close(tester);
+ },
+ );
+
testWidgets(
'agent tooltip combines known model, machine, task and activity',
(tester) async {
diff --git a/desktop/test/super_tab_terminal_rows_test.dart b/desktop/test/super_tab_terminal_rows_test.dart
new file mode 100644
index 000000000..de298984d
--- /dev/null
+++ b/desktop/test/super_tab_terminal_rows_test.dart
@@ -0,0 +1,183 @@
+import 'dart:io';
+
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/shared/theme/app_icons.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/super_tabs/message_row.dart';
+import 'package:harness/super_tabs/terminal_row.dart';
+import 'package:harness/super_tabs/view.dart';
+
+import 'support/capture.dart';
+import 'support/super_tab_fixture.dart';
+
+/// The rows the backend writes when a Lead types into a worker's terminal and
+/// when a worker's machine alerts its Lead (spec/2026-10-23-lead-sees-agent-terminal.md):
+/// shown as plain notes in the group, not as chat from the agent.
+void main() {
+ final captureDir = Platform.environment['HARNESS_SUPER_TAB_CAPTURE'];
+ setUpAll(() async {
+ await loadCaptureFonts(captureDir);
+ // The typed text's face, as the native message test loads it.
+ await (FontLoader(grid.AppType.monoFamily)
+ ..addFont(rootBundle.load('assets/fonts/roboto-mono/RobotoMono.ttf')))
+ .load();
+ });
+
+ for (final brightness in Brightness.values) {
+ testWidgets(
+ 'terminal input and alert rows read as plain notes (${brightness.name})',
+ (tester) async {
+ await tester.binding.setSurfaceSize(const Size(900, 520));
+ addTearDown(() => tester.binding.setSurfaceSize(null));
+ final previous = grid.AppTheme.brightness.value;
+ grid.AppTheme.brightness.value = brightness;
+ addTearDown(() => grid.AppTheme.brightness.value = previous);
+ final server = ConversationServer();
+ server.state['agents'] = [
+ for (final (id, name) in [
+ ('lead-agent', 'Wren'),
+ ('builder', 'Sage'),
+ ])
+ {
+ 'id': id,
+ 'name': id == 'builder' ? 'Builder' : 'Lead',
+ 'displayName': name,
+ 'machineId': 'm',
+ 'harnessId': id,
+ 'contributorId': 'owner',
+ 'configuration': {'engine': 'claude'},
+ },
+ ];
+ final group = (server.state['conversations'] as List)[1] as Map;
+ group['agentIds'] = ['lead-agent', 'builder'];
+ group['leadId'] = 'lead-agent';
+ void row(String text, String author, Map<String, Object> source) {
+ server.append(text, conversationId: 'offline');
+ server.messages.last['author'] = {
+ 'kind': 'agent',
+ 'id': author,
+ 'name': 'Agent',
+ };
+ server.messages.last['source'] = source;
+ }
+
+ server.append('Check the offline queue.', conversationId: 'offline');
+ row('Sage is waiting at a prompt in its terminal.', 'builder', {
+ 'kind': 'terminal-alert',
+ 'agentId': 'builder',
+ 'alert': 'prompt',
+ });
+ row('Wren typed `2` + Enter in Sage\'s terminal', 'lead-agent', {
+ 'kind': 'terminal-input',
+ 'agentId': 'builder',
+ 'requestId': 'r1',
+ });
+ // Text the Lead typed may hold backticks of its own; only the backend's wrapper goes.
+ row('Wren typed `echo `date`` in Sage\'s terminal', 'lead-agent', {
+ 'kind': 'terminal-input',
+ 'agentId': 'builder',
+ 'requestId': 'r2',
+ });
+ row(
+ 'Sage hit a usage limit. Routing skips it until 15:00 UTC.',
+ 'builder',
+ {
+ 'kind': 'terminal-alert',
+ 'agentId': 'builder',
+ 'alert': 'limit',
+ 'limitedUntil': '2099-01-02T15:00:00.000Z',
+ },
+ );
+ final controller = server.controller(
+ initial: {
+ 'tabId': 'tab',
+ 'accountId': 'owner',
+ 'selectedId': 'offline',
+ },
+ );
+ await controller.refresh();
+ final boundary = GlobalKey();
+ await tester.pumpWidget(
+ RepaintBoundary(
+ key: boundary,
+ child: MaterialApp(
+ debugShowCheckedModeBanner: false,
+ theme: grid.buildAppTheme(brightness: brightness),
+ home: Scaffold(
+ body: SuperTabView(
+ controller: controller,
+ onInvite: () {},
+ onAddAgent: (_) {},
+ onOpenTerminal: (_) {},
+ machineName: (_) => 'Team Mac',
+ ),
+ ),
+ ),
+ ),
+ );
+ await tester.pumpAndSettle();
+
+ // One note per row, each with what happened and nothing else.
+ final notes = find.byType(SuperTabTerminalRow);
+ expect(notes, findsNWidgets(4));
+ for (final text in [
+ 'Sage is waiting at a prompt in its terminal.',
+ 'Sage hit a usage limit. Routing skips it until 15:00 UTC.',
+ ]) {
+ expect(
+ find.descendant(of: notes, matching: find.text(text)),
+ findsOneWidget,
+ );
+ }
+ // What was typed is set apart from the words around it; the backend's wrapper is not shown.
+ final typed = find.descendant(
+ of: notes,
+ matching: find.text(
+ 'Wren typed 2 + Enter in Sage\'s terminal',
+ findRichText: true,
+ ),
+ );
+ expect(typed, findsOneWidget);
+ expect(
+ find.descendant(
+ of: notes,
+ matching: find.text(
+ 'Wren typed echo `date` in Sage\'s terminal',
+ findRichText: true,
+ ),
+ ),
+ findsOneWidget,
+ );
+ // Both inputs are keyboard notes; both alerts are warnings.
+ expect(
+ find.descendant(of: notes, matching: find.byIcon(AppIcons.keyboard)),
+ findsNWidgets(2),
+ );
+ expect(
+ find.descendant(
+ of: notes,
+ matching: find.byIcon(AppIcons.triangleAlert),
+ ),
+ findsNWidgets(2),
+ );
+ // They are not chat: the person's own message is the only message row, with its author heading.
+ expect(find.byType(SuperTabMessageRow), findsOneWidget);
+ expect(find.text('Agent'), findsNothing);
+ expect(tester.takeException(), isNull);
+
+ await captureBoundary(
+ tester,
+ boundary.currentContext!.findRenderObject()! as RenderRepaintBoundary,
+ captureDir,
+ 'terminal-rows-${brightness.name}',
+ );
+ await tester.pumpWidget(const SizedBox());
+ await controller.flush();
+ controller.dispose();
+ },
+ );
+ }
+}