Repository navigation
feat(python): per-call timeout and multimodal reads for the Deep Agents backend - #2817
Merged
Merged
Conversation
…ts backend - core: ExecOptions::timeout caps one exec at min(per-call, configured limit) - python: Bash/BashTool execute* accept timeout_seconds - deepagents: BashkitBackend.execute/aexecute accept the protocol timeout, read images/PDFs/binary files as base64 FileData, map transfer errors to FileOperationError codes; require deepagents>=0.7.32
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | d50cede | Commit Preview URL Branch Preview URL |
Nov 03 2026, 12:12 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
BashkitBackend.execute/aexecuteaccept Deep Agents'timeoutargument. It can only shorten the constructortimeout_seconds, never extend it.Noneand0(the framework's "no timeout" hint) keep the configured limit.ExecOptions::timeout(Duration). A call runs undermin(per-call, ExecutionLimits::timeout), uses the same host-backed timeout wrapper, and fails with the sameLimitExceeded::Timeout. The session stays usable afterwards.Bash/BashToolexecute,execute_sync,execute_or_throwandexecute_sync_or_throwaccepttimeout_seconds=.read()of images, PDFs and other non-text files (classified by Deep Agents' own extension classifier) returns whole-file base64FileData, capped at 500 KB like the upstream sandboxes. Text-extension files with invalid UTF-8 fall back to base64 the same way.file_not_found/is_directory/permission_denied/invalid_pathinstead of the native message.bashkit[deepagents]extra now requiresdeepagents>=0.7.32, the current release this was tested against.Why
These gaps showed up when checking Bashkit against deepagents 0.7.32, before asking LangChain to list it as a sandbox integration. When the model passed a
timeout, deepagents rejected the call with "This sandbox backend does not support per-command timeout overrides. Update your sandbox package". Reading an image failed withInvalid UTF-8.Before / After
bashkit 0.20.2 (PyPI) vs this branch, with deepagents 0.7.32:
execute_accepts_timeout(BashkitBackend)FalseTrueexecute("sleep 5", timeout=1)through the agentexecution timeout (1s)BashkitBackend(timeout_seconds=0.5).execute(..., timeout=60)read("/tmp/pixel.png")error="Invalid UTF-8: invalid utf-8 sequence..."{"content": "<base64>", "encoding": "base64"}; the agent'sread_filereturns image contentdownload_files(["/missing"])error="io error: file not found"error="file_not_found"Tests:
cargo test -p bashkit --test integration exec_with_options: 5 passed (2 new: the per-call cap with session recovery, and the configured limit winning over a larger per-call value).pytest crates/bashkit-python/tests: 970 passed, 2 skipped. The three suites that need thebashkit_random_fsfixture crate were not run locally.create_deep_agentloop intest_framework_filesystem_toolsnow exercisesexecutewith a timeout andread_fileon a PNG.ruff check/ruff format --check,just check-okfandjust check-doc-linksare clean.Risk
exec_bash_with_optional_outputnow callsexec_with_optionsinstead of theexec_*_with_extensionswrappers, which delegate to the same function.Checklist
<a href="
https://backend.blacksmith.sh/track/enable-autofix?expires=1796255955&installation_model_id=447267&pr_number=2817&ref=codesmith_pr_footer&repository=everruns%2Fbashkit&return_to=https%3A%2F%2Fgithub.com%2Feverruns%2Fbashkit%2Fpull%2F2817&signature=cf6a18a94a90be66cff447b0d495502647d82d046f2e7741f9ecbb044754144d"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png" width="190" height="28">Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Generated by Claude Code