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
Overlap agent discovery after machine readiness
dee7e19ceae703f
diff --git a/desktop/lib/state/app_state.dart b/desktop/lib/state/app_state.dartindex 79169d0fb..1b0b94805 100644--- a/desktop/lib/state/app_state.dart+++ b/desktop/lib/state/app_state.dart@@ -118,6 +118,7 @@ class MachineState {bool agentsRefreshing = false;String? agentsLoadError;Future<void>? agentsLoadInFlight;+ Future<void>? terminalCapabilityLoadInFlight;String? activeAgentId;bool terminalCapabilityLoaded = false;bool terminalCapabilityAvailable = false;@@ -2856,11 +2857,26 @@ class AppNotifier extends ChangeNotifier {machine.agentsLoadError = null;notifyListeners();final connection = _conn(machine.machine.machineId);+ final deadline = Stopwatch()..start();debugPrint('agents_list start: ${machine.machine.machineId}');try {+ const inventoryTimeout = Duration(seconds: 10);+ await connection.waitUntilReady(timeout: inventoryTimeout);+ if (!_machineWorkCurrent(machine, revision)) return;+ // Keep the inventory's existing total budget, including connection time.+ // Capabilities get their own budget only once the handshake is complete.+ final remaining = inventoryTimeout - deadline.elapsed;+ if (remaining <= Duration.zero) {+ throw const WsRequestTimeout('agents_list');+ }+ final capabilities = _loadTerminalCapabilities(+ machine,+ connection,+ revision,+ );final response = await connection.request('agents_list',- timeout: const Duration(seconds: 10),+ timeout: remaining,);if (!_machineWorkCurrent(machine, revision)) return;final agents = (response['agents'] as List<dynamic>? ?? [])@@ -2874,7 +2890,15 @@ class AppNotifier extends ChangeNotifier {'agents_list success: ${machine.machine.machineId} ''(${machine.agents.length} agents)',);- await _loadTerminalCapabilities(machine, connection, revision);+ // Publish discovery immediately. The capability loader attaches waiting+ // panes when its reply arrives; either response may finish first.+ if (machine.terminalCapabilityLoadInFlight == null) {+ _attachPendingPanes(machine);+ _autoPickFirstAgent();+ }+ notifyListeners();+ await capabilities;+ return;} catch (error) {if (!_machineWorkCurrent(machine, revision)) return;machine.agentsRefreshing = false;@@ -3009,6 +3033,27 @@ class AppNotifier extends ChangeNotifier {MachineState machine,WsConn connection,int revision,+ ) {+ final pending = machine.terminalCapabilityLoadInFlight;+ if (pending != null) return pending;+ late final Future<void> load;+ load = _readTerminalCapabilities(+ machine,+ connection,+ revision,+ ).whenComplete(() {+ if (identical(machine.terminalCapabilityLoadInFlight, load)) {+ machine.terminalCapabilityLoadInFlight = null;+ }+ });+ machine.terminalCapabilityLoadInFlight = load;+ return load;+ }++ Future<void> _readTerminalCapabilities(+ MachineState machine,+ WsConn connection,+ int revision,) async {try {final result = await connection.request(@@ -3044,6 +3089,13 @@ class AppNotifier extends ChangeNotifier {machine.terminalPasteFileAvailable = false;machine.mediaPreviewAvailable = false;}+ if (!_machineWorkCurrent(machine, revision)) return;+ if (machine.agentLoadStatus != AgentLoadStatus.loading &&+ !machine.agentsRefreshing) {+ _attachPendingPanes(machine);+ _autoPickFirstAgent();+ notifyListeners();+ }}void _replaceAgents(MachineState machine, List<Agent> agents) {diff --git a/desktop/lib/ws/ws_conn.dart b/desktop/lib/ws/ws_conn.dartindex 024a7f25e..255dc4c20 100644--- a/desktop/lib/ws/ws_conn.dart+++ b/desktop/lib/ws/ws_conn.dart@@ -101,12 +101,40 @@ class WsConn {String? _tokenUsed;bool _forceRelayReconnect = false;final _pending = <String, _PendingRpc>{};+ final _readinessWaiters = <Completer<void>>{};final _queue = <Map<String, dynamic>>[];Future<void> _outboundTail = Future<void>.value();Future<void> _inboundTail = Future<void>.value();bool get isReady => _ready && _channel != null;+ /// Wait for this machine's handshake without queuing a request or changing+ /// its timeout. Callers can then start independent RPCs with their own budgets.+ Future<void> waitUntilReady({required Duration timeout}) {+ if (isReady) return Future<void>.value();+ if (_closing) return Future<void>.error(StateError('WS closed'));+ final ready = Completer<void>();+ _readinessWaiters.add(ready);+ return ready.future+ .timeout(+ timeout,+ onTimeout: () => throw const WsRequestTimeout('machine_select'),+ )+ .whenComplete(() => _readinessWaiters.remove(ready));+ }++ void _settleReadiness([String? failure]) {+ final waiters = _readinessWaiters.toList();+ _readinessWaiters.clear();+ for (final waiter in waiters) {+ if (failure == null) {+ waiter.complete();+ } else {+ waiter.completeError(StateError(failure));+ }+ }+ }+/// True once this connection has permanently given up (a deliberate [close], or a non-retryable/// local failure like NO_PEER_LINK) — [WsPool] must not hand a closed connection back out.bool get isClosed => _closing;@@ -219,6 +247,7 @@ class WsConn {_attempt = 0;onStatus(ConnectionStatus.connected);_flushQueue();+ _settleReadiness();}return;}@@ -514,6 +543,7 @@ class WsConn {}void _rejectPending(String reason) {+ _settleReadiness(reason);for (final pending in _pending.values) {pending.timer.cancel();if (!pending.completer.isCompleted) {diff --git a/desktop/test/machine_loading_test.dart b/desktop/test/machine_loading_test.dartnew file mode 100644index 000000000..15be02e9e--- /dev/null+++ b/desktop/test/machine_loading_test.dart@@ -0,0 +1,261 @@+import 'dart:async';++import 'package:flutter_test/flutter_test.dart';+import 'package:harness/auth/auth_session.dart';+import 'package:harness/core/config.dart';+import 'package:harness/core/models.dart';+import 'package:harness/state/app_state.dart';+import 'package:harness/state/terminal_pane.dart';+import 'package:harness/ws/ws_conn.dart';++const _machine = Machine(+ machineId: 'm',+ name: 'Fixture computer',+ authMode: MachineAuthMode.remote,+ status: 'online',+);++const _agents = {+ 'agents': [+ {+ 'id': 'a',+ 'name': 'Fixture agent',+ 'engine': 'codex',+ 'terminal': {+ 'runtimes': [+ {'backend': 'tmux', 'paneId': '%1'},+ ],+ },+ },+ ],+};+const _capabilities = {+ 'protocolVersion': 3,+ 'backend': 'tmux',+ 'available': true,+};++class _Connection extends WsConn {+ _Connection()+ : super(+ wsBaseUrl: 'ws://fixture.invalid',+ autonomousEnv: 'test',+ machineId: 'm',+ accessTokenProvider: (_, _) async => '',+ onAuthFailure: (_) {},+ onEvent: (_) {},+ onStatus: (_) {},+ );++ final calls = <String>[];+ final agents = <Completer<Map<String, dynamic>>>[];+ final capabilities = <Completer<Map<String, dynamic>>>[];+ final timeouts = <String, Duration>{};+ final sent = <String>[];+ Completer<void>? readiness;++ @override+ Future<void> waitUntilReady({required Duration timeout}) async {+ await readiness?.future;+ }++ @override+ Future<Map<String, dynamic>> request(+ String type, {+ Map<String, dynamic> payload = const {},+ Duration timeout = const Duration(seconds: 20),+ }) {+ calls.add(type);+ timeouts[type] = timeout;+ final response = Completer<Map<String, dynamic>>();+ switch (type) {+ case 'agents_list':+ agents.add(response);+ case 'terminal_capabilities':+ capabilities.add(response);+ default:+ throw StateError('Unexpected request: $type');+ }+ return response.future;+ }++ @override+ Future<bool> sendTerminalFrame(+ String type,+ Map<String, dynamic> payload,+ ) async {+ sent.add(type);+ return true;+ }+}++Future<void> _tick() => Future<void>.delayed(Duration.zero);++void main() {+ TestWidgetsFlutterBinding.ensureInitialized();+ late AppNotifier app;+ late MachineState machine;+ late _Connection connection;++ setUp(() {+ connection = _Connection();+ app = AppNotifier(+ config: AppConfig.dev,+ authSession: AuthSession(),+ connectionForTest: (_) => connection,+ )..status = AppStatus.authenticated;+ machine = MachineState(_machine)..nodeOnline = true;+ app.machines = [_machine];+ app.machineStates['m'] = machine;+ });+ tearDown(() => app.dispose());++ test('agent inventory and capabilities are requested together', () async {+ final load = app.reloadMachineData('m');+ await _tick();+ final capabilitiesStarted = connection.capabilities.isNotEmpty;+ connection.agents.single.complete(_agents);+ await _tick();+ connection.capabilities.single.complete(_capabilities);+ await load;+ expect(capabilitiesStarted, isTrue);+ expect(machine.agents.single.id, 'a');+ expect(machine.terminalCapabilityAvailable, isTrue);+ });++ test('agents become visible before a slow capability response', () async {+ var sawAgents = false;+ app.addListener(() {+ if (machine.agents.isNotEmpty) sawAgents = true;+ });+ final load = app.reloadMachineData('m');+ await _tick();+ connection.agents.single.complete(_agents);+ await _tick();+ final visibleBeforeCapabilities = sawAgents;+ connection.capabilities.single.complete(_capabilities);+ await load;+ expect(visibleBeforeCapabilities, isTrue);+ expect(machine.agentLoadStatus, AgentLoadStatus.loaded);+ });++ test('handshake time stays inside the existing inventory budget', () async {+ connection.readiness = Completer<void>();+ final load = app.reloadMachineData('m');+ await Future<void>.delayed(const Duration(milliseconds: 5));+ expect(connection.calls, isEmpty);+ connection.readiness!.complete();+ await _tick();+ expect(connection.calls, ['terminal_capabilities', 'agents_list']);+ expect(+ connection.timeouts['agents_list']!,+ lessThan(const Duration(seconds: 10)),+ );+ expect(connection.timeouts['agents_list']!, greaterThan(Duration.zero));+ expect(+ connection.timeouts['terminal_capabilities'],+ const Duration(seconds: 8),+ );+ connection.agents.single.complete(_agents);+ connection.capabilities.single.complete(_capabilities);+ await load;+ });++ test('repeated reloads share both pending discovery requests', () async {+ final first = app.reloadMachineData('m');+ final second = app.reloadMachineData('m');+ await _tick();+ expect(connection.agents, hasLength(1));+ expect(connection.capabilities, hasLength(1));+ connection.agents.single.complete(_agents);+ connection.capabilities.single.complete(_capabilities);+ await Future.wait([first, second]);+ expect(machine.agentsLoadInFlight, isNull);+ expect(machine.terminalCapabilityLoadInFlight, isNull);+ });++ for (final agentsFirst in [true, false]) {+ test(+ 'restored agent attaches once with ${agentsFirst ? 'agents' : 'capabilities'} first',+ () async {+ final pane = TerminalPane(id: 99, machineId: 'm', agentId: 'a');+ app.activeSwarm.panes.add(pane);+ final focus = app.focusedPaneId;+ final load = app.reloadMachineData('m');+ await _tick();+ if (agentsFirst) {+ connection.agents.single.complete(_agents);+ } else {+ connection.capabilities.single.complete(_capabilities);+ }+ await _tick();+ expect(pane.session, isNull);+ if (agentsFirst) {+ connection.capabilities.single.complete(_capabilities);+ } else {+ connection.agents.single.complete(_agents);+ }+ await load;+ await _tick();+ expect(pane.session, isNotNull);+ pane.session!.reportViewport(100, 30);+ await _tick();+ expect(+ connection.sent.where((type) => type == 'terminal_open'),+ hasLength(1),+ );+ expect(app.focusedPaneId, focus);+ expect(app.panes.single, same(pane));+ },+ );+ }++ test('unavailable capabilities leave discovered agents visible without attaching', () async {+ final pane = TerminalPane(id: 99, machineId: 'm', agentId: 'a');+ app.activeSwarm.panes.add(pane);+ final load = app.reloadMachineData('m');+ await _tick();+ connection.capabilities.single.completeError(StateError('Unsupported'));+ connection.agents.single.complete(_agents);+ await load;+ expect(machine.agents.single.id, 'a');+ expect(machine.agentLoadStatus, AgentLoadStatus.loaded);+ expect(machine.terminalCapabilityAvailable, isFalse);+ expect(machine.terminalCapabilityError, isNotNull);+ expect(pane.session, isNull);+ expect(connection.sent, isEmpty);+ });++ test(+ 'inventory failure can retry while sharing the pending capability request',+ () async {+ final failed = app.reloadMachineData('m');+ await _tick();+ connection.agents.single.completeError(+ StateError('Inventory unavailable'),+ );+ await failed;+ expect(machine.agentsLoadError, contains('Inventory unavailable'));+ final retry = app.reloadMachineData('m');+ await _tick();+ expect(connection.capabilities, hasLength(1));+ expect(connection.agents, hasLength(2));+ connection.capabilities.single.complete(_capabilities);+ connection.agents.last.complete(_agents);+ await retry;+ expect(machine.agentsLoadError, isNull);+ expect(machine.terminalCapabilityAvailable, isTrue);+ },+ );++ test('a removed machine cannot send requests after late readiness', () async {+ connection.readiness = Completer<void>();+ final load = app.reloadMachineData('m');+ await _tick();+ app.machineStates.clear();+ connection.readiness!.complete();+ await load;+ expect(connection.calls, isEmpty);+ expect(app.panes, isEmpty);+ });+}diff --git a/desktop/test/profile_startup_test.dart b/desktop/test/profile_startup_test.dartindex 35babe4bc..b8d12e343 100644--- a/desktop/test/profile_startup_test.dart+++ b/desktop/test/profile_startup_test.dart@@ -91,6 +91,9 @@ class _Connection extends WsConn {Completer<Map<String, dynamic>>? capabilities;final requests = <String>[];+ @override+ Future<void> waitUntilReady({required Duration timeout}) async {}+@overrideFuture<Map<String, dynamic>> request(String type, {@@ -388,6 +391,7 @@ void main() {final pending = Completer<Map<String, dynamic>>();if (request == 'agents_list') {connection.agents = pending;+ connection.capabilities = Completer<Map<String, dynamic>>();} else {connection.capabilities = pending;}@@ -406,15 +410,16 @@ void main() {await app.logout();}pending.complete(request == 'agents_list' ? _agents : _capabilities);+ if (request == 'agents_list') {+ connection.capabilities!.complete(_capabilities);+ }await load;+ await _tick();expect(machine.terminalCapabilityLoaded, isFalse);expect(app.panes, isEmpty);if (request == 'agents_list') {expect(machine.agents, isEmpty);- expect(- connection.requests,- isNot(contains('terminal_capabilities')),- );+ expect(connection.requests, hasLength(2));}},);diff --git a/desktop/test/ws_readiness_test.dart b/desktop/test/ws_readiness_test.dartnew file mode 100644index 000000000..8d54b57ee--- /dev/null+++ b/desktop/test/ws_readiness_test.dart@@ -0,0 +1,206 @@+import 'dart:async';+import 'dart:convert';+import 'dart:io';++import 'package:flutter_test/flutter_test.dart';+import 'package:harness/auth/auth_session.dart';+import 'package:harness/core/config.dart';+import 'package:harness/core/models.dart';+import 'package:harness/state/app_state.dart';+import 'package:harness/ws/ws_conn.dart';++class _Hub {+ _Hub(this.server) {+ server.listen((request) async {+ final ws = await WebSocketTransformer.upgrade(request);+ ws.listen((raw) {+ final frame = jsonDecode(raw as String) as Map<String, dynamic>;+ frames.add(frame);+ final received = requests.putIfAbsent(+ frame['type'] as String,+ Completer<Map<String, dynamic>>.new,+ );+ if (!received.isCompleted) received.complete(frame);+ if (frame['type'] == 'machine_select' && !selected.isCompleted) {+ selected.complete(ws);+ }+ });+ });+ }+ final HttpServer server;+ final selected = Completer<WebSocket>();+ final frames = <Map<String, dynamic>>[];+ final requests = <String, Completer<Map<String, dynamic>>>{};+ Uri get uri => Uri.parse('ws://127.0.0.1:${server.port}/api/local-ws');++ Future<void> ready([String machine = 'm']) async {+ (await selected.future).add(+ jsonEncode({+ 'type': 'connected',+ 'payload': {'machineId': machine},+ }),+ );+ }++ Future<Map<String, dynamic>> receive(String type) =>+ requests.putIfAbsent(type, Completer<Map<String, dynamic>>.new).future;++ Future<void> reply(String type, Map<String, dynamic> payload) async {+ final request = await receive(type);+ (await selected.future).add(+ jsonEncode({+ 'type': '${type}_result',+ 'payload': {+ ...payload,+ 'requestId': (request['payload'] as Map)['requestId'],+ },+ }),+ );+ }+}++void main() {+ late _Hub hub;+ late WsConn connection;+ setUp(() async {+ hub = _Hub(await HttpServer.bind(InternetAddress.loopbackIPv4, 0));+ connection = WsConn(+ wsBaseUrl: 'ws://unused.invalid',+ autonomousEnv: 'test',+ machineId: 'm',+ accessTokenProvider: (_, _) async => throw StateError('No credentials'),+ onAuthFailure: (_) {},+ onEvent: (_) {},+ onStatus: (_) {},+ transportKind: WsTransportKind.localPlaintext,+ localWsUri: hub.uri,+ );+ });+ tearDown(() async {+ await connection.close();+ await hub.server.close(force: true);+ });++ test(+ 'readiness waits for this machine and releases concurrent callers',+ () async {+ await connection.connect();+ final first = connection.waitUntilReady(+ timeout: const Duration(seconds: 2),+ );+ final second = connection.waitUntilReady(+ timeout: const Duration(seconds: 2),+ );+ await hub.ready('another-machine');+ await expectLater(+ first.timeout(const Duration(milliseconds: 20)),+ throwsA(isA<TimeoutException>()),+ );+ expect(connection.isReady, isFalse);+ await hub.ready();+ await Future.wait([first, second]);+ await connection.waitUntilReady(timeout: Duration.zero);+ expect(connection.isReady, isTrue);+ expect(hub.frames.map((f) => f['type']), ['machine_select']);+ },+ );++ test('an expired readiness wait does not poison the next one', () async {+ await expectLater(+ connection.waitUntilReady(timeout: const Duration(milliseconds: 1)),+ throwsA(isA<WsRequestTimeout>()),+ );+ final next = connection.waitUntilReady(timeout: const Duration(seconds: 2));+ await connection.connect();+ await hub.ready();+ await next;+ expect(connection.isReady, isTrue);+ });++ test('closing rejects pending and future readiness waits', () async {+ await connection.connect();+ final waiting = expectLater(+ connection.waitUntilReady(timeout: const Duration(seconds: 2)),+ throwsA(isA<StateError>()),+ );+ await connection.close();+ await waiting;+ await expectLater(+ connection.waitUntilReady(timeout: const Duration(seconds: 2)),+ throwsA(isA<StateError>()),+ );+ });++ test(+ 'the real transport sends both discovery requests before either reply',+ () async {+ final app = AppNotifier(+ config: AppConfig.dev,+ authSession: AuthSession(),+ connectionForTest: (_) => connection,+ )..status = AppStatus.authenticated;+ addTearDown(app.dispose);+ const host = Machine(+ machineId: 'm',+ name: 'Fixture computer',+ authMode: MachineAuthMode.remote,+ );+ final machine = MachineState(host)..nodeOnline = true;+ app.machines = [host];+ app.machineStates['m'] = machine;+ final sawAgents = Completer<void>();+ app.addListener(() {+ if (machine.agents.isNotEmpty && !sawAgents.isCompleted) {+ sawAgents.complete();+ }+ });+ await connection.connect();+ var finished = false;+ final load = app.reloadMachineData('m').then((_) => finished = true);+ await hub.selected.future;+ expect(hub.frames.map((f) => f['type']), ['machine_select']);+ await hub.ready();+ await Future.wait([+ hub.receive('agents_list'),+ hub.receive('terminal_capabilities'),+ ]).timeout(const Duration(seconds: 2));+ await hub.reply('agents_list', {+ 'agents': [+ {'id': 'a', 'name': 'Fixture agent', 'engine': 'codex'},+ ],+ });+ await sawAgents.future.timeout(const Duration(seconds: 2));+ expect(finished, isFalse);+ expect(machine.terminalCapabilityLoaded, isFalse);+ await hub.reply('terminal_capabilities', {+ 'protocolVersion': 3,+ 'backend': 'tmux',+ 'available': true,+ });+ await load;+ expect(machine.terminalCapabilityAvailable, isTrue);+ expect(app.panes, isEmpty);+ expect(hub.frames.map((f) => f['type']), [+ 'machine_select',+ 'terminal_capabilities',+ 'agents_list',+ ]);+ },+ );++ test(+ 'an unlinked machine rejects readiness without running requests',+ () async {+ await connection.connect();+ final waiting = expectLater(+ connection.waitUntilReady(timeout: const Duration(seconds: 2)),+ throwsA(isA<StateError>()),+ );+ await (await hub.selected.future).close(4404, 'NO_PEER_LINK');+ await waiting;+ expect(connection.isReady, isFalse);+ expect(connection.isClosed, isTrue);+ expect(hub.frames.map((f) => f['type']), ['machine_select']);+ },+ );+}diff --git a/docs/harness-v2-appearance-onboarding.md b/docs/harness-v2-appearance-onboarding.mdindex b8015c6e9..e3be68c5d 100644--- a/docs/harness-v2-appearance-onboarding.md+++ b/docs/harness-v2-appearance-onboarding.md@@ -36,6 +36,8 @@ Repeated refreshes share a pending profile request, and a failed profile can beFourteen isolated profile/startup lifecycle checks and the existing first-run/machine suites pass: 118 focused tests in total. These establish request independence, notification and recovery behavior with synthetic data. They do not measure real sign-in duration, network latency or user activation.+The next discovery stage now overlaps agent inventory and terminal capabilities after the machine handshake. Agents become visible when their list arrives, while existing panes wait for both prerequisites before attaching. A combined app/WebSocket fixture verifies that both requests reach a loopback peer before either reply, including visible inventory while capabilities remain pending. This removes another serial dependency without shortening the existing connection/reply budgets or moving keyboard focus.+## Onboarding evidence and direction| Primary source | Observed behavior | Harness adaptation |diff --git a/docs/harness-v2-performance.md b/docs/harness-v2-performance.mdindex 39a495daa..277af45f2 100644--- a/docs/harness-v2-performance.md+++ b/docs/harness-v2-performance.md@@ -10,6 +10,14 @@ flutter test --no-pub --reporter expanded test/benchmarks/swarm_benchmark.dartIt prints `SWARM_BENCH` JSON records. Its filename deliberately does not end in `_test.dart`, so ordinary correctness runs do not include timing measurements.+## Concurrent machine discovery (2026-09-13)++Agent inventory and terminal capability requests now start together after the machine handshake. The small capability request is sent first because the CLI dispatches frames through a per-client FIFO; it can answer that request before assembling project metadata for the agent list. The list becomes visible as soon as it arrives. Existing panes attach only when both inventory and protocol information are available, without changing focus or membership.++Readiness has a bounded wait. Its elapsed time is subtracted from the inventory's existing ten-second budget; capabilities retain an eight-second reply budget that begins after the handshake. Pending capability work is shared across a failed inventory request and its retry. Close, unlink, expired waits, removed machines and signed-out sessions cannot queue new metadata requests from a late completion.++Both initial regressions failed before the change. The affected suite passed 107 checks; a subsequent 14-check discovery/readiness run includes a new combined AppNotifier and actual WebSocket test against a disposable loopback peer. The peer receives both requests before releasing either reply, and the app publishes the agent list before the capability reply. This verifies the request graph and behavior; it is not an observed remote or native latency measurement. Logs: `/private/tmp/harness-v2-machine-loading-{before,tests,transport-tests}.log`.+## Workspace discovery without a profile dependency (2026-09-13)After CLI sign-in and daemon readiness, machine discovery used to wait for the account profile. Refresh recovery repeated that dependency whenever no profile was known. The requests now run independently; only one profile request is kept in flight, and a completed response updates the account separately. A failed profile does not delay machine error recovery or require another sign-in.diff --git a/docs/harness-v2-progress.md b/docs/harness-v2-progress.mdindex 639e918c9..5dc8f33be 100644--- a/docs/harness-v2-progress.md+++ b/docs/harness-v2-progress.md@@ -2,6 +2,14 @@Updated 2026-09-13 with coordinated palettes, Models, combined closed-work History and faster unified search. This is a working preview, not a release.+## Concurrent machine discovery checkpoint++- Agent inventory and terminal capabilities now start together after the machine handshake. Capability checks are sent first, so the CLI's per-client FIFO can answer that small request before building the agent catalog. Discovered agents publish without waiting for a slower capability response. Restored panes still require both results, attach once and preserve focus.+- Handshake time remains inside the inventory's existing ten-second budget. The capability request keeps its eight-second reply budget, starting only after readiness. No request is sent after a timed-out/closed wait or after the target machine/session is removed. Concurrent callers share pending work; an inventory failure can retry while sharing a still-pending capability request.+- Two isolated regressions reproduced serialization and delayed agent visibility before the change (`/private/tmp/harness-v2-machine-loading-before.log`). **107 affected tests passed**, followed by **14 discovery/readiness checks** that include one additional combined AppNotifier/real-WebSocket test. That loopback peer withholds both replies until both requests arrive, then verifies visible agents before capabilities. Logs: `/private/tmp/harness-v2-machine-loading-tests.log` and `/private/tmp/harness-v2-machine-loading-transport-tests.log`.+- Analyzer has zero errors/warnings and the existing 12 vendored infos (`/private/tmp/harness-v2-machine-loading-analyze.log`). These checks prove ordering, timeout-budget handling, retry and attachment behavior, not real remote latency. The fixture uses no credentials, real agent or CLI daemon.+- The user explicitly reaffirmed permission to push to the public `autonomous-ai/autonomous-harness` repository on `app-v2`. The prior 17 local commits were pushed through `1c535b3`, and the remote head was verified. Continue ordinary checkpoint pushes there without asking again. Preserve unrelated naming edits, collaboration notes and native benchmark tooling.+## Workspace startup and profile checkpoint- Launch, sign-in and Cmd-R recovery now load machines independently of account display metadata. The CLI still confirms authentication and daemon readiness first. A pending profile no longer holds the workspace or refresh future; a successful profile publishes its account details when it arrives.@@ -9,7 +17,7 @@ Updated 2026-09-13 with coordinated palettes, Models, combined closed-work Histo- Signing out invalidates pending account and inventory work before asynchronous cleanup. Late sign-in, profile, machine and terminal-capability replies cannot restore the old account, open old agents, clear a newer session's loading state or notify a disposed app. Runtime sign-out clears displayed account identity as well.- The original four profile/startup regressions failed before the fix (`/private/tmp/harness-v2-profile-startup-before.log`). A separate refresh-after-close check reproduced a disposed-notifier error (`/private/tmp/harness-v2-profile-refresh-close-before.log`). **118 focused tests now pass**, including 14 profile/startup lifecycle checks and existing daemon, environment, login, first-workspace, machine refresh and closed-work restoration coverage (`/private/tmp/harness-v2-profile-startup-tests.log`).- Analyzer has zero errors/warnings and the existing 12 vendored infos (`/private/tmp/harness-v2-profile-startup-analyze.log`). Fixtures use pending scripted responses, synthetic accounts and an isolated transport. This verifies removal of a dependency, not a measured reduction in cold launch or first-agent latency. No provider sign-in or real agent input was used.-- Public-origin approval is still pending. Preserve the unrelated first-agent naming edits, collaboration draft and native benchmark directory. Native foreground/capture validation still needs new access evidence; do not retry the same failed calibration.+- Saved and pushed as `1c535b3`. Release build succeeded (`/private/tmp/harness-v2-profile-startup-build.log`), and the exact development preview reopened as PID 66006 after PID 50695 was normally quit and confirmed exited. Native foreground/capture validation still needs new access evidence; do not retry the same failed calibration.## Native startup appearance checkpoint