1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Types for run-scoped limit enforcement.
//!
//! [`RunLimits`] carries the configured policy — including the
//! [`RunLimits::max_depth`] recursion cap that bounds how far the sub-agent /
//! sub-graph run tree may nest; [`LimitTracker`] (in the sibling `mod.rs`)
//! holds the live counters and checks them against the policy.
/// Configures the hard limits applied across a single harness run.
///
/// All limits are checked fail-closed: the first call that exceeds a cap
/// returns an error and the run should be stopped.
///
/// # Examples
///
/// ```
/// use tinyagents::harness::limits::RunLimits;
///
/// let limits = RunLimits::default()
/// .with_max_model_calls(10)
/// .with_max_tool_calls(20);
/// ```