notePressure method

void notePressure(
  1. String id, {
  2. required int estTokens,
  3. required int windowTokens,
})

Context-pressure stamp (issue #439): the executor calls this at every child turn boundary with the estimated request tokens and the effective window, so task_status can show the wall approaching. In-memory only, like touch — the next boundary refreshes it.

Implementation

void notePressure(
  String id, {
  required int estTokens,
  required int windowTokens,
}) {
  final handle = _handles[id];
  if (handle == null) return;
  handle.estTokens = estTokens;
  handle.windowTokens = windowTokens;
  _emit(handle);
}