feat(artifacts): introduce sandbox-powered artifact workflows - #1674
Draft
AnishSarkar22 wants to merge 86 commits into
Draft
feat(artifacts): introduce sandbox-powered artifact workflows#1674AnishSarkar22 wants to merge 86 commits into
AnishSarkar22 wants to merge 86 commits into
Conversation
…our, layout provider, and sidebar components
…ing, integrating both legacy and git-backed workspace paths. Enhance `save_artifact` tool to ensure immediate document visibility and indexing, while enforcing forward-only revisions without version history. Drop the `reports` table in preparation for migration to a unified document model.
…paths once, ensuring consistent document visibility and indexing across git-backed and legacy workspaces. Implement commit-time projection for document rows and asynchronous chunk convergence. Maintain forward-only revision rules without version history, while refining the handling of generated documents.
…ncy across artifact management plans. Enhance clarity in the integration of the git-native knowledge store and refine artifact handling details, including the removal of legacy components and the introduction of new viewer functionalities.
- Updated the status of the artifacts overhaul to reflect the completion of Phase 1 and the drafting of subsequent phases. - Enhanced the file immutability and deletion processes to ensure proper handling of document files during revisions. - Adjusted the handling of SVG files in the document files routes to ensure they are downloaded as attachments instead of inline.
… files - Updated the content disposition logic to serve `application/pdf` files inline while ensuring all other file types are served as attachments. - Adjusted the handling of MIME types in the document files routes to enhance security against XSS vulnerabilities. - Modified unit tests to reflect the new content disposition behavior for various MIME types.
…pport - Introduced the opensandbox-server service in docker-compose files for local sandbox execution. - Configured environment variables and health checks for the opensandbox server. - Added sandbox.toml configuration file for server settings. - Created a Dockerfile for the sandbox environment with necessary dependencies and Python setup.
- Updated the .env.example file to include new sandbox settings for code execution, including SANDBOX_ENABLED, SANDBOX_PROVIDER, and session management parameters. - Modified docker-compose files to reflect the new sandbox environment variables, allowing for easier configuration of cloud execution options.
- Included opensandbox and opensandbox-code-interpreter as dependencies in pyproject.toml for enhanced sandbox capabilities. - Updated uv.lock to reflect the addition of opensandbox and opensandbox-code-interpreter packages with their respective versions and dependencies.
- Changed the port range from 40000-60000 to 20000-30000 to prevent address conflicts on Linux and Windows hosts during sandbox creation. This adjustment ensures smoother operation and reduces the likelihood of intermittent failures.
- Updated backend-tests.yml to include OpenSandbox integration for running tests in a sandbox environment. - Modified docker-build.yml to support building and testing the sandbox image. - Enhanced docker-compose files to manage sandbox image creation and configuration. - Added PDF generation skills and scripts for the sandbox, including quality checks and rendering capabilities.
AnishSarkar22
marked this pull request as ready for review
August 9, 2026 04:38
AnishSarkar22
marked this pull request as draft
August 9, 2026 15:12
…ity to support new roles and revision handling - Updated `document_files.role` to include `source` alongside `primary` and `preview`. - Improved `save_artifact` to require `source_path` for file artifacts and enforce revision rules. - Added context handling for artifact revisions to prevent duplicate document creation. - Enhanced error handling and verification checks during artifact saving and revision processes.
…ad handling for office file types
…handling across multiple formats
…fact handling across formats
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.
Description
Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR implements Phase 1 and Phase 2 of a complete artifacts system overhaul that enables the agent to generate and verify binary deliverables (PDFs, DOCX, PPTX, XLSX) in sandboxed code execution environments. The new system replaces the legacy genre-based deliverable tools (
generate_report,generate_resume) with a format-based approach where the agent writes code in an OpenSandbox container using per-format skills, persists real files write-through asDocument+DocumentFilepairs, and renders them by MIME type. Artifacts become first-class citizens of the git-native knowledge base with their markdown representations stored in git and binaries in object storage. The changes introduce OpenSandbox as the default self-hosted sandbox provider (with Daytona cloud as an alternative), add asave_artifacttool with verification gates, implement streaming endpoints for generated files, and extend the frontend with an artifact panel and viewer registry. Legacy deliverable code and thereportstable are deliberately retained in this phase but will be removed in future phases.⏱️ Estimated Review Time: 3+ hours
💡 Review Order Suggestion
docker/.env.exampledocker/docker-compose.ymldocker/docker-compose.dev.ymldocker/docker-compose.deps-only.ymldocker/opensandbox/sandbox.tomldocker/sandbox/Dockerfiledocker/sandbox/skills/pdf/SKILL.mddocker/sandbox/skills/pdf/scripts/check_pdf.pydocker/sandbox/skills/pdf/scripts/render_pages.shsurfsense_backend/app/config/__init__.pysurfsense_backend/app/sandbox/protocol.pysurfsense_backend/app/sandbox/factory.pysurfsense_backend/app/sandbox/registry.pysurfsense_backend/app/sandbox/providers/opensandbox.pysurfsense_backend/app/sandbox/providers/daytona.pysurfsense_backend/app/file_storage/persistence/enums.pysurfsense_backend/app/file_storage/persistence/models.pysurfsense_backend/alembic/versions/178_add_generated_artifact_files.pysurfsense_backend/app/artifacts/service.pysurfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/deliverables/tools/save_artifact.pysurfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/deliverables/tools/sandbox.pysurfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/deliverables/tools/verification.pysurfsense_backend/app/routes/document_files_routes.pysurfsense_backend/app/routes/editor_routes.pysurfsense_web/atoms/chat/artifact-panel.atom.tssurfsense_web/features/artifacts/artifact-panel.tsxsurfsense_web/features/artifacts/viewer-registry.tssurfsense_web/components/tool-ui/save-artifact.tsxsurfsense_web/components/tool-ui/inspect-sandbox-images.tsxplans/artifacts/artifacts-overhaul.mdplans/artifacts/phase-1-foundation.mdplans/artifacts/phase-2-sandbox-pdf.md