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 branch 'feat/mobile-ios-android' of github.com:autonomous-ai/autonomous-harness into feat/mobile-ios-android

tonyfb512abaf92b
diff --cc mobile/lib/phone/terminal_page.dart
index 1e51f4abb,888ee6e1a..02903642b
--- a/mobile/lib/phone/terminal_page.dart
+++ b/mobile/lib/phone/terminal_page.dart
@@@ -660,35 -648,11 +660,35 @@@ class _TerminalPageState extends State<
final agent = machine?.agents
.where((a) => a.id == widget.agentId)
.firstOrNull;
+ // ⚠️ **The agent this page opened on is not in the machine's own list.**
+ // Only ever true of a page opened from the cache (see [_AgentGone]): the
+ // list is the machine's — `agentsFromCache` is false, so a real
+ // `agents_list` has landed — it has been LOADED rather than merely
+ // attempted, and the agent it named is not in it.
+ //
+ // Every one of those conditions matters. Without `loaded` this would
+ // fire during the window the cache exists to cover; without
+ // `!agentsFromCache` it would fire against the cached list itself, which
+ // is where the agent came from; and a machine that errored or went
+ // offline has not disowned anything — it simply has not answered, and
+ // its pane keeps the terminal's own reconnect behaviour.
+ //
+ // Note this deliberately ignores `_hadPane`/`_leave` above: that path
+ // handles a pane REMOVED while the page was live. This one is about a
+ // page that should never have been built, answered before its pane
+ // could be.
+ final agentGone =
+ agent == null &&
+ machine != null &&
+ !machine.agentsFromCache &&
+ machine.agentLoadStatus == AgentLoadStatus.loaded;
+ // Captured while the agent is still listed, for the sentence above.
+ if (agent != null) _cachedAgentName = agent.name;
final reclaim = phoneReclaimAction(session);
- // The header's trailing controls, counted before they are built: the
- // slot they share with Cancel is sized from this, and the search field
- // is laid out against that same width. The conditions must match the
- // ones guarding each control below — see [_TrailingSwap.extentFor].
+ // The header's trailing controls, counted before they are built: their
+ // slot is sized from this, and the search field is laid out against
+ // that same width. The conditions must match the ones guarding each
+ // control below — see [_TrailingFade.extentFor].
//
// ⚠️ [reclaim] is counted too, though it is a labelled button rather
// than one of the fixed 24px icon boxes. It cannot be measured from a