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.

Merge remote-tracking branch 'origin/main' into feat/mobile-ios-android

Dev jacob22dac9ef38c7
diff --cc mobile/lib/state/app_state.dart
index e659ee59b,d718bad75..3b6298784
--- a/mobile/lib/state/app_state.dart
+++ b/mobile/lib/state/app_state.dart
@@@ -6888,18 -6755,11 +6958,19 @@@ class AppNotifier extends ChangeNotifie
// A pane created before this agent's terminal was verified is still sitting on
// "Attaching…" with no session — nothing else re-checks it once agentLoadStatus is
// already `loaded`, so this push is the only signal that it can attach now.
- _attachPendingPanes(machine);
+ // A push about an agent synced elsewhere.
+ _attachPendingPanes(machine, intent: AttachIntent.automatic);
} else {
- await _removeAgent(machine, agent.id);
+ // ⚠️ **Kept, not removed — the desktop's rule.** This is how a STOP arrives
+ // (`publishStoppedAgent` pushes the agent with `status: 'stopped'`), and also how an
+ // agent looks for a moment while its pane is re-verified. Removing it here made
+ // stopped work vanish from the phone until the next full reload, so there was no row
+ // left to resume. `agent_deleted` is what removes an agent; this only lets go of the
+ // streams, which have no terminal behind them any more.
+ for (final pane in panesFor(machine.machine.machineId).toList()) {
+ if (pane.agentId != agent.id) continue;
+ await _detachSession(pane, sendClose: false);
+ }
}
} catch (_) {
unawaited(_loadMachineData(machine, force: true));