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.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
fix(desktop): start the experimental creature with an egg (#421)
Deeadeb4a42cfd7
diff --git a/desktop/design/daemons.md b/desktop/design/daemons.mdindex 985c4a2e1..1f24a2574 100644--- a/desktop/design/daemons.md+++ b/desktop/design/daemons.md@@ -28,8 +28,8 @@ existed, exactly:### Experimental focus-bar creature-Open **Settings → Experimental → Focus-bar creature** to show a test tim at-the focus bar beside Share. Switch it off there to hide the creature, its+Open **Settings → Experimental → Focus-bar creature** to start with an egg in+the focus bar. Switch it off there to hide the creature, itspanel and any hatch. The activation shortcut has been removed entirely,including its command and native Mac binding. The switch works by mouse orkeyboard and leaves focus in Settings.@@ -40,8 +40,10 @@ its choice on this computer (`experimental.focus_bar_creature`). The store isloaded before the first frame, so a saved choice takes effect at launch.The preview works even while the server rollout is off. The window gets a-separate in-memory collection with tim and one ready turn egg. Click the-creature to open its panel; open the egg there to test hatching and naming.+separate, empty in-memory collection. The first egg cracks as habits are+completed: a finished turn and any two other habits make it ready. Click the+egg to see progress; once ready, click to hatch and name the new companion.+Earning an egg never hatches it automatically or preselects its species.Only turns finishing after activation count toward preview progress. Hide/showkeeps that window's collection; closing the window discards it. Motion, Quietand the panel tab also stay temporary. There is no collection upload, guestdiff --git a/desktop/lib/daemons/zoo_controller.dart b/desktop/lib/daemons/zoo_controller.dartindex fb3a9f714..6831c7a12 100644--- a/desktop/lib/daemons/zoo_controller.dart+++ b/desktop/lib/daemons/zoo_controller.dart@@ -328,27 +328,11 @@ class ZooController extends ChangeNotifier {Future<void> _load(int generation) async {if (isPreview) {- final at = _now().toUtc().toIso8601String();_source = ZooSource.preview;_hintSeen = true;- _show(- _previewZoo ??= Zoo(- daemons: [- ZooDaemon(- uid: 'preview-tim',- id: 'tim',- hatched: at,- egg: 'first',- version: '1.0',- xp: 150,- ),- ],- pair: 'preview-tim',- firstEgg: true,- eggs: [ZooEgg(id: 'preview-egg', kind: 'turn', grantedAt: at)],- ),- baseline: true,- );+ // Start with the same unhatched egg as a new collection. The preview+ // earns its first hatch through habits; it never preselects a creature.+ _show(_previewZoo ??= Zoo.empty, baseline: true);return;}if (_remote == null) {diff --git a/desktop/lib/settings/experimental_features.dart b/desktop/lib/settings/experimental_features.dartindex eee7bc639..d8c139646 100644--- a/desktop/lib/settings/experimental_features.dart+++ b/desktop/lib/settings/experimental_features.dart@@ -10,7 +10,7 @@ enum ExperimentalFeature {focusBarCreature('focus_bar_creature','Focus-bar creature',- 'Try a small companion in the focus bar, with an egg ready to hatch. '+ 'Start with an egg in the focus bar. Work toward hatching your companion. ''Its test collection resets when you close the window.',),shareButton(diff --git a/desktop/test/daemon_off_test.dart b/desktop/test/daemon_off_test.dartindex d419fb3d9..a39ff06e8 100644--- a/desktop/test/daemon_off_test.dart+++ b/desktop/test/daemon_off_test.dart@@ -171,7 +171,9 @@ void main() {await tester.pump(const Duration(seconds: 1));expect(tester.widget<Switch>(experimentSwitch).value, isTrue);expect(zoo.isPreview, isTrue);- expect(zoo.paired!.id, 'tim');+ expect(zoo.paired, isNull);+ expect(zoo.zoo.daemons, isEmpty);+ expect(zoo.readyEgg, isNull);expect(find.byType(SettingsScreen), findsOneWidget);expect(app.activeSwarmId, tab);expect(frames, isEmpty);@@ -200,12 +202,75 @@ void main() {},);+ testWidgets(+ 'the experimental egg earns its first hatch from workspace activity',+ (tester) async {+ await mount(tester);+ await setPreview(tester, true);+ String glyph() => tester+ .widget<Text>(find.byKey(const ValueKey('daemon-slot-glyph')))+ .data!+ .trim();+ expect(glyph(), r'\_( )_/');+ expect(zoo.zoo.daemons, isEmpty);++ app.adoptSessionForTest(terminal('a0', []));+ await app.handleMachineEventForTest('m', {+ 'type': 'turn_ended',+ 'agentId': 'a0',+ });+ await tester.pump();+ expect(glyph(), r'\_(/\)_/');+ app.adoptSessionForTest(terminal('a1', []));+ app.notifyListeners();+ await tester.pump();+ expect(glyph(), r"\_(*')_/");+ app.stateOf('m')!.resumedHarnesses = 1;+ app.notifyListeners();+ await tester.pump();+ expect(zoo.readyEgg!.kind, 'first');+ expect(glyph(), r'\_(oo)_/');+ expect(zoo.paired, isNull, reason: 'the user must open the egg');++ await tester.tap(slot);+ await tester.pump();+ expect(find.byKey(const ValueKey('daemon-hatch')), findsOneWidget);+ expect(glyph(), r'\_(oo)_/', reason: 'no creature before the reveal');+ final card = find.byKey(const ValueKey('daemon-hatch-card'));+ for (var i = 0; i < 180 && card.evaluate().isEmpty; i++) {+ await tester.pump(const Duration(milliseconds: 100));+ }+ expect(card, findsOneWidget);+ expect(zoo.zoo.daemons, hasLength(1));+ expect(zoo.paired!.version, '0.1');+ expect(glyph(), isNot(r'\_(oo)_/'));+ await tester.enterText(+ find.byKey(const ValueKey('daemon-hatch-name')),+ 'Pip',+ );+ final saveName = find.byKey(const ValueKey('daemon-hatch-name-save'));+ await tester.ensureVisible(saveName);+ await tester.tap(saveName);+ await tester.pump();+ expect(zoo.paired!.name, 'Pip');+ expect(find.byKey(const ValueKey('daemon-hatch-next')), findsNothing);+ expect(frames, isEmpty);+ expect(remote.batches, isEmpty);+ expect(tester.takeException(), isNull);+ await unmount(tester);+ },+ );+testWidgets('the saved switch survives a new window but the test collection does not',(tester) async {await mount(tester);await setPreview(tester, true);- expect(zoo.nickname('preview-tim', 'Window one'), isTrue);+ for (final habit in ['turn', 'split', 'find']) {+ zoo.habit(habit);+ }+ final hatch = (await zoo.hatch(zoo.readyEgg!.id))!;+ expect(zoo.nickname(hatch.uid!, 'Window one'), isTrue);await tester.pump();expect(zoo.paired!.name, 'Window one');await unmount(tester);@@ -216,8 +281,9 @@ void main() {await tester.pump(const Duration(seconds: 1));expect(slot, findsOneWidget);expect(zoo.isPreview, isTrue);- expect(zoo.paired!.name, isNot('Window one'));- expect(zoo.zoo.eggs, hasLength(1));+ expect(zoo.paired, isNull);+ expect(zoo.zoo.daemons, isEmpty);+ expect(zoo.readyEgg, isNull);await setPreview(tester, false);await unmount(tester);experiments.dispose();@@ -260,10 +326,13 @@ void main() {) async {await mount(tester);await setPreview(tester, true);- await tester.tap(slot);+ for (final habit in ['turn', 'split', 'find']) {+ zoo.habit(habit);+ }await tester.pump();- await tester.tap(find.byKey(const ValueKey('daemon-egg:turn')));+ await tester.tap(slot);await tester.pump();+ expect(find.byKey(const ValueKey('daemon-hatch')), findsOneWidget);await setPreview(tester, false);expect(slot, findsNothing);expect(find.byKey(const ValueKey('daemon-panel')), findsNothing);@@ -340,11 +409,12 @@ void main() {isNot(contains('app.daemon_preview')),);await setPreview(tester, true);- expect(zoo.paired!.id, 'tim');+ expect(zoo.paired, isNull);final updates = calls.where((c) => c.method == 'update');final daemon = (updates.last.arguments as Map)['daemon'] as Map;expect(daemon['visible'], isTrue);- expect(daemon['glyph'], isNotEmpty);+ expect(daemon['glyph'], r'\_( )_/');+ expect(daemon['label'], 'Egg');expect(daemon['tooltip'], contains('Settings → Experimental'));await setPreview(tester, false);expect(zoo.loaded, isFalse);diff --git a/desktop/test/daemons/zoo_preview_test.dart b/desktop/test/daemons/zoo_preview_test.dartindex 4aff03f73..7aa68aeae 100644--- a/desktop/test/daemons/zoo_preview_test.dart+++ b/desktop/test/daemons/zoo_preview_test.dart@@ -23,7 +23,7 @@ class _NoStorage implements LocalKeyValueStore {}void main() {- test('preview hatches, names, pairs and earns only in memory', () async {+ test('preview starts with an egg, then earns and hatches only in memory', () async {final storage = _NoStorage();final zoo = ZooController(storage: storage,@@ -33,9 +33,28 @@ void main() {addTearDown(zoo.dispose);zoo.showPreview();expect(zoo.source, ZooSource.preview);- expect(zoo.paired!.id, 'tim');+ expect(zoo.zoo.daemons, isEmpty);+ expect(zoo.paired, isNull);+ expect(zoo.readyEgg, isNull);+ expect(zoo.nearestEgg!.kind, 'first');+ expect(zoo.nearestEgg!.stage, 'p0');expect(zoo.needsHint, isFalse);+ zoo.habit('split');+ expect(zoo.nearestEgg!.stage, 'p2');+ zoo.habit('find');+ expect(zoo.nearestEgg!.stage, 'p3');+ expect(zoo.readyEgg, isNull, reason: 'a finished turn is required');+ zoo.bind(null);+ zoo.showPreview();+ expect(zoo.nearestEgg!.stage, 'p3', reason: 'hide/show keeps egg progress');+ expect(zoo.readyEgg, isNull);+ zoo.habit('turn');+ expect(zoo.readyEgg!.kind, 'first');+ expect(zoo.nearestEgg!.stage, 'p4');+ expect(zoo.paired, isNull, reason: 'earning the egg never hatches it');final hatch = (await zoo.hatch(zoo.readyEgg!.id))!;+ expect(zoo.zoo.daemons, hasLength(1));+ expect(zoo.paired!.version, '0.1');expect(zoo.nickname(hatch.uid!, 'Pip'), isTrue);zoo.pair(hatch.uid!);zoo.recordTurns(3, machineId: 'fixture');@@ -57,8 +76,10 @@ void main() {final another = ZooController(storage: storage);addTearDown(another.dispose);another.showPreview();- expect(another.zoo.daemons, hasLength(1));- expect(another.paired!.id, 'tim', reason: 'a new window starts fresh');+ expect(another.zoo.daemons, isEmpty);+ expect(another.paired, isNull, reason: 'a new window starts with an egg');+ expect(another.readyEgg, isNull);+ expect(another.nearestEgg!.stage, 'p0');// Switching to a real account can never upload the preview as a guest seed.final remote = FakeZooTransport();@@ -78,12 +99,15 @@ void main() {addTearDown(zoo.dispose);zoo.bind('account:test', remote: remote);zoo.showPreview();+ zoo.habit('split');gate.complete();await Future<void>.delayed(Duration.zero);zoo.refresh();zoo.pushed(999);expect(zoo.isPreview, isTrue);- expect(zoo.paired!.uid, 'preview-tim');+ expect(zoo.paired, isNull);+ expect(zoo.zoo.habits, ['split']);+ expect(zoo.nearestEgg!.stage, 'p2');expect(remote.fetches, 1);expect(remote.batches, isEmpty);});diff --git a/docs/research/2026-09-27-daemons-handoff.md b/docs/research/2026-09-27-daemons-handoff.mdindex 455a2760f..204a7a45f 100644--- a/docs/research/2026-09-27-daemons-handoff.md+++ b/docs/research/2026-09-27-daemons-handoff.md@@ -21,6 +21,15 @@ phone and hn release steps, and the server allowlist, remain separate work.The Experimental preview needs none of them: it uses a window-only testcollection, defaults off, and sends no creature or brain frames.+The first desktop release, `1.2.16`, shipped the preview with a pre-hatched tim.+The egg-first correction removes that seed: a new preview now starts with an+unhatched egg, follows the existing habit rules, and reveals a creature only+when the user opens the earned egg. The on/off setting still persists and the+collection still lives only for the window. Validation: 203 focused creature,+workspace and settings tests, six real-font render checks, and targeted Dart+analysis pass. The workspace regression exercises the whole egg → habits →+explicit hatch → reveal → name flow with synthetic activity.+Integration preserves current main's Share action, API models, account andterminal fixes, strict question matching, trust groups and E2EE core. Thedisabled-creature layout reference was measured independently on main@@ -159,8 +168,10 @@ On the desktop branch, open **Settings → Experimental → Focus-bar creature**This replaces the hidden activation shortcut; that binding and command areremoved. Experimental is the shared home for future feature toggles. Theswitch saves its choice on this computer and applies it before the first frame.-It works signed in or out with no server rollout. It starts with tim and a-ready turn egg; the panel supports hatching, naming, pairing and temporary+It works signed in or out with no server rollout. It starts with an unhatched+egg, earned through the normal first-egg habits (a finished turn and any two+others), then opened explicitly. No creature is preselected. The panel+supports hatching, naming, pairing and temporarymotion/quiet settings. Only the on/off preference persists: the test collectionclears on window close, is never uploaded, and sends no creature/brain frames.Individual artwork uses the bundled fallback. The old Account preview switch