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.

fix(mobile): stop promising needs-you notifications

tonyf425cc6161a5
diff --git a/mobile/lib/notify/system_notices.dart b/mobile/lib/notify/system_notices.dart
index 5872b6565..a88c26f2d 100644
--- a/mobile/lib/notify/system_notices.dart
+++ b/mobile/lib/notify/system_notices.dart
@@ -76,6 +76,16 @@ Future<bool?> noticesEnabled(SystemNotices notices) =>
? notices.enabled()
: Future<bool?>.value(null);
+/// What the phone's notices are about, in the words Settings ▸ Notifications and Focus's tips use —
+/// one source, so the two never promise different things.
+///
+/// ⚠️ **Not "when a harness needs you"** (2026-10-14). That notice ([NoticeKind.question]) is fed
+/// by `commander_question`, which the daemon sends only to the dial and to its own computer
+/// (`cli/src/core/questions.ts`: `sendCommander`, `sendLocal`) — never to a phone over the relay.
+/// What does reach one is a turn's end and a device joining the account. Say questions again here
+/// once that frame is carried to phones.
+const noticesWhen = 'a harness finishes, or a new device joins your account';
+
/// What a device notice's payload starts with; the device's key follows. An agent notice's payload
/// is `machine\nagent`, so the two never read as each other.
const _devicePayload = 'device:';
diff --git a/mobile/lib/phone/settings_page.dart b/mobile/lib/phone/settings_page.dart
index e0646c2ed..87bafb89a 100644
--- a/mobile/lib/phone/settings_page.dart
+++ b/mobile/lib/phone/settings_page.dart
@@ -511,8 +511,8 @@ class _VoiceLanguageRow extends StatelessWidget {
);
}
-/// Whether this phone may notify — a harness asking something while the app is away, a new device
-/// on the account — and the way to turn it on.
+/// Whether this phone may notify — a harness finishing while the app is away, a new device on the
+/// account ([noticesWhen]) — and the way to turn it on.
///
/// ⚠️ **The way back.** The OS asks once by itself, as the first terminal's tips go
/// (`terminal_page.dart`). A "Don't Allow" there had no way back from inside the app, and the device
@@ -588,7 +588,7 @@ class _NotificationsRowState extends State<_NotificationsRow>
return SettingsRow(
key: const ValueKey('settings-notifications'),
title: 'Notifications',
- detail: 'When a harness needs you, or a new device joins your account.',
+ detail: 'When $noticesWhen.',
value: switch (_on) {
true => 'On',
false => 'Off',
diff --git a/mobile/lib/phone/welcome/focus_hints.dart b/mobile/lib/phone/welcome/focus_hints.dart
index 2ebf05e8f..6661cf60b 100644
--- a/mobile/lib/phone/welcome/focus_hints.dart
+++ b/mobile/lib/phone/welcome/focus_hints.dart
@@ -6,6 +6,7 @@ import 'package:flutter/services.dart';
import 'package:harness_mobile/core/harness_file_store.dart';
import 'package:harness_mobile/core/local_key_value_store.dart';
+import 'package:harness_mobile/notify/system_notices.dart' show noticesWhen;
import '../tty.dart';
import '../tty_controls.dart';
@@ -213,8 +214,7 @@ class _FocusHintsState extends State<FocusHints> {
if (widget.onDone != null) ...[
const SizedBox(height: 28),
Text(
- 'Notifications tell you when a harness needs you, '
- 'and when a new device joins your account.',
+ 'Notifications tell you when $noticesWhen.',
textAlign: TextAlign.center,
style: tty.style(
size: TtySize.meta,
diff --git a/mobile/test/phone_edge/settings_behavior_test.dart b/mobile/test/phone_edge/settings_behavior_test.dart
index a11937af3..330660830 100644
--- a/mobile/test/phone_edge/settings_behavior_test.dart
+++ b/mobile/test/phone_edge/settings_behavior_test.dart
@@ -129,6 +129,33 @@ void main() {
await close(tester, app);
});
+ // ⚠️ A phone over the relay never hears a question — `commander_question` goes to the dial and the
+ // computer's own window only — so the row promises what does reach it, and nothing else.
+ testWidgets('Notifications: a harness finishing, a new device — never "needs you"', (
+ tester,
+ ) async {
+ final app = await openSettings(tester);
+ final row = find.byKey(const ValueKey('settings-notifications'));
+ if (row.evaluate().isEmpty) {
+ await tester.scrollUntilVisible(
+ row,
+ 200,
+ scrollable: find.byType(Scrollable).first,
+ );
+ }
+ expect(
+ find.descendant(
+ of: row,
+ matching: find.text(
+ 'When a harness finishes, or a new device joins your account.',
+ ),
+ ),
+ findsOneWidget,
+ );
+ expect(find.textContaining('needs you'), findsNothing);
+ await close(tester, app);
+ });
+
testWidgets('an account whose name is only an email, or nothing at all', (
tester,
) async {
diff --git a/mobile/test/phone_edge/welcome_behavior_test.dart b/mobile/test/phone_edge/welcome_behavior_test.dart
index efb00d82c..9b1d32346 100644
--- a/mobile/test/phone_edge/welcome_behavior_test.dart
+++ b/mobile/test/phone_edge/welcome_behavior_test.dart
@@ -317,6 +317,43 @@ void main() {
},
);
+ // ⚠️ The OS's notification prompt follows them, so they say what a notice is for — and only what
+ // reaches a phone: a question never does (`commander_question` goes to the dial and the
+ // computer's own window only).
+ testWidgets(
+ 'before the notification prompt: a harness finishing, a new device — never "needs you"',
+ (tester) async {
+ setPhone(tester, largePhone);
+ Widget hints({VoidCallback? onDone}) => phoneApp(
+ FocusHints(
+ micBottom: 60,
+ store: FocusHintsSeen(
+ storage: MemoryKeyValueStore()
+ ..values['phone_focus_hints_v1'] = 'again',
+ ),
+ onDone: onDone,
+ ),
+ );
+ await tester.pumpWidget(hints(onDone: () {}));
+ await frames(tester);
+ expect(find.text('→ swipe right'), findsOneWidget);
+ expect(
+ find.text(
+ 'Notifications tell you when a harness finishes, or a new device joins your account.',
+ ),
+ findsOneWidget,
+ );
+ expect(find.textContaining('needs you'), findsNothing);
+
+ // No prompt after them: no line about notices either.
+ await tester.pumpWidget(const SizedBox());
+ await tester.pumpWidget(hints());
+ await frames(tester);
+ expect(find.text('→ swipe right'), findsOneWidget);
+ expect(find.textContaining('Notifications'), findsNothing);
+ },
+ );
+
test('nothing stored is put away; asked for, they come back; a store that fails never nags', () async {
final storage = MemoryKeyValueStore();
final seen = FocusHintsSeen(storage: storage);
diff --git a/mobile/test/phone_edge/welcome_layout_test.dart b/mobile/test/phone_edge/welcome_layout_test.dart
index 292be1fc6..f4d299515 100644
--- a/mobile/test/phone_edge/welcome_layout_test.dart
+++ b/mobile/test/phone_edge/welcome_layout_test.dart
@@ -212,6 +212,8 @@ void main() {
color: Tty.of(context).ground,
child: FocusHints(
micBottom: 34 + 4 + 30,
+ // As the terminal has them: the notification prompt after, and its line with them.
+ onDone: () {},
store: FocusHintsSeen(
storage: MemoryKeyValueStore()
..values['phone_focus_hints_v1'] = 'again',