touch method

void touch(
  1. String id, {
  2. required int tokens,
  3. required int requests,
})

In-flight liveness touch (issue #383 heartbeat): the executor calls this when the child proves provider-side life — a completed assistant response — stamping SubagentHandle.lastActivity and the running turn's usage snapshot. Deliberately in-memory only: the registry snapshot is not rewritten per provider turn (a write storm for a freshness signal the next real update refreshes anyway).

Implementation

void touch(String id, {required int tokens, required int requests}) {
  final handle = _handles[id];
  if (handle == null) return;
  handle.lastActivity = clock().toIso8601String();
  handle.liveTokens = tokens;
  handle.liveRequests = requests;
}