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.

feat(mobile): name tabs like desktop and tidy Find rows

tony3615b0c5b15b
diff --git a/mobile/lib/core/models.dart b/mobile/lib/core/models.dart
index 2f00caca3..18069c64b 100644
--- a/mobile/lib/core/models.dart
+++ b/mobile/lib/core/models.dart
@@ -176,6 +176,14 @@ class Agent {
/// when the daemon has none to report.
final String? selectedModel;
+ /// The domain-specific harness this agent was made from (`autonomous/kicad`), null for a plain
+ /// engine — the desktop's `Agent.dsh`, read the same way ([_safeDsh]).
+ final String? dsh;
+
+ /// What the agent is AS — its harness when it has one, else its engine. The desktop's
+ /// `Agent.identityEngine`, which a tab's name votes with (`phone/desk_groups.dart`).
+ String? get identityEngine => dsh ?? engine;
+
/// A domain-specific harness's display name ("Model manager"), null for a
/// plain engine.
final String? dshName;
@@ -218,6 +226,7 @@ class Agent {
this.gridModel,
this.gridWebSearch,
this.selectedModel,
+ this.dsh,
this.dshName,
this.parentAgentId,
this.project,
@@ -279,6 +288,7 @@ class Agent {
? GridWebSearch.fromWire(grid['webSearch'])
: null,
selectedModel: _safeLabel(j['selectedModel']),
+ dsh: _safeDsh(j['dsh']),
dshName: _safeLabel(j['dshName']),
parentAgentId: _safeLabel(j['parentAgentId'] ?? j['parentId']),
project: AgentProject.fromJson(j['project']),
@@ -317,6 +327,7 @@ class Agent {
gridModel: gridModel,
gridWebSearch: gridWebSearch,
selectedModel: selectedModel,
+ dsh: dsh,
dshName: dshName,
parentAgentId: parentAgentId,
project: project,
@@ -411,6 +422,15 @@ class Agent {
return raw;
}
+ /// An `owner/name` harness id, or null — the desktop's `Agent._safeDsh`, character for character.
+ static String? _safeDsh(Object? raw) {
+ if (raw is! String || raw.isEmpty || raw.length > 129) return null;
+ return RegExp(r'^[a-z0-9][a-z0-9-]{0,63}/[a-z0-9][a-z0-9-]{0,63}$')
+ .hasMatch(raw)
+ ? raw
+ : null;
+ }
+
static String? _safeLabel(Object? raw) {
if (raw is! String || raw.isEmpty) return null;
return raw.length <= 80 ? raw : raw.substring(0, 80);
diff --git a/mobile/lib/phone/agent_recap.dart b/mobile/lib/phone/agent_recap.dart
deleted file mode 100644
index f105df4e4..000000000
--- a/mobile/lib/phone/agent_recap.dart
+++ /dev/null
@@ -1,158 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
-import 'package:lucide_icons_flutter/lucide_icons.dart';
-
-import 'package:harness_mobile/shared/theme/app_theme.dart';
-import 'package:harness_mobile/state/session_preview.dart';
-
-import 'find_row.dart';
-import 'tty.dart';
-import 'tty_controls.dart';
-
-/// What a session's last finished turn said, as Find unfolds it under the session's row — or null
-/// when [previews] holds nothing it said.
-///
-/// The reply the turn's own `recap` was written for, where it had one ([SessionPreview.savedText]
-/// beside [SessionPreview.recap]) — never a reply from another turn. Otherwise the reply on record
-/// ([SessionPreview.response]): a provider that writes no recap has still said something.
-String? phoneRecap(SessionPreviewStore previews, SessionPreviewKey? key) {
- if (key == null) return null;
- final preview = previews.read(key);
- if (preview == null) return null;
- final saved = preview.savedText;
- final text = preview.recap != null && saved != null
- ? saved
- : preview.response;
- return text == null || text.trim().isEmpty ? null : text;
-}
-
-/// The chevron at the end of a Find row's first line, beside `idle · 25m`: shows the session's
-/// recap under the row, and hides it again.
-///
-/// The recap is folded away by default — which session to open is decided by its name, state and
-/// age, and what it last said is only there for the one somebody wonders about.
-///
-/// Given to the row as its [FindRow.accessory], which draws it over the row rather than inside it,
-/// so a tap here never lights the row. Wide enough for a thumb, as tall as the row gives it, the
-/// chevron centred in it; [room] is what the row keeps clear for it.
-class AgentRecapToggle extends StatelessWidget {
- const AgentRecapToggle({
- super.key,
- required this.expanded,
- required this.onToggle,
- });
-
- final bool expanded;
- final VoidCallback onToggle;
-
- static const double _width = 36;
- static const double _chevron = 14;
-
- /// Between the row's state words and the chevron.
- static const double _gap = 8;
-
- /// What [FindRow.accessoryRoom] keeps for this: the gap and the chevron, less the row's own
- /// gutter, which the toggle's hit area overlaps.
- static const double room = _gap + (_width + _chevron) / 2 - Tty.origin;
-
- @override
- Widget build(BuildContext context) {
- final tty = Tty.of(context);
- final motion = MediaQuery.disableAnimationsOf(context)
- ? Duration.zero
- : AppMotion.fold;
- return Semantics(
- button: true,
- label: expanded ? 'Hide the recap' : 'Show the recap',
- child: GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: () {
- HapticFeedback.selectionClick();
- onToggle();
- },
- child: SizedBox(
- width: _width,
- child: Center(
- child: AnimatedRotation(
- turns: expanded ? 0.5 : 0,
- duration: motion,
- curve: AppMotion.curve,
- child: Icon(
- LucideIcons.chevronDown,
- size: _chevron,
- color: expanded ? tty.text : tty.faint,
- ),
- ),
- ),
- ),
- ),
- );
- }
-}
-
-/// A session's recap under its Find row: nothing while folded, the reply as it was written while
-/// [expanded], growing into place rather than appearing.
-///
-/// ⚠️ **Its own tap target, beside the row's and not inside it.** A tap on the row opens the
-/// session; a tap here folds the recap away, as the row's [AgentRecapToggle] does — the larger
-/// target, and where the eye is once the reading is done.
-class AgentRecap extends StatelessWidget {
- const AgentRecap({
- super.key,
- required this.text,
- required this.expanded,
- required this.onToggle,
- });
-
- final String text;
- final bool expanded;
- final VoidCallback onToggle;
-
- static const double _rule = 1.0;
- static const double _inset = 10.0;
-
- /// The row's own gutter, so the rule stands under the first letter of the name above it.
- static const _outer = EdgeInsets.fromLTRB(Tty.origin, 0, Tty.origin, 12);
-
- @override
- Widget build(BuildContext context) {
- final tty = Tty.of(context);
- final motion = MediaQuery.disableAnimationsOf(context)
- ? Duration.zero
- : AppMotion.fold;
- return AnimatedSize(
- duration: motion,
- curve: AppMotion.curve,
- alignment: Alignment.topLeft,
- child: !expanded
- ? const SizedBox(width: double.infinity)
- : Semantics(
- button: true,
- onTapHint: 'Fold the recap',
- child: GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: () {
- HapticFeedback.selectionClick();
- onToggle();
- },
- child: Padding(
- padding: _outer,
- child: Container(
- width: double.infinity,
- padding: const EdgeInsets.only(left: _inset),
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(width: _rule, color: tty.faint),
- ),
- ),
- child: Text(
- text,
- style: tty.style(color: tty.text, size: TtySize.meta),
- ),
- ),
- ),
- ),
- ),
- );
- }
-}
diff --git a/mobile/lib/phone/desk_groups.dart b/mobile/lib/phone/desk_groups.dart
index 8e4524366..d59391549 100644
--- a/mobile/lib/phone/desk_groups.dart
+++ b/mobile/lib/phone/desk_groups.dart
@@ -3,6 +3,8 @@ import 'package:harness_mobile/core/models.dart';
import 'package:harness_mobile/state/app_state.dart';
import 'package:harness_mobile/state/desk_sync.dart';
import 'package:harness_mobile/state/swarm.dart';
+import 'package:harness_mobile/widgets/engine_identity.dart'
+ show canonicalHarnessId, isCodeEngine, isHarnessId;
import 'agent_index.dart';
@@ -72,15 +74,12 @@ List<DeskGroup> deskGroups(AppNotifier notifier, List<AgentEntry> visible) {
entry,
};
final byKey = keyed(openable);
- final known = keyed(visible);
+ final names = deskTabNames(notifier);
return [
for (final tab in tabs)
DeskGroup(
id: tab.id,
- name: deskTabName(
- tab,
- tab.panes.isEmpty ? null : known[tab.panes.first.key]?.agent,
- ),
+ name: names[tab.id] ?? Swarm.defaultName,
entries: [for (final pane in tab.panes) ?byKey[pane.key]],
),
];
@@ -115,49 +114,124 @@ class DeskTabFilter {
);
}
-/// The desk's tabs, in the desk's order, each named as the tab strip names it.
+/// The desk's tabs, in the desk's order, each named as the tab strip names it ([deskTabNames]).
///
/// Empty where the desk has no tabs or has not answered — and then there is
/// nothing to narrow by, so the list draws no filter at all.
-List<DeskTabFilter> deskTabFilters(
- AppNotifier notifier,
- List<AgentEntry> visible,
-) {
+List<DeskTabFilter> deskTabFilters(AppNotifier notifier) {
final tabs = notifier.deskTabs;
if (tabs.isEmpty) return const [];
- final known = {
- for (final entry in visible)
- DeskPaneRef(machineId: entry.machineId, agentId: entry.agent.id).key:
- entry.agent,
- };
+ final names = deskTabNames(notifier);
return [
for (final tab in tabs)
DeskTabFilter(
id: tab.id,
- name: deskTabName(
- tab,
- tab.panes.isEmpty ? null : known[tab.panes.first.key],
- ),
+ name: names[tab.id] ?? Swarm.defaultName,
keys: {for (final pane in tab.panes) pane.key},
),
];
}
-/// What a tab is called — the desktop's rule (`AppNotifier._syncAgentName`).
+/// What a tab's agents can have in common, strongest claim first when counts tie: what they are,
+/// the project they work in, the machine they run on.
+enum _TabTrait { type, project, machine }
+
+typedef _TabName = ({_TabTrait trait, String label, int count});
+
+/// What each of the desk's tabs is called, by tab id — the desktop's rule, `workspaceTabNames` in
+/// `desktop/lib/state/workspace_status.dart`, so a tab reads the same here as in the window beside
+/// the phone.
///
-/// A name somebody gave it stands. Otherwise the tab is named after its first
-/// agent ([first]), and follows that agent's [Agent.displayName] as its session
-/// titles it — `Greet user` rather than the `Untitled Tab` the desk was left
-/// holding. An agent with no name of its own leaves the tab [Swarm.defaultName].
+/// A name somebody gave it stands. Otherwise its agents vote on the three [_TabTrait]s — their type
+/// (`code` for every coding engine, a harness's own name for a harness: [_tabType]), their project,
+/// their machine — and the trait most of them share names the tab. A tie goes to the trait least
+/// repeated across the other tabs, and after that to the stronger trait. A tab with nothing to vote
+/// is [Swarm.defaultName].
///
-/// ⚠️ **Derived here, never written back.** Every window derives it the same
-/// way, and the desk syncs only names a person chose (`nameIsCustom`); writing a
-/// derived one would turn it into a chosen one on every computer.
-String deskTabName(DeskTab tab, Agent? first) {
- if (tab.nameIsCustom) return tab.name;
- if (first == null) return Swarm.normalizeName(tab.name);
- final name = first.displayName;
- return name == kUntitledPane ? Swarm.defaultName : name;
+/// ⚠️ **Why the vote and not the first agent's name (owner, 2026-10-01).** The phone named a tab
+/// after its first agent — the desktop's rule (`AppNotifier._syncAgentName`) until the desktop
+/// moved to this one on 2026-09-24 — and kept that rule after it moved: the same tab of two
+/// Claude Code agents read `code` on the desktop and `Fix bugs` on the phone.
+///
+/// ⚠️ **Derived here, never written back.** Every window derives it the same way, and the desk
+/// syncs only names a person chose (`nameIsCustom`); writing a derived one would turn it into a
+/// chosen one on every computer.
+///
+/// ⚠️ **Where it can still differ from the desktop.** The desktop also votes with a pane's live
+/// session engine when its agent is not listed, and counts repetitions across its window-only tabs
+/// (Store, orchestrator) — neither of which the phone has. Both reach only a tab whose agents the
+/// machine has not listed, or a tie decided by repetitions.
+Map<String, String> deskTabNames(AppNotifier notifier) {
+ final tabs = notifier.deskTabs;
+ final candidates = <String, List<_TabName>>{};
+ for (final tab in tabs) {
+ if (tab.nameIsCustom) {
+ candidates[tab.id] = const [];
+ continue;
+ }
+ final counts = <_TabTrait, Map<String, int>>{
+ for (final trait in _TabTrait.values) trait: {},
+ };
+ void vote(_TabTrait trait, String? label) {
+ if (label == null || label.isEmpty) return;
+ counts[trait]!.update(label, (n) => n + 1, ifAbsent: () => 1);
+ }
+
+ // One vote per agent, however many panes name it.
+ final seen = <String>{};
+ for (final pane in tab.panes) {
+ if (!seen.add(pane.key)) continue;
+ final machine = notifier.stateOf(pane.machineId);
+ final agent = machine?.agents
+ .where((agent) => agent.id == pane.agentId)
+ .firstOrNull;
+ vote(_TabTrait.type, _tabType(agent?.identityEngine));
+ vote(_TabTrait.project, agent?.displayProject?.label);
+ vote(_TabTrait.machine, machine?.machine.displayName ?? pane.machineId);
+ }
+ candidates[tab.id] = [
+ for (final trait in _TabTrait.values)
+ if (counts[trait]!.isNotEmpty)
+ (() {
+ // The first to reach the top count wins it: pane order breaks a tie within a trait.
+ final winner = counts[trait]!.entries.reduce(
+ (a, b) => b.value > a.value ? b : a,
+ );
+ return (trait: trait, label: winner.key, count: winner.value);
+ })(),
+ ];
+ }
+ int repetitions(_TabName name) => candidates.values
+ .where(
+ (choices) => choices.any(
+ (other) => other.trait == name.trait && other.label == name.label,
+ ),
+ )
+ .length;
+ return {
+ for (final tab in tabs)
+ tab.id: tab.nameIsCustom
+ ? tab.name
+ : candidates[tab.id]!.isEmpty
+ ? Swarm.defaultName
+ : candidates[tab.id]!.reduce((a, b) {
+ if (b.count != a.count) return b.count > a.count ? b : a;
+ return repetitions(b) < repetitions(a) ? b : a;
+ }).label,
+ };
+}
+
+/// An agent's type as a tab's name counts it, from its [Agent.identityEngine] — the desktop's:
+/// `code` for a coding engine, a harness's own name (`kicad`, not `autonomous/kicad`), and any
+/// other engine by its id (`terminal`).
+String? _tabType(String? engine) {
+ final id = engine?.trim().toLowerCase() ?? '';
+ if (id.isEmpty) return null;
+ if (isHarnessId(id)) {
+ final canonical = canonicalHarnessId(id);
+ return canonical.substring(canonical.lastIndexOf('/') + 1);
+ }
+ return isCodeEngine(id) ? 'code' : id;
}
/// Whether [agent] is on none of the desk's tabs — one opened from search or a
diff --git a/mobile/lib/phone/find_row.dart b/mobile/lib/phone/find_row.dart
index 4110247ea..f3d8361b5 100644
--- a/mobile/lib/phone/find_row.dart
+++ b/mobile/lib/phone/find_row.dart
@@ -13,7 +13,7 @@ import 'tty_controls.dart';
/// ```
/// api-fix asking
/// "Run the migration on the test db?"
-/// docs-rewrite working · 2m ⌄
+/// docs-rewrite working · 2m
/// M2:site ⑂ docs-v2
/// ```
class FindRow extends StatelessWidget {
@@ -56,15 +56,17 @@ class FindRow extends StatelessWidget {
/// Last on line 2, after a `·`: the age, or `current`.
final String? tail;
- /// `asking`, `working`, `idle`, `exited` — one word, right-aligned on line 1.
+ /// `asking`, `working`, `exited` — one word, right-aligned on line 1. Null for a harness with
+ /// nothing to say (idle), whose line 1 then ends in [stateTail] alone.
final String? state;
final Color? stateColor;
- /// After [state] on line 1, behind a `·`: the age, or `current`. On line 1 rather than as [tail],
- /// where a long folder and branch cut it off.
+ /// After [state] on line 1, behind a `·`: the age, or `current` — or on its own where there is
+ /// no [state]. On line 1 rather than as [tail], where a long folder and branch cut it off.
final String? stateTail;
- /// A control at the end of line 1, beside [state] — Find's recap toggle — centred on that line.
+ /// A control at the end of line 1, beside [state], centred on that line. No row passes one today
+ /// — Find's recap toggle, its one user, was removed (2026-09-30) — but the slot stays for the next.
///
/// ⚠️ **Over the row, not inside it.** The row lights the moment a finger rests on it
/// ([TtyTap]), and a control nested in it would light the whole row as though it were about to
@@ -161,21 +163,23 @@ class FindRow extends StatelessWidget {
overflow: TextOverflow.ellipsis,
),
),
- if (state case final state?) ...[
+ if (state != null || (stateTail ?? '').isNotEmpty) ...[
const SizedBox(width: 12),
Text.rich(
TextSpan(
children: [
- TextSpan(
- text: state,
- style: tty.style(
- color: stateColor ?? tty.faint,
- size: TtySize.meta,
+ if (state case final state?)
+ TextSpan(
+ text: state,
+ style: tty.style(
+ color: stateColor ?? tty.faint,
+ size: TtySize.meta,
+ ),
),
- ),
if (stateTail case final tail? when tail.isNotEmpty)
TextSpan(
- text: ' · $tail',
+ // Alone, without the `·` that joins it to a word — see [state].
+ text: state == null ? tail : ' · $tail',
style: tty.style(
color: tty.faint,
size: TtySize.meta,
diff --git a/mobile/lib/phone/phone_search_results.dart b/mobile/lib/phone/phone_search_results.dart
index c6f13cd23..7e372b764 100644
--- a/mobile/lib/phone/phone_search_results.dart
+++ b/mobile/lib/phone/phone_search_results.dart
@@ -11,7 +11,6 @@ import 'package:harness_mobile/state/session_preview.dart'
show SessionPreviewKey;
import 'agent_index.dart';
-import 'agent_recap.dart';
import 'desk_groups.dart';
import 'desk_tab_filter_bar.dart';
import 'find_row.dart';
@@ -113,10 +112,6 @@ class PhoneSearchResultsState extends State<PhoneSearchResults> {
/// on screen names.
String? _tabId;
- /// The rows whose recap is unfolded, by [PhoneDestination.id]. Kept across a change of tab or
- /// query, so a recap somebody opened is still open when they come back to it.
- final _unfolded = <String>{};
-
/// The order Find opened with — each row's section (needs you, recent, the one on screen,
/// paused) and place in it, by id. Held while Find is open: a harness that starts or stops
/// asking, pauses, or does something new keeps its place and only its words change, so the row
@@ -153,19 +148,21 @@ class PhoneSearchResultsState extends State<PhoneSearchResults> {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) unawaited(notifier.reachAllMachines());
});
- // No warm of the recaps here: each row asks for its own as it is built — see [_want].
+ // No warm of the previews here: each row asks for its own as it is built — see [_want].
}
/// The sessions whose rows this frame built, read once it is over — see [_want].
final _wanted = <SessionPreviewKey>{};
bool _warmScheduled = false;
- /// Asks for what [key]'s session last said, because its row is on screen or about to be.
+ /// Asks for what [key]'s session last said, because its row is on screen or about to be — what
+ /// the search matches a session's words against (`phone_search_rank.dart`), no longer drawn under
+ /// the row: the recap that was, is gone (owner, 2026-09-30).
///
/// ⚠️ **By the rows built, not the agents known.** Warming the first 32 agents by recency, as
/// this did on open, read rows in an order Find does not draw them in — needs you, the frozen
/// open order, paused last — and never reached a row past the 32nd: a list of a hundred sessions
- /// held two thirds of its recaps empty however far it was scrolled. The list is lazy, so the rows
+ /// held two thirds of its previews empty however far it was scrolled. The list is lazy, so the rows
/// built are the ones in view and the next few below; asked for top first and ahead of anything
/// already queued, they fill in in the order they are read.
///
@@ -244,7 +241,7 @@ class PhoneSearchResultsState extends State<PhoneSearchResults> {
/// The desk's tabs as the chips offer them: none off the plain list, and none where the desk has
/// no tabs or has not answered — and then no chips are drawn at all.
List<DeskTabFilter> _tabs(PhoneSearchController search) => _plain(search)
- ? deskTabFilters(widget.notifier, agentIndex(widget.notifier))
+ ? deskTabFilters(widget.notifier)
: const [];
/// The picked tab among [tabs]; null is All.
@@ -361,7 +358,7 @@ class PhoneSearchResultsState extends State<PhoneSearchResults> {
final project = search.projectMatch;
// ⚠️ **Built as they scroll in, not all at once.** Each entry makes its widget only when the
// list asks for it, so a hundred sessions cost the rows in view: their state words, their lit
- // matches, their recaps — and the read that fetches each recap ([_want]). An eager list did all
+ // matches — and the read that fetches each one's preview ([_want]). An eager list did all
// of that for every row on every rebuild, and this screen rebuilds on every preview the store
// publishes.
final items = <Widget Function()>[];
@@ -453,11 +450,15 @@ class PhoneSearchResultsState extends State<PhoneSearchResults> {
);
}
- /// One session's entry in the list: its row, and under it what the session last came to — folded
- /// away until the chevron on the row's first line unfolds it.
+ /// One session's entry in the list: its row, and a read of what the session last said for the
+ /// search to match against ([_want]).
+ ///
+ /// ⚠️ **No recap under it any more (owner, 2026-09-30).** The row used to carry a chevron that
+ /// unfolded the session's last reply beneath it; it was removed, and with it the room kept at the
+ /// end of every first line for that chevron. The read stays — the search still needs the words.
///
/// Keyed by the row's id — what [ListView.builder]'s `findChildIndexCallback` looks it up by — so
- /// a recap somebody unfolded stays with its session when a match moves it up the list.
+ /// the row keeps its element when a match moves it up the list.
Widget _session(
PhoneDestination row,
List<String> terms,
@@ -465,55 +466,22 @@ class PhoneSearchResultsState extends State<PhoneSearchResults> {
Tty tty, {
required bool selected,
}) {
- final recap = _recap(row);
- final expanded = recap != null && _unfolded.contains(row.id);
- void toggle() => setState(() {
- if (!_unfolded.remove(row.id)) _unfolded.add(row.id);
- });
+ if (row.isAgent) {
+ if (row.previewKey case final key?) _want(key);
+ }
return KeyedSubtree(
key: ValueKey(row.id),
- // A column whether or not there is a recap, so the row keeps its element when one lands.
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- mainAxisSize: MainAxisSize.min,
- children: [
- _findRow(
- row,
- terms,
- now,
- tty,
- selected: selected,
- // No chevron until there is something under it: a session still being read, or one
- // that has said nothing, has nothing to unfold. The room is kept either way.
- recapToggle: recap == null
- ? null
- : AgentRecapToggle(expanded: expanded, onToggle: toggle),
- ),
- if (recap != null)
- AgentRecap(text: recap, expanded: expanded, onToggle: toggle),
- ],
- ),
+ child: _findRow(row, terms, now, tty, selected: selected),
);
}
- /// What [row]'s session last said, or null for a row that is not a harness, or a session not yet
- /// read or that has said nothing. Asks for it as the row is drawn — see [_want].
- String? _recap(PhoneDestination row) {
- if (!row.isAgent) return null;
- final key = row.previewKey;
- if (key != null) _want(key);
- return phoneRecap(widget.notifier.sessionPreviews, key);
- }
-
- /// One harness (or command) as a Find row — see [FindRow]. A session's row keeps room at the end
- /// of its first line for [recapToggle], so every session's `idle · 25m` stands in one column.
+ /// One harness (or command) as a Find row — see [FindRow].
Widget _findRow(
PhoneDestination row,
List<String> terms,
DateTime now,
Tty tty, {
required bool selected,
- Widget? recapToggle,
}) {
final entry = row.entry;
final openable = widget.controller.canSubmit(row);
@@ -530,7 +498,6 @@ class PhoneSearchResultsState extends State<PhoneSearchResults> {
tail: external.engineLabel,
// Beside the state, as a harness row's age is.
stateTail: fzfAge(row.lastAt, now),
- accessoryRoom: AgentRecapToggle.room,
said: hit == null || hit.snippet.isEmpty || hit.field == 'name'
? null
: (lead: snippetLead(hit.field), runs: snippetRuns(hit.snippet)),
@@ -595,8 +562,6 @@ class PhoneSearchResultsState extends State<PhoneSearchResults> {
: onScreen
? 'current'
: fzfAge(entry.agent.updatedAt, now),
- accessory: recapToggle,
- accessoryRoom: AgentRecapToggle.room,
terms: terms,
selected: selected,
enabled: openable || _resuming == row.id,
@@ -643,7 +608,13 @@ class PhoneSearchResultsState extends State<PhoneSearchResults> {
};
}
- ({String word, Color color}) _stateOf(
+ /// The word at a harness row's right edge, or null for an idle one.
+ ///
+ /// ⚠️ **Idle says nothing (owner, 2026-09-30).** It is what a harness is when none of the words
+ /// above apply — most of the list, most of the time — so `idle` stood on nearly every row and
+ /// said nothing any of them needed saying, while the words that DO ask for something (`asking`,
+ /// `done`, `exited`) were lost among them. The row keeps its age (`1h`) in that place.
+ ({String? word, Color color}) _stateOf(
AgentEntry entry,
bool openable,
Tty tty, {
@@ -661,7 +632,7 @@ class PhoneSearchResultsState extends State<PhoneSearchResults> {
agentId: entry.agent.id,
));
if (unread == NoticeKind.done) return (word: 'done', color: tty.faint);
- return (word: 'idle', color: tty.faint);
+ return (word: null, color: tty.faint);
}
/// Where a project lives, for `+ New Harness in <project>`: its machine and folder, read from the
diff --git a/mobile/lib/phone/team_page.dart b/mobile/lib/phone/team_page.dart
index f0bf3f53d..3776b46ac 100644
--- a/mobile/lib/phone/team_page.dart
+++ b/mobile/lib/phone/team_page.dart
@@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import '../state/app_state.dart';
+import '../state/swarm.dart';
import '../teams/team_controller.dart';
import 'desk_groups.dart';
import 'phone_header.dart';
@@ -65,7 +66,8 @@ class TeamPage extends StatelessWidget {
),
),
child: Text(
- deskTabName(tab, null),
+ deskTabNames(notifier)[tab.id] ??
+ Swarm.defaultName,
style: Tty.of(context).style(),
),
),
diff --git a/mobile/lib/state/app_state.dart b/mobile/lib/state/app_state.dart
index 27a5574c2..5a422962a 100644
--- a/mobile/lib/state/app_state.dart
+++ b/mobile/lib/state/app_state.dart
@@ -282,9 +282,9 @@ class AppNotifier extends ChangeNotifier {
/// phone pays for the bytes, and the live events already keep a connected
/// machine's agents current.
///
- /// Four reads out at once, not the desktop's two: Find draws a recap under every row and reads
- /// them as the rows come into view, and each read is one small relay round trip — two at a time
- /// left a screenful of rows waiting on the latency rather than on the bytes.
+ /// Four reads out at once, not the desktop's two: Find reads them as its rows come into view, so
+ /// its search can match what each session said, and each read is one small relay round trip —
+ /// two at a time left a screenful of rows waiting on the latency rather than on the bytes.
late final sessionPreviews = SessionPreviewStore(
canFetch: _canFetchPreview,
freshFor: const Duration(minutes: 5),
@@ -1897,6 +1897,8 @@ class AppNotifier extends ChangeNotifier {
// The model sheet's sentence under a Local model.
prev.gridWebSearch != agent.gridWebSearch ||
prev.selectedModel != agent.selectedModel ||
+ // What a tab's name votes with — see `identityEngine`.
+ prev.dsh != agent.dsh ||
prev.dshName != agent.dshName ||
prev.sessionId != agent.sessionId ||
prev.engine != agent.engine ||
diff --git a/mobile/lib/widgets/engine_identity.dart b/mobile/lib/widgets/engine_identity.dart
index 1d12118e4..ef1095a28 100644
--- a/mobile/lib/widgets/engine_identity.dart
+++ b/mobile/lib/widgets/engine_identity.dart
@@ -108,6 +108,38 @@ const _engines = <String, EngineIdentity>{
/// All known engines, in declaration order — for the New Agent engine picker.
List<EngineIdentity> get allEngines => _engines.values.toList(growable: false);
+/// Whether [id] names a domain-specific harness rather than an engine — the desktop's
+/// `isHarnessId`. The slash is the tell: engine ids are bare words, harness ids are `owner/name`.
+bool isHarnessId(String? id) => id != null && id.contains('/');
+
+/// Whether [engine] is a coding engine — the desktop's `category: 'Code'`.
+///
+/// ⚠️ **Every engine in [_engines] is one**, as every engine in the desktop's own table is (the
+/// same fourteen, claude to agy); it is the harnesses that carry other categories, and those are
+/// told apart by [isHarnessId]. An engine added here that does not write code has to be excluded
+/// by name, or a tab of it would be called `code`.
+bool isCodeEngine(String? engine) =>
+ _engines.containsKey(engine?.trim().toLowerCase());
+
+/// Harness ids that were renamed, to the id each goes by now — the desktop's `retiredHarnessIds`
+/// (`core/harness_catalog.dart`), copied as it stands, so an agent made from an old id is named
+/// by its current one on both.
+const _retiredHarnessIds = <String, String>{
+ 'local/ollama': 'autonomous/ollama',
+ 'local/mlx-lm': 'autonomous/mlx-lm',
+ 'local/vllm': 'autonomous/vllm',
+ 'autonomous/copper': 'autonomous/autonomous-circuit',
+ 'autonomous/circuit': 'autonomous/autonomous-circuit',
+ 'autonomous/solder': 'autonomous/kicad',
+ 'autonomous/machines': 'autonomous/machine-monitor',
+ 'autonomous/toymaker': 'autonomous/autonomous-workshop',
+ 'autonomous/solid': 'autonomous/autonomous-workshop',
+ 'autonomous/workshop': 'autonomous/autonomous-workshop',
+};
+
+/// [id] as the harness goes by now — see [_retiredHarnessIds].
+String canonicalHarnessId(String id) => _retiredHarnessIds[id] ?? id;
+
EngineIdentity engineIdentity(String? engine, {String? displayName}) {
final id = engine?.trim().toLowerCase() ?? '';
final known = _engines[id];