A delegation keeps its wait inside the round

What went wrong

A round runs under one wall-clock cap, AiStreamingLimits.MaxStreamingDuration (30 minutes in production). When the cap fires, the round ends as an error. delegate_to_agent is exempt from the per-tool timeout, because a delegation legitimately runs for minutes. Before this change the call had no idea how much of the round was left.

So a round that started a delegation late was cut mid-tool-call when the cap fired. The delegation itself was healthy. What the round lost was the call's result, and the round ended in an error instead of an answer.

Measured on the control instance, response cell Hosting/Triage/_Thread/bug-systemorph-meshweaver-plugins-2819/1a003c7b (2026-10-05): the round spent about nine minutes before its first model call and then two model calls of 731 s and 736 s. Its last delegate_to_agent, to a valid agent id, was 51 seconds old when the cap fired. Nothing hung.

Which bound is the authority

The round cap. It is the outer bound of a round and it is not changed here. Raising it would only move the cut. The exemption from the per-tool timeout also stays, because a delegation does run for minutes. What changes is that the delegation now knows the round's deadline and keeps its wait inside it.

The fix

Tests

DelegationRoundBudgetTest (virtual time, HistoricalScheduler):

Negative control: with the budget ignored inside the tool, the first two tests fail and the control still passes.

What this does not establish

Related: A delegation that never started answers the model · A delegation waits on its own sub-thread.