Real bash subprocess via PersistentShellSession binds stdin/stdout to the
creating event loop. pytest-asyncio's per-function loop switching caused
'Future attached to a different loop' errors. Mock the session instead.
Also remove the unused session-level cleanup fixture and patch.
* feat: filesystem grep, read, edit file
* feat: add file write tool and enhance file read functionality
* feat: enhance tool prompt formatting and add escaped text decoding for file editing
* feat: remove redundant safe path tests from security restrictions
* feat: implement file read tool with support for text and image files, including validation for large files
* feat: add file read utilities and integrate with filesystem tools
* refactor: move computer tools to builtin tools registry
* refactor: remove unused plugin_context parameter from _apply_sandbox_tools
* feat: supports to display enabled builtin tools in configs
* feat: add tooltip for disabled builtin tools and update localization strings
* feat: add workspace extra prompt handling in message processing
* feat: add ripgrep installation to Dockerfile
* perf: shell executed in workspace dir in local env
* feat: enhance file reading capabilities to support PDF and DOCX parsing, including workspace storage for long documents
* feat: update converted text notice to suggest using grep for large files
* feat: implement handling for large tool results with overflow file writing and read tool integration
* fix: test
* feat: enhance onboarding steps to include computer access configuration and related help information
* feat: add support for additional temporary path in restricted environment checks
* feat: update computer access hints and add detailed configuration instructions
ComputerBooter is now an abstract class, so tests that tried to
instantiate it directly need to be updated:
- test_booter_decoupling.py: remove test_get_tools_delegates_to_class
since base class cannot be instantiated
- test_profile_aware_tools.py: use ShipyardBooter.__new__() to test
base class property defaults (capabilities, browser)
- test_computer.py: skip BoxliteBooter test since it's also abstract
and requires the boxlite module
* New sandbox backend: bubblewrap.
- Based on Linux Namespace for resource isolation
- Runs on local computer, with no privilege required
- Only supports Linux as namespace & bubblewrap are not present on other platforms.
TODO:
- Fix dashboard presentation. Why change on src does not affect what is really displayed?
- Strenghthen backend availability detection. One known issue is, on some platforms like Ubuntu 24.04, bubblewrap is banned by system guards, even when it's shipped by package manager. A complete detector may contain :
1. run the command with cmdline used by the booter. Return True if succsed.
2. If false, do bottom-up reason detection. Namespace not compiled to kernel? Specific kernel parameters not set? Banned by safety guard? The availability detector should give the user a clear information on why this sandbox backend fails.
These work may require helps from frontend developers. It is tested to be usable on my computer, with non-persistent environment(forget on every command) and persistent file storage.
* Add RO bind entry for bubblewrap backend.
TODO add:
- add plugin utility to change ro and rw bind in cmdline
- make bind dirs dict instead of list to manually map mount point
* Fix: add boot time test for bwrap booter.
in older commits, ro_bind = ['/'] makes skill sync crash. This commit fixes it and adds detection.
* Add availability of bwrap check during booting
* unit tests of bwrap
* i18n of bwrap config by Gemini 3.1 pro
* Update astrbot/core/computer/booters/bwrap.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
---------
Co-authored-by: YI Zeping <yizeyi18@mail.nankai.edu.cn>
Co-authored-by: YI Zeping <18586016708@163.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>