pub const MAX_INPUT_BYTES: usize = 10 * 1024 * 1024;
pub const MAX_JSON_DEPTH: u32 = 64;
pub const TOOL_RESULT_CAP: usize = 64 * 1024;
pub const LOG_RETENTION_RUNS: usize = 50;
pub const LOG_MAX_BYTES: u64 = 512 * 1024 * 1024;
pub const FULL_AUTO_TIMEOUT_SECS: u64 = 900;
pub const NORMAL_MAX_TOOL_CALLS: u32 = 15;
pub const FULL_AUTO_MAX_TOOL_CALLS: u32 = 50;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct HeadlessLimits {
pub max_input_bytes: usize,
pub full_auto_max_tool_calls: u32,
pub log_retention_runs: usize,
pub log_max_bytes: u64,
pub tool_result_cap: usize,
pub full_auto_timeout_secs: u64,
}
impl Default for HeadlessLimits {
fn default() -> Self {
Self {
max_input_bytes: MAX_INPUT_BYTES,
full_auto_max_tool_calls: FULL_AUTO_MAX_TOOL_CALLS,
log_retention_runs: LOG_RETENTION_RUNS,
log_max_bytes: LOG_MAX_BYTES,
tool_result_cap: TOOL_RESULT_CAP,
full_auto_timeout_secs: FULL_AUTO_TIMEOUT_SECS,
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_headless_limit_values_match_spec_contract() {
assert_eq!(MAX_INPUT_BYTES, 10 * 1024 * 1024);
assert_eq!(MAX_JSON_DEPTH, 64);
assert_eq!(TOOL_RESULT_CAP, 64 * 1024);
assert_eq!(LOG_RETENTION_RUNS, 50);
assert_eq!(LOG_MAX_BYTES, 512 * 1024 * 1024);
assert_eq!(FULL_AUTO_TIMEOUT_SECS, 900);
assert_eq!(NORMAL_MAX_TOOL_CALLS, 15);
assert_eq!(FULL_AUTO_MAX_TOOL_CALLS, 50);
}
}