Conversation
Includes libsdl2-dev, libsdl2-mixer-dev, libsdl2-image-dev, and libsdl2-ttf-dev to support multimedia functionalities.
* refactor(metrics): Consolidate metrics service usage across the application - Replaced instances of DetailedMetricsService with a unified metrics_service for consistency. - Updated metrics retrieval methods to use the new service, including summary, language usage, and pool statistics. - Enhanced metrics middleware to record API request metrics using the new service. - Removed redundant code and improved error handling in various metrics-related functions. - Adjusted API endpoints to reflect changes in metrics data structure and retrieval methods. * refactor(container): Improve security hardening by refining path masking logic - Updated the masking logic to only include non-proc/non-sys paths for bind mounts, ensuring compliance with OCI runtime restrictions. - Removed unnecessary readonly path handling, simplifying the hardening process. - Changed the container's read_only setting to False to accommodate Docker's put_archive API requirements while maintaining security through other hardening measures. * test(integration): Enhance LibreChat file upload and retrieval tests - Added comprehensive tests for file upload lifecycle, including validation of file summary and download functionality. - Introduced mocks for file and session services to simulate interactions during tests. - Improved assertions to ensure response data structure aligns with expected formats for LibreChat. - Updated existing tests to utilize new mock setups and validate additional response details. * refactor(api): Remove state management endpoints and related functionality - Deleted the state management API endpoints from the codebase, including all associated models and services. - Updated documentation to reflect the removal of state-related features. - Adjusted API imports and response models to eliminate references to state management. - Refined authentication logic to only accept API keys via the `x-api-key` header, removing support for `Authorization` headers. - Enhanced functional tests to align with the updated API structure, ensuring comprehensive coverage of remaining functionalities. * feat(sandbox): Introduce nsjail-based sandboxing for code execution - Added a new Dockerfile to build a unified image with multiple language runtimes and nsjail for secure code execution. - Created a docker-compose configuration to manage the API, Redis, and MinIO services, ensuring proper dependencies and health checks. - Implemented a base configuration for nsjail to define security policies and resource limits for sandboxed execution. - Refactored the application to replace container management with sandbox management, including updates to service initialization, health checks, and execution logic. - Enhanced settings to support sandbox configuration, including paths, limits, and cleanup intervals. - Updated relevant models and services to track and manage sandboxes instead of containers, ensuring a seamless transition to the new execution environment. * refactor(docker): Update Docker configuration for nsjail integration - Switched to using a pre-built Docker image for the API service, simplifying the build process. - Enhanced the docker-compose configuration with SSL support and environment variable management. - Adjusted the Dockerfile to improve Python package installation and added support for a dashboard. - Refined sandbox execution logic by using absolute paths and modifying permissions for sandbox directories. - Updated nsjail configuration to improve security and resource management, including disabling unnecessary namespaces. - Improved validation for nsjail availability in the configuration validator. * feat(sandbox): Enable REPL mode and enhance execution configurations - Activated REPL mode in the Docker configuration for improved interactive code execution. - Updated execution commands for TypeScript and R languages to use relative paths, simplifying file handling. - Adjusted working directory references in the execution runner to utilize sandbox-specific paths. - Enhanced nsjail configuration to skip setsid() for REPL mode, ensuring stdin pipes remain connected. - Disabled default resource limits in nsjail to rely on Docker's resource management. * refactor(sandbox): Streamline REPL mode and sandbox execution - Updated the environment configuration to clarify that only Python supports REPL pooling, enhancing performance by reducing startup time. - Simplified the Docker Compose setup by removing unnecessary volume mounts and optimizing resource limits for better performance. - Enhanced the nsjail configuration to ensure proper isolation and security during sandbox execution, including improved process management. - Refined the sandbox pool logic to focus solely on Python, eliminating unused configurations for other languages. - Improved documentation to reflect changes in sandbox behavior and configuration settings. * feat(security): Enhance authentication logic to allow admin dashboard access - Updated the authentication skip logic to permit access to the admin dashboard without authentication. - Retained existing exclusions for specified paths and OPTIONS method, ensuring consistent behavior for unauthenticated requests. * feat(sandbox): Transition to nsjail-based sandboxing for code execution - Replaced Docker-based execution with nsjail for enhanced security and isolation. - Unified Docker image now includes all 12 language runtimes, simplifying the build process. - Updated environment configurations and Docker Compose files to reflect the new sandbox architecture. - Removed legacy Docker configurations and scripts, streamlining the setup for improved performance. - Enhanced documentation to clarify the new sandboxing approach and its benefits. * chore(docker): Enable init process in Docker Compose for better process management - Added 'init: true' to the Docker Compose configuration to utilize the tini init process, which helps in reaping zombie processes created by nsjail and Python child processes. * feat(server): Increase keep-alive timeout for server connections - Set the keep-alive timeout to 120 seconds in the server configuration for both HTTPS and API endpoints, enhancing connection management and performance. * refactor(config): Update environment and configuration settings for sandboxing - Renamed configuration settings from `container_*` to `sandbox_*` for clarity and consistency. - Removed deprecated settings related to container management and streamlined resource limits. - Enhanced documentation to reflect changes in configuration structure and sandbox behavior. - Updated relevant code references to align with the new naming conventions, ensuring proper functionality across the application. * refactor(config): Update SSL configuration and resource limits - Refactored SSL configuration settings to improve clarity and functionality, including renaming `enable_https` to `https_enabled` and adjusting the logic for SSL file validation. - Updated default values for SSL certificate paths and enhanced documentation for HTTPS settings. - Increased resource limits for execution time and file size, optimizing performance for sandbox operations. - Adjusted session cleanup interval and enabled orphan MinIO cleanup for better resource management. * refactor(docker): Simplify Docker Compose configuration and enhance CI workflows - Removed container-level resource limits from the Docker Compose file to streamline configuration. - Updated GitHub Actions workflow for Docker publishing to include all files in the docker directory. - Enhanced linting workflow by adding flake8 and black for improved code quality checks and added a new job for Docker build validation. * feat(docker): Add build context to Docker Compose for API service - Included a build context in the Docker Compose configuration for the API service, enabling local builds and enhancing flexibility in development. * refactor(logging): Update logging levels for various services - Changed several logger.info calls to logger.debug for less critical messages in the cleanup, execution, and session services to reduce log verbosity. - Updated logger messages in the FastAPI startup functions to reflect successful service starts without indicating success explicitly. - Enhanced request logging to differentiate between error and successful requests based on response status. * refactor(logging): Update logging configuration and access log settings - Modified the default value for `enable_access_logs` to false in the configuration, shifting to a middleware-based approach for request logging. - Enhanced documentation in the configuration files to clarify logging levels and formats, including a detailed guide for log levels. - Adjusted several logger calls from `info` to `debug` to reduce verbosity in state and sandbox management logs. - Updated the logging setup to suppress uvicorn access logs, allowing the new middleware to handle request logging with status-aware levels. * style: Fix black formatting for CI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(types): Resolve mypy errors in metrics and sandbox executor - metrics.py: Use isinstance checks and assertions to narrow types from _execution_stats dict (mixed int/defaultdict values) - executor.py: Handle proc.returncode being Optional[int] with fallback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(security): Suppress bandit B103 for sandbox data dir chmod The 0o777 chmod is intentional — each sandbox gets its own isolated directory that needs to be writable by the nsjail unprivileged user. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d file extensions - Eliminated the check for allowed file extensions in the OutputProcessor class, simplifying the validation logic for generated files. - Updated the code to focus solely on path validation, enhancing clarity and maintainability.
… references - Changed environment variable from `API_PORT` to `PORT` for consistency across configurations. - Updated Docker and application settings to reflect the new port variable, ensuring the API is accessible on the specified port. - Removed references to `HTTPS_PORT` in the configuration and codebase, simplifying the setup for SSL/HTTPS. - Adjusted documentation to clarify the new port settings and their usage.
Added missing file-writing keywords to the REPL mode file detection list. Previously, files created with pandas to_excel() and other export methods were not captured because the keyword list only included: open(), savefig, to_csv, write(), .save(). Added: to_excel, to_json, to_parquet, to_html, to_xml, to_feather, to_pickle, dump() (for json.dump, pickle.dump, yaml.dump). This fix ensures generated files are properly detected and returned in the API response when using REPL mode (Python only).
Fix REPL file detection for pandas export methods
- Added a new configuration setting `state_max_redis_size_mb` to define the maximum state size for Redis storage. - Updated the state saving logic in the orchestrator to store large states in MinIO and only save pointers in Redis. - Enhanced the state archival service to conditionally restore states to Redis based on the size threshold. - Introduced a new method `save_state_pointer` in the state service to handle saving state metadata when the state exceeds the Redis limit. - Improved logging to provide insights on state storage decisions and outcomes.
Add missing file detection keywords for REPL mode
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
State size threshold for Redis with MinIO overflow
…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.
feat: Bash execution, PTC, and session isolation with full test coverage
- fastapi 0.128.2 → 0.129.0 - uvicorn[standard] 0.40.0 → 0.41.0 - pydantic-settings 2.12.0 → 2.13.1 - redis 7.1.0 → 7.2.0 - locust 2.43.1 → 2.43.3 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chore(deps): Bump 5 dependencies to latest versions
Bump version to 1.2.0 across all source files, remove 7 unused imports to clean up flake8 warnings, and update CHANGELOG.md with comprehensive v1.2.0 release notes covering nsjail migration, PTC, bash support, and all other changes since v0.1.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add Programmatic Tool Calling (PTC) to README features and API section - Fix broken Supported Languages link (ARCHITECTURE.md -> CONFIGURATION.md) - Replace misleading "Stateless Execution" with "Isolated Execution" - Add Bash to CONFIGURATION.md supported languages list (13 total) - Update PTC doc status from "Future Feature" to "Implemented (v1.2.0)" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
djuillard
pushed a commit
to On-Behalf-AI/LibreCodeInterpreter
that referenced
this pull request
Apr 21, 2026
Release v1.2.0: nsjail sandboxing, PTC, and multi-language enhancements
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
Major release bringing a complete architecture overhaul and significant new features:
services/container/subsystem (~2,500 lines), SQLite metrics, state API, and Docker-in-Docker infrastructure.Changes (140 files, ~11K additions, ~10K deletions)
Added
src/api/programmatic.py,src/services/programmatic.py)src/services/sandbox/)Changed
Dockerfilewith all 13 runtimes (replaces 9 per-language Dockerfiles)docker-compose.yml(no Docker socket mount)Removed
src/services/container/(pool, manager, executor, client, network, utils)src/services/detailed_metrics.py,src/services/sqlite_metrics.pysrc/api/state.pydocker/*.Dockerfile)build-images.sh,cleanup-containers.sh,setup-wan-network.sh)CI Status
Test plan
v1.2.0after merge🤖 Generated with Claude Code