feat: Bash execution, PTC, and session isolation with full test coverage#63
Merged
Conversation
…Calling (PTC) - Updated the unified Docker image to support 13 language runtimes, adding Bash to the existing list. - Introduced a new Programmatic Tool Calling (PTC) feature, allowing code execution to call external tools during runtime. - Added a new API endpoint `/exec/programmatic` for executing code with tool calling support. - Updated documentation and changelog to reflect the new features and changes in language support. - Enhanced existing tests to cover the new Bash language and PTC functionality.
…r isolation - Updated the ExecutionOrchestrator to ensure that sessions referenced by uploaded files are only reused if the user_id matches the current request, preventing cross-user session sharing. - Added tests to verify session isolation when multiple users share an agent with attached files, ensuring each user receives their own session. - Introduced new functional tests for Bash execution to confirm compatibility with existing API contracts and session handling. - Enhanced existing tests to cover edge cases related to session management and file references.
djuillard
pushed a commit
to On-Behalf-AI/LibreCodeInterpreter
that referenced
this pull request
Apr 21, 2026
feat: Bash execution, PTC, and session isolation with full test coverage
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.
Summary
bashas a supported language with full nsjail sandbox executionPOST /exec/programmaticendpoint enabling code to call externally-defined tools during execution, with continuation-based round-trip protocoluser_idownership is checked to prevent cross-user state leakageTest Coverage Added
Functional tests (live endpoint,
tests/functional/)test_bash.py— 7 tests: echo, error handling, variables, loops, pipes, exit codestest_ptc.py— 9 tests: initial execution, full tool-call round-trip with arguments, error results, invalid tokens, authtest_exec_workflow.py— 2 new tests: cross-user session isolation with shared file referencestest_files.py— 2 new tests:metadata["original-filename"]and full detail field verificationIntegration tests (mocked,
tests/integration/)test_librechat_compat.py— 8 new tests: bash compat (3), PTC compat (4), metadata verification (1)test_api_contracts.py— fixedvalidate_uploadsmock inmock_file_servicefixtureUnit tests (
tests/unit/)test_orchestrator.py— 5 new tests:TestAgentFileSessionIsolationcovering all session lookup priority pathsTest plan
pytest tests/unit/— 460 passedpytest tests/functional/— 69 passed against rebuilt container🤖 Generated with Claude Code