Context
We're at Check Point, evaluating Monty as the sandboxed-Python backend for agents running against our systems — a long-lived MontyRepl per conversation with many feed_run snippets. We hit this in a real run.
The issue
max_duration_secs isn't per-feed_run. It's a single wall-clock budget measured from when the MontyRepl is created and shared across every snippet (it even counts host time between calls), so once it elapses the REPL is permanently dead — every later snippet, even a trivial one, fails:
repl = MontyRepl(limits=ResourceLimits(max_duration_secs=1.0))
repl.feed_run("t=0\nfor i in range(20_000_000): t+=i") # ~0.8s -> OK
repl.feed_run("t=0\nfor i in range(20_000_000): t+=i") # -> TimeoutError: time limit exceeded: 1.25s > 1.0s
repl.feed_run("print('hi')") # -> TimeoutError: time limit exceeded: ... > 1.0s
The cause is in crates/monty/src/resource.rs: LimitedTracker.start_time is set once at tracker creation and only reset by set_max_duration() / deserialize — feed_run takes no per-call limit and never resets it.
Ask
Should max_duration_secs reset per feed_run for MontyRepl (or expose a per-feed_run limit)? If the cumulative behavior is intended?
Context
We're at Check Point, evaluating Monty as the sandboxed-Python backend for agents running against our systems — a long-lived
MontyReplper conversation with manyfeed_runsnippets. We hit this in a real run.The issue
max_duration_secsisn't per-feed_run. It's a single wall-clock budget measured from when theMontyReplis created and shared across every snippet (it even counts host time between calls), so once it elapses the REPL is permanently dead — every later snippet, even a trivial one, fails:The cause is in
crates/monty/src/resource.rs:LimitedTracker.start_timeis set once at tracker creation and only reset byset_max_duration()/ deserialize —feed_runtakes no per-call limit and never resets it.Ask
Should
max_duration_secsreset perfeed_runforMontyRepl(or expose a per-feed_runlimit)? If the cumulative behavior is intended?