Repository navigation
fix: session limits in bindings, rm preserve-root, analyze uploads - #2958
Conversation
- Python/Node: max_exec_calls / max_session_commands (maxExecCalls / maxSessionCommands) raise or lower the per-instance session caps without switching profiles; kept across reset() - Session limit errors say the host can raise the limit; document defaults, snapshot carry-over and reset() in configuration docs - rm -r / refuses like GNU --preserve-root (exit 1) instead of a silent success; --no-preserve-root opts out - analyze(): uploads / ScriptAnalysis::file_uploads() lists local files curl, wget and scp would send - docs: sudo runs as the one sandbox user
…-0bjqfz # Conflicts: # knowledge/log.md
There was a problem hiding this comment.
Reviewed the three areas (session limits in JS/Python bindings, rm --preserve-root failsafe, analyze() upload detection). Session-limit plumbing (check-before-record, monotonic snapshot merge, reset() rebuild) and the rm lexical-root check look correct. One inline finding below; a smaller docs nit is in the summary comment.
Review summary (PR #2958, head
|
The two filesystems are seeded at different moments, so 'ls -lR' output differs when the seeding straddles a minute boundary (seen on CI).
|
Generated by Claude Code |
Requested by Михайло · project thread
What changed
Bash/BashTooltakemax_exec_calls/max_session_commands(Node:maxExecCalls/maxSessionCommands), applied over the profile and kept acrossreset(). Before, the only way past the 1,000-call default wasExecutionProfile.Interactive, which also relaxes every per-call limit.session exec() call limit exceeded (1000 calls); raise the session limit (host setting) or start a new session. Defaults, snapshot carry-over andreset()are documented indocs/configuration.md#session-limitsand both binding READMEs.rm -r /refuses like GNU rm (--preserve-rootfailsafe, exit 1), on the resolved path (//,/tmp/..), even with-f;--no-preserve-rootopts out.rm -rf /*still empties the sandbox, as in real bash.analyze()reports uploads:uploads(Rust:ScriptAnalysis::file_uploads()) lists local files thatcurl(-d @f,--data-binary,--json,--data-urlencode,-F k=@f,-T),wget(--post-file,--body-file) orscpwould send. Sees through bundled short flags and wrappers (sudo,env). Rust serde shape ofScriptAnalysisis unchanged (derived method). Exposed in Python, Node and WASM.sudorunning as the one sandbox user is spelled out indocs/security.md.Why
An external review of 0.21.0 ("bashkit tested: a bash sandbox for AI agents") hit these: long agent sessions stop at call 1,001 with no Python knob,
rm -rf /"succeeded" silently,analyze()listedcurl -d @/data/weather.csvargs without singling out the file being sent, andsudo -u root idlooked like it worked.Before / After
Risk
rm -r /now exits 1 instead of 0 (matches bash). Session error text gained a suffix; tests matching on the prefix still pass.Checklist
rm_preserve_root_tests, Pythontest_execution_profiles/test_analyze, Nodecwd-env-options/analyzespecs; full bashkit lib + integration suites green locally)Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.