Repository navigation
fix(python): let timeout_seconds raise the embedded runtime time limit - #2873
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 6a54a99 | Commit Preview URL Branch Preview URL |
Nov 07 2026, 03:51 AM |
Review verdict: sound, no blocking issues (re-reviewed at
|
`Bash`/`BashTool` `timeout_seconds` set the shell timeout but left embedded Python and TypeScript at the profile's `max_duration` per run (30 s, Hardened 10 s), so `timeout_seconds=120` still stopped `python3` at 30 s. It now also sets that limit, as `Bash` already did for SQLite.
…ld (TM-PY-039) Follow-up to the timeout_seconds runtime-limit fix: the test now checks exit 124, the timeout message, and an upper bound so a run that ignores the deadline fails. Document that a longer per-run cap lengthens how long a CPU-bound python3/ts run can hold a shared worker thread.
1453079 to
6a54a99
Compare
Requested by Михайло · project thread
Supersedes #2864 by @krimvp (their two commits kept as-is, rebased onto main), plus one follow-up commit from review. Fixes #2866.
What changed
timeout_secondson PythonBashandBashToolnow also sets the embedded runtimes' per-run time limit (max_durationforpython3andts), the same wayBashalready passes it to SQLite. Each run stays clamped to the remaining execution deadline; per-callexecute(timeout_seconds=...)can still only shorten it. No change for callers who don't set it.Review follow-up:
timed outmessage, and an upper bound (10.5 < elapsed < 20), so a run that ignores the deadline fails.python3/tsloop yields its worker thread only at host calls, so raisingtimeout_secondsraises the longest time one tenant can hold a shared worker thread (previously capped at the profile's 30 s / Hardened 10 s). Noted in thetimeout_secondsdocstring, API reference andpython-packageknowledge.Why
Bash(python=True, timeout_seconds=120)still stoppedpython3at 30 s, and Python callers had no other way to raise it (ExecutionProfileis a closed set).Before / After
Bash(python=True, timeout_seconds=40).execute_sync("python3 -c 'while True: pass'")(from #2864):TimeoutError: time limit exceeded: 30.000000166s > 30spython3: execution timed out after 40.0stest_timeout_seconds_raises_runtime_time_limit(Hardened,timeout_seconds=11) passes for bothpython3andts. Local:pytest crates/bashkit-python/tests938 passed, 16 skipped (test_filesystem_interop.pyskipped locally, needs a CI-built fixture module).ruff,cargo fmt, OKF check clean.Risk
timeout_secondsnow let onepython3/tsrun hold a worker thread that long (TM-PY-039).tsruns still stop at the work budget (~100 s Standard, ~25 s Hardened). The JS binding'stimeoutMshas the same gap, left for a follow-up.Checklist