MCPcopy Create free account
hub / github.com/AI45Lab/Code / check

Function check

core/src/config/agent_dir.rs:245–257  ·  view source on GitHub ↗
(
        v: Option<T>,
        max: T,
        one: T,
        field: &str,
    )

Source from the content-addressed store, hash-verified

243 limits: ScriptToolLimits,
244) -> std::result::Result<ScriptToolLimits, String> {
245 fn check<T: PartialOrd + Copy + std::fmt::Display>(
246 v: Option<T>,
247 max: T,
248 one: T,
249 field: &str,
250 ) -> std::result::Result<(), String> {
251 if let Some(v) = v {
252 if v < one || v > max {
253 return Err(format!("limit {field}={v} is out of range [1, {max}]"));
254 }
255 }
256 Ok(())
257 }
258 check(limits.timeout_ms, SCRIPT_MAX_TIMEOUT_MS, 1, "timeoutMs")?;
259 check(
260 limits.max_tool_calls,

Callers 1

validate_script_limitsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected