Skip to content

Codex/merge pr 388#394

Merged
jerry609 merged 11 commits into
devfrom
codex/merge-pr-388
Mar 14, 2026
Merged

Codex/merge pr 388#394
jerry609 merged 11 commits into
devfrom
codex/merge-pr-388

Conversation

@jerry609

@jerry609 jerry609 commented Mar 14, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Introduced Agent Board with Flow DAG visualization for task orchestration and monitoring.
    • Enabled sandbox-based code execution with persistent environments and cross-session reuse.
    • Added task planning, decomposition, and execution workflows with verification loops.
    • Implemented session state persistence across page refreshes.
    • Added sandbox file browser for workspace exploration.
  • Documentation

    • Multiple comprehensive implementation plans for multi-phase system optimization and architectural improvements.

CJBshuosi and others added 11 commits March 13, 2026 15:19
Add 13 design documents covering agent board architecture, sandbox
lifecycle, multi-agent orchestration, DAG execution, session persistence,
E2E repair loop, and codex tool-use iteration policy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…cture

- Add ExecutorAgent, PlannerAgent, KnowledgeManager sub-agents that
  operate directly inside the E2B VM filesystem
- Add SharedSandbox and PersistentSandboxManager for per-user sandbox
  reuse with lease tracking and reconnect support
- Add SandboxRuntime for install detection, package resolution, and
  verification policy (pytest/script)
- Add SandboxToolExecutor with file snapshot capture on every write
- Add CodexDispatcher tool-use loop with streaming callbacks
- Add TaskDAG topological sort, Verification retry policy, E2E
  execution with auto-repair loop, and paper_slug generation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ndbox lifecycle

- Implement 6-stage pipeline: sandbox init → file replay → plan →
  batch execute → E2E verify → knowledge extract
- Add RunControl with run_id to prevent sandbox race condition on restart
- Add pause/resume/cancel endpoints with SSE event emission
- Add continue_run mode that replays file snapshots from completed tasks
- Auto-release sandbox in try/finally, guarded by run_id match
- Refactor E2B executor with keep_alive, attach_sandbox, reconnect support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace flat task list with ReactFlow DAG: Commander → Task → E2E →
  Open in VS Code nodes, all centered and non-draggable
- Add SSE event loop with idle timeout (resets per event)
- Add pipeline controls: pause/resume/cancel/continue/restart
- Add AgentBoardSidebar with sandbox file tree, timer, progress bar
- Add TaskDetailPanel with execution log blocks (Diff/Tool/Think/Result)
- Remove human review approve/reject UI, treat human_review as done
- Persist tasks and pipeline state to localStorage via Zustand
- Show all edges immediately on refresh, stagger only during live planning
- Add dedicated agent-board/[paperId] route and studio page navigation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 18 test files covering ExecutorAgent, PlannerAgent, KnowledgeManager,
SandboxToolExecutor, SharedSandbox, SandboxRuntime, CodexDispatcher tool
loop, E2E execution, TaskDAG, Verification, E2B executor, agent board
routes, paper slug, install detection, and output compression.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add e2b.Dockerfile with pre-installed ML stack (torch, transformers,
  numpy, scipy, pandas, scikit-learn) and dev tooling (pytest, jupyter)
- Add e2b.toml template config (paperbot-repro, 2 CPU, 512MB)
- Add README with step-by-step onboarding and troubleshooting guide

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add E2B sandbox and CODEX_MAX_ITERATIONS vars to env.example
- Update scholar_subscriptions last_seen_at timestamp
- Wrap python-jose, email-validator, rapidfuzz imports in try/except
  with stdlib fallbacks for minimal install environments
- Add localhost:3001/:3002 to default CORS origins

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  - Rename ToolExecutor → LocalToolExecutor for clarity
  - Narrow except Exception to except ImportError on optional imports
  - Remove leaked prompt references from analysis doc
  - Bump E2B sandbox memory from 512MB to 2048MB
  - Fix race condition in PersistentSandboxManager with double-checked locking
  - Add legacy migration comment in studio-store
  - Add DockerExecutor workspace_read_only unit tests

Signed-off-by: boyu <oor2020@163.com>
Copilot AI review requested due to automatic review settings March 14, 2026 14:33
@vercel

vercel Bot commented Mar 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
paper-bot Ready Ready Preview, Comment Mar 14, 2026 2:33pm

@github-actions

Copy link
Copy Markdown

Vercel Preview

@coderabbitai

coderabbitai Bot commented Mar 14, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aabbe4cb-752e-40d2-b8b1-92da22ab8792

📥 Commits

Reviewing files that changed from the base of the PR and between cd0ba4c and eb3efe2.

📒 Files selected for processing (81)
  • config/scholar_subscriptions.yaml
  • docs/proposals/agent-board-refactor-plan.md
  • docs/proposals/agent-board-vs-manus-analysis.md
  • docs/proposals/agent-class-integration-repair-plan.md
  • docs/proposals/codex-loop-iteration-policy-plan-zh.md
  • docs/proposals/e2e-bugfix-repair-plan.md
  • docs/proposals/persistent-user-sandbox-implementation-plan.md
  • docs/proposals/phase1a-codex-tool-use-plan.md
  • docs/proposals/phase1b-execution-sandbox-plan.md
  • docs/proposals/phase2b-parallel-dag-and-2e-kv-cache-plan.md
  • docs/proposals/sandbox-base-image-and-runtime-install-plan.md
  • docs/proposals/session-state-persistence-plan.md
  • docs/proposals/swift-moseying-pudding.md
  • docs/proposals/task-detail-enrichment-plan.md
  • e2b-template/README.md
  • e2b-template/e2b.Dockerfile
  • e2b-template/e2b.toml
  • env.example
  • src/paperbot/api/auth/dependencies.py
  • src/paperbot/api/auth/jwt.py
  • src/paperbot/api/middleware/auth.py
  • src/paperbot/api/routes/agent_board.py
  • src/paperbot/api/routes/auth.py
  • src/paperbot/api/routes/jobs.py
  • src/paperbot/application/services/paper_dedup.py
  • src/paperbot/infrastructure/swarm/__init__.py
  • src/paperbot/infrastructure/swarm/agents/__init__.py
  • src/paperbot/infrastructure/swarm/agents/executor.py
  • src/paperbot/infrastructure/swarm/agents/knowledge_manager.py
  • src/paperbot/infrastructure/swarm/agents/planner.py
  • src/paperbot/infrastructure/swarm/claude_commander.py
  • src/paperbot/infrastructure/swarm/codex_dispatcher.py
  • src/paperbot/infrastructure/swarm/e2e_execution.py
  • src/paperbot/infrastructure/swarm/paper_slug.py
  • src/paperbot/infrastructure/swarm/persistent_sandbox.py
  • src/paperbot/infrastructure/swarm/sandbox_runtime.py
  • src/paperbot/infrastructure/swarm/sandbox_tool_executor.py
  • src/paperbot/infrastructure/swarm/shared_sandbox.py
  • src/paperbot/infrastructure/swarm/task_dag.py
  • src/paperbot/infrastructure/swarm/verification.py
  • src/paperbot/infrastructure/swarm/worker_tools.py
  • src/paperbot/memory/extractor.py
  • src/paperbot/repro/docker_executor.py
  • src/paperbot/repro/e2b_executor.py
  • tests/unit/repro/test_docker_executor.py
  • tests/unit/test_agent_board_route.py
  • tests/unit/test_cache_metrics.py
  • tests/unit/test_codex_tool_loop.py
  • tests/unit/test_e2b_executor.py
  • tests/unit/test_e2e_execution.py
  • tests/unit/test_executor_agent.py
  • tests/unit/test_install_command_detection.py
  • tests/unit/test_install_output_compression.py
  • tests/unit/test_knowledge_manager.py
  • tests/unit/test_paper_slug.py
  • tests/unit/test_planner_agent.py
  • tests/unit/test_sandbox_runtime.py
  • tests/unit/test_sandbox_tool_executor.py
  • tests/unit/test_shared_sandbox.py
  • tests/unit/test_swarm_timeouts.py
  • tests/unit/test_task_dag.py
  • tests/unit/test_tool_executor.py
  • tests/unit/test_verification.py
  • web/src/app/studio/agent-board/[paperId]/page.tsx
  • web/src/app/studio/page.tsx
  • web/src/components/layout/LayoutShell.tsx
  • web/src/components/studio/AgentBoard.tsx
  • web/src/components/studio/AgentBoardEdges.tsx
  • web/src/components/studio/AgentBoardNodes.tsx
  • web/src/components/studio/AgentBoardSidebar.tsx
  • web/src/components/studio/ContextDialogPanel.tsx
  • web/src/components/studio/ContextPackPanel.tsx
  • web/src/components/studio/TaskDetailPanel.tsx
  • web/src/components/studio/blocks/DiffBlock.tsx
  • web/src/components/studio/blocks/InfoBlock.tsx
  • web/src/components/studio/blocks/ResultBlock.tsx
  • web/src/components/studio/blocks/ThinkBlock.tsx
  • web/src/components/studio/blocks/ToolBlock.tsx
  • web/src/components/studio/blocks/index.ts
  • web/src/lib/store/studio-store.test.ts
  • web/src/lib/store/studio-store.ts

📝 Walkthrough

Walkthrough

This pull request implements a comprehensive agent board refactor introducing a Flow DAG visualization replacing the previous Kanban board, a sandbox-as-workspace architecture with persistent user sandboxes, tool-enabled agent execution (PlannerAgent, ExecutorAgent, KnowledgeManager), automated verification and repair loops, and extensive supporting infrastructure for multi-phase system evolution.

Changes

Cohort / File(s) Summary
Documentation & Implementation Plans
docs/proposals/*
Twelve comprehensive proposal documents detailing: agent-board Flow DAG refactor with new node/edge architecture, agent-class integration repair plan, sandbox-as-workspace design (phases 1B/2B/2E), Codex loop iteration policy, E2E bugfix and execution repair, persistent sandbox implementation, phase 1A tool-use agent loop, session-state persistence, task detail enrichment UI, and sandbox base image/runtime install strategy (includes both English and Chinese versions).
Environment & Sandbox Templates
env.example, e2b-template/*
Added E2B_API_KEY, E2B_TEMPLATE, E2B_SANDBOX_TIMEOUT_SECONDS, and CODEX_MAX_ITERATIONS environment variables; introduced E2B template configuration (e2b.toml) and Dockerfile with ML/scientific Python stack preinstallation (PyTorch, transformers, scientific tools, dev utilities).
Scholar Configuration
config/scholar_subscriptions.yaml
Updated Nicolas Papernot's last_seen_at timestamp from 2026-02-16 to 2026-03-08.
Authentication & Middleware
src/paperbot/api/auth/*, src/paperbot/api/middleware/auth.py
Added fallback handling for optional python-jose and email_validator dependencies with graceful degradation; expanded CORS origins to include localhost:3001, localhost:3002, and 127.0.0.1 variants.
Sandbox Core Infrastructure
src/paperbot/infrastructure/swarm/shared_sandbox.py, src/paperbot/infrastructure/swarm/persistent_sandbox.py
Introduced SharedSandbox providing user-level VM abstraction with file I/O, command execution, paper-scoped isolation, sandbox timeout management, and recovery from expiration; added PersistentSandboxManager with thread-safe per-user sandbox reuse and lifecycle tracking.
Agent Classes
src/paperbot/infrastructure/swarm/agents/*
Implemented three new agents: PlannerAgent (task decomposition, plan artifact generation to .plan/), ExecutorAgent (plan/context ingestion, in-VM execution with SandboxToolExecutor), and KnowledgeManager (post-execution curation of summary/conventions/learnings).
Verification & Repair Infrastructure
src/paperbot/infrastructure/swarm/verification.py, src/paperbot/infrastructure/swarm/e2e_execution.py, src/paperbot/infrastructure/swarm/sandbox_runtime.py
Added VerificationPolicy and run_verification for sandbox-side verification command execution; introduced E2EExecutionPolicy, detect_entry_point, and run_e2e_with_repair for automated entry-point detection and repair loop orchestration; implemented SandboxVerificationPolicy and SandboxRuntime for flexible command execution and bootstrap management.
Tool Execution & Dispatching
src/paperbot/infrastructure/swarm/worker_tools.py, src/paperbot/infrastructure/swarm/sandbox_tool_executor.py, src/paperbot/infrastructure/swarm/codex_dispatcher.py
Added LocalToolExecutor for workspace-based tool execution; introduced SandboxToolExecutor for VM-native tool routing with comprehensive safety checks and SANDBOX_WORKER_TOOLS set; expanded CodexDispatcher with dispatch_with_tools/dispatch_with_sandbox_tools for iterative CodeAct-style loops, ToolLoopPolicy for configurable loop behavior, and CacheMetrics for KV-cache tracking.
Task & Sandbox Management
src/paperbot/infrastructure/swarm/task_dag.py, src/paperbot/infrastructure/swarm/paper_slug.py
Implemented TaskDAG for topological batch scheduling of dependent tasks; added paper_slug utility for filesystem-safe, deterministic paper directory naming.
Core Package Exports
src/paperbot/infrastructure/swarm/__init__.py, src/paperbot/infrastructure/swarm/agents/__init__.py
Expanded public API to expose new sandbox/verification/agent classes and utilities; created agents subpackage with ExecutorAgent, KnowledgeManager, PlannerAgent exports.
Executor Enhancements
src/paperbot/repro/e2b_executor.py, src/paperbot/repro/docker_executor.py
Enhanced E2BExecutor with sandbox persistence (attach_sandbox, ensure_sandbox, sandbox_id property), timeout refresh, expiration recovery, selective file upload with skip lists, and keep-alive support; added workspace_read_only option to DockerExecutor with conditional bind mode.
Agent Board Routes
src/paperbot/api/routes/agent_board.py
Added comprehensive backend endpoints and session management for agent-driven task orchestration, including SSE-based streaming, sandbox file operations, sandbox lifecycle management, and integration with planning/execution/verification flows.
Middleware & Dependencies
src/paperbot/api/routes/auth.py, src/paperbot/api/routes/jobs.py, src/paperbot/memory/extractor.py, src/paperbot/application/services/paper_dedup.py
Narrowed exception handling for optional dependencies (email_validator, arq, json_repair, rapidfuzz) with graceful fallbacks; introduced _FuzzFallback for fuzzy matching without rapidfuzz.
Frontend Agent Board Components
web/src/components/studio/AgentBoard.tsx, web/src/components/studio/AgentBoardNodes.tsx, web/src/components/studio/AgentBoardEdges.tsx
Replaced Kanban column layout with React Flow-based DAG visualization; implemented CommanderNode, TaskNode, E2ENode, OpenVSCodeNode with dynamic status indicators and metadata rendering; added AnimatedEdge component with variant-based styling (success/repair) and animated flow indicators.
Frontend Sidebar & Detail Panels
web/src/components/studio/AgentBoardSidebar.tsx, web/src/components/studio/TaskDetailPanel.tsx
Introduced AgentBoardSidebar with sandbox file tree explorer and time estimate tracking; implemented TaskDetailPanel with two-layer UI (overview and workspace thinking process view) and support for structured execution block rendering.
Frontend Block Components
web/src/components/studio/blocks/*
Added ThinkBlock, ToolBlock, DiffBlock, ResultBlock, and InfoBlock components for structured visualization of execution logs with appropriate icons, states, and expandable/collapsible content.
Frontend Store & State Management
web/src/lib/store/studio-store.ts
Extended AgentTask types with repairing/paused/cancelled statuses; introduced PipelinePhase with paused/cancelled states; implemented runtime persistence layer (PersistedRuntimeState, loadRuntimeStateFromStorage, saveRuntimeStateToStorage) with per-paper board session tracking, agent task replacement, and context pack persistence.
Frontend Pages & Layout
web/src/app/studio/agent-board/[paperId]/page.tsx, web/src/app/studio/page.tsx, web/src/components/layout/LayoutShell.tsx
Added agent-board focus page with dynamic paper loading; extended studio page with context-pack preloading and latest-session lookup; updated layout shell with conditional sidebar rendering for agent-board focus mode.
Frontend Context & Dialogs
web/src/components/studio/ContextDialogPanel.tsx, web/src/components/studio/ContextPackPanel.tsx
Added synthetic progress reconstruction from cached context packs; updated comment text for backend call documentation.
Test Suite Expansions
tests/unit/test_*.py (19+ new test modules)
Comprehensive test coverage for new components: CacheMetrics, Codex tool loop, E2B executor lifecycle, E2E execution and repair, ExecutorAgent, KnowledgeManager, PlannerAgent, paper slug generation, sandbox runtime, sandbox tool executor, shared sandbox, task DAG scheduling, tool executor functionality, and verification flows; also updated docker executor tests with workspace_read_only validation and agent board route tests with session/sandbox/repair scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client<br/>(Studio UI)
    participant Backend as Backend<br/>(Agent Board API)
    participant Planner as PlannerAgent
    participant Executor as ExecutorAgent
    participant Sandbox as SharedSandbox<br/>(VM)
    participant Codex as CodexDispatcher<br/>(LLM)
    participant Verify as Verification<br/>& Repair
    participant Knowledge as KnowledgeManager
    participant Download as Download
    
    Client->>Backend: POST /sessions (create board session)
    Backend->>Backend: Initialize session state
    
    Client->>Backend: POST /sessions/{id}/plan (SSE stream)
    Backend->>Planner: plan(sandbox, context_pack)
    Planner->>Sandbox: read existing files
    Planner->>Codex: decompose tasks
    Codex-->>Planner: task list
    Planner->>Sandbox: write .plan/ (roadmap, tasks, context)
    Sandbox-->>Planner: success
    Planner-->>Backend: tasks + on_step callbacks
    Backend-->>Client: SSE: planning_complete
    
    Client->>Backend: POST /tasks/{id}/dispatch (SSE stream)
    Backend->>Sandbox: ensure sandbox active
    Backend->>Executor: execute(task, sandbox)
    Executor->>Sandbox: read .plan/ files
    Executor->>Codex: dispatch_with_sandbox_tools (tool loop)
    
    rect rgba(100, 150, 200, 0.5)
    loop Tool Loop Iterations
        Codex->>Executor: tool_call (via SandboxToolExecutor)
        Executor->>Sandbox: execute tool (read/write/run)
        Sandbox-->>Executor: result
        Executor-->>Codex: observation
        Codex->>Codex: process tool result
    end
    end
    
    Codex-->>Executor: CodexResult (success/failure)
    Executor->>Sandbox: write .status/{task_id}.json
    Executor-->>Backend: result + generated files
    Backend-->>Client: SSE: execution_complete
    
    Backend->>Verify: run_verification(sandbox)
    rect rgba(200, 100, 100, 0.5)
    alt Verification Passes
        Verify-->>Backend: success
    else Verification Fails
        Verify->>Codex: dispatch repair prompt
        Codex-->>Verify: repair result
        Verify->>Sandbox: retry verification
        Verify-->>Backend: success/failure
    end
    end
    
    Backend->>Knowledge: curate(sandbox, completed_tasks)
    Knowledge->>Sandbox: aggregate outputs
    Knowledge->>Sandbox: write .knowledge/ (summary, conventions, learnings)
    Knowledge-->>Backend: completed
    Backend-->>Client: SSE: knowledge_complete
    
    Backend->>Download: download_paper(sandbox, local)
    Download->>Sandbox: read final artifacts
    Sandbox-->>Download: files
    Download-->>Backend: local_path
    Backend-->>Client: SSE: download_complete
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Poem

🐰 Hops through the Flow DAG, sandbox so neat,
Agents planning and executing, what a feat!
From PlannerAgent's roadmap to Executor's spree,
KnowledgeManager learns, and repair loops run free. 🛠️
Persistent sandboxes, no need to restart,
PaperBot's refactored—a sophisticated work of art!

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/merge-pr-388

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a foundational overhaul of the DeepCode Studio's agent system, transitioning to a sophisticated multi-agent paradigm centered around a persistent virtual machine workspace. The user interface for managing these agents has been completely reimagined, offering an intuitive, interactive flow that visualizes the entire reproduction pipeline. This extensive set of changes significantly enhances the system's autonomy, observability, and reliability, laying the groundwork for more complex agent behaviors and improved user experience.

Highlights

  • Multi-Agent Architecture & Sandbox-as-Workspace: Implemented a multi-agent system with a Claude Commander orchestrating Codex Workers within a persistent virtual machine (VM) acting as the sole workspace, ensuring real-time execution and eliminating local file synchronization issues.
  • Redesigned Agent Board UI: Replaced the traditional Kanban board with an interactive Directed Acyclic Graph (DAG) flow visualization using @xyflow/react, offering a clearer, top-to-bottom view of the paper reproduction lifecycle.
  • Enhanced Task Detail View: Introduced a two-layer task detail panel with structured, typed content blocks (Think, Tool, Diff, Info, Result) and a diff view, providing granular insights into agent reasoning and file changes.
  • Advanced Tool-Use & Repair Loops: Enabled Codex workers with VM-native tools for iterative CodeAct loops, complemented by a robust verification process and an automated repair loop for self-correction upon execution failures.
  • Session State Persistence & Custom Sandboxes: Implemented persistence for agent board session state (tasks, pipeline phase, E2E state, sandbox files) to local storage, and introduced custom E2B sandbox templates with pre-installed ML/scientific packages for improved efficiency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • config/scholar_subscriptions.yaml
    • Updated last_seen_at timestamp.
  • docs/proposals/agent-board-refactor-plan.md
    • Added a detailed plan for the Agent Board UI refactor to a DAG flow.
  • docs/proposals/agent-board-vs-manus-analysis.md
    • Added an architectural comparison of Agent Board with Manus, including a v2 update.
  • docs/proposals/agent-class-integration-repair-plan.md
    • Added a plan to integrate agent classes into the execution flow.
  • docs/proposals/codex-loop-iteration-policy-plan-zh.md
    • Added a plan for adaptive iteration budgeting in Codex agent loops (Chinese).
  • docs/proposals/e2e-bugfix-repair-plan.md
    • Added a plan for fixing bugs in the E2E execution pipeline.
  • docs/proposals/persistent-user-sandbox-implementation-plan.md
    • Added a plan for persistent user sandboxes.
  • docs/proposals/phase1a-codex-tool-use-plan.md
    • Added Phase 1A plan for Codex tool-use agent loop.
  • docs/proposals/phase1b-execution-sandbox-plan.md
    • Added Phase 1B plan for Sandbox-as-Workspace architecture.
  • docs/proposals/phase2b-parallel-dag-and-2e-kv-cache-plan.md
    • Added Phase 2B (parallel DAG) and Phase 2E (KV-Cache) plans.
  • docs/proposals/sandbox-base-image-and-runtime-install-plan.md
    • Added plan for sandbox base image and runtime installation.
  • docs/proposals/session-state-persistence-plan.md
    • Added plan for session state persistence.
  • docs/proposals/swift-moseying-pudding.md
    • Added DeepCode Studio redesign plan.
  • docs/proposals/task-detail-enrichment-plan.md
    • Added plan for task detail view enrichment.
  • e2b-template/README.md
    • Added E2B Sandbox Setup instructions.
  • e2b-template/e2b.Dockerfile
    • Added Dockerfile for custom E2B template.
  • e2b-template/e2b.toml
    • Added E2B template configuration.
  • env.example
    • Updated E2B sandbox and Codex iteration environment variables.
  • src/paperbot/api/auth/dependencies.py
    • Updated JWT import and token decoding error handling.
  • src/paperbot/api/auth/jwt.py
    • Updated JWT import with fallback for jose.
  • src/paperbot/api/middleware/auth.py
    • Updated CORS origins.
  • src/paperbot/api/routes/auth.py
    • Updated EmailStr import with fallback.
  • src/paperbot/api/routes/jobs.py
    • Updated arq import with fallback.
  • src/paperbot/application/services/paper_dedup.py
    • Updated rapidfuzz import with fallback.
  • src/paperbot/infrastructure/swarm/init.py
    • Updated exports for new swarm components.
  • src/paperbot/infrastructure/swarm/agents/init.py
    • Added exports for agent classes.
  • src/paperbot/infrastructure/swarm/agents/executor.py
    • Added ExecutorAgent class.
  • src/paperbot/infrastructure/swarm/agents/knowledge_manager.py
    • Added KnowledgeManager class.
  • src/paperbot/infrastructure/swarm/agents/planner.py
    • Added PlannerAgent class.
  • src/paperbot/infrastructure/swarm/claude_commander.py
    • Updated Claude API calls with cache control.
    • Added build_codex_repair_prompt.
    • Enhanced build_codex_prompt with subtask info and new instructions.
  • src/paperbot/infrastructure/swarm/codex_dispatcher.py
    • Refactored CodexDispatcher for tool-calling loops.
    • Added ToolLoopPolicy, LoopProgressTracker, CacheMetrics.
    • Updated system prompts.
  • src/paperbot/infrastructure/swarm/e2e_execution.py
    • Added E2EExecutionPolicy, E2EResult, and E2E execution/repair logic.
  • src/paperbot/infrastructure/swarm/paper_slug.py
    • Added paper_slug utility function.
  • src/paperbot/infrastructure/swarm/persistent_sandbox.py
    • Added PersistentSandboxManager and SandboxLease classes.
  • src/paperbot/infrastructure/swarm/sandbox_runtime.py
    • Added SandboxRuntime and SandboxVerificationPolicy classes.
  • src/paperbot/infrastructure/swarm/sandbox_tool_executor.py
    • Added SandboxToolExecutor and SANDBOX_WORKER_TOOLS.
  • src/paperbot/infrastructure/swarm/shared_sandbox.py
    • Added SharedSandbox class.
  • src/paperbot/infrastructure/swarm/task_dag.py
    • Added TaskDAG class.
  • src/paperbot/infrastructure/swarm/verification.py
    • Added VerificationResult, VerificationPolicy, and verification/repair functions.
  • src/paperbot/infrastructure/swarm/worker_tools.py
    • Added LocalToolExecutor and CODING_WORKER_TOOLS.
  • src/paperbot/memory/extractor.py
    • Updated json_repair import with fallback.
  • src/paperbot/repro/docker_executor.py
    • Updated DockerExecutor for workspace_read_only and run method.
  • src/paperbot/repro/e2b_executor.py
    • Updated E2BExecutor for configurable template/timeout, sandbox attachment/recovery.
  • tests/unit/repro/test_docker_executor.py
    • Added tests for DockerExecutor.
  • tests/unit/test_agent_board_route.py
    • Added/updated tests for agent board session management.
  • tests/unit/test_cache_metrics.py
    • Added tests for CacheMetrics.
  • tests/unit/test_codex_tool_loop.py
    • Added tests for Codex tool loop.
  • tests/unit/test_e2b_executor.py
    • Added tests for E2BExecutor.
  • tests/unit/test_e2e_execution.py
    • Added tests for E2E execution.
  • tests/unit/test_executor_agent.py
    • Added tests for ExecutorAgent.
  • tests/unit/test_install_command_detection.py
    • Added tests for install command detection.
  • tests/unit/test_install_output_compression.py
    • Added tests for install output compression.
  • tests/unit/test_knowledge_manager.py
    • Added tests for KnowledgeManager.
  • tests/unit/test_paper_slug.py
    • Added tests for paper_slug.
  • tests/unit/test_planner_agent.py
    • Added tests for PlannerAgent.
  • tests/unit/test_sandbox_runtime.py
    • Added tests for SandboxRuntime.
  • tests/unit/test_sandbox_tool_executor.py
    • Added tests for SandboxToolExecutor.
  • tests/unit/test_shared_sandbox.py
    • Added tests for SharedSandbox.
  • tests/unit/test_swarm_timeouts.py
    • Updated tests for Codex tool dispatch timeout.
  • tests/unit/test_task_dag.py
    • Added tests for TaskDAG.
  • web/src/app/studio/agent-board/[paperId]/page.tsx
    • Added Agent Board focus page.
  • web/src/app/studio/page.tsx
    • Updated context pack fetching and viewMode handling.
  • web/src/components/layout/LayoutShell.tsx
    • Updated sidebar visibility logic.
  • web/src/components/studio/AgentBoard.tsx
    • Refactored to use ReactFlow, DAG visualization, and new SSE event handling.
  • web/src/components/studio/AgentBoardEdges.tsx
    • Added custom ReactFlow edge components.
  • web/src/components/studio/AgentBoardNodes.tsx
    • Added custom ReactFlow node components.
  • web/src/components/studio/AgentBoardSidebar.tsx
    • Added Agent Board sidebar with file tree and time estimate.
  • web/src/components/studio/ContextDialogPanel.tsx
    • Updated context pack progress reconstruction.
  • web/src/components/studio/ContextPackPanel.tsx
    • Updated session creation for agent board.
  • web/src/components/studio/TaskDetailPanel.tsx
    • Added two-layer task detail view.
  • web/src/components/studio/blocks/DiffBlock.tsx
    • Added DiffBlock component.
  • web/src/components/studio/blocks/InfoBlock.tsx
    • Added InfoBlock component.
  • web/src/components/studio/blocks/ResultBlock.tsx
    • Added ResultBlock component.
  • web/src/components/studio/blocks/ThinkBlock.tsx
    • Added ThinkBlock component.
  • web/src/components/studio/blocks/ToolBlock.tsx
    • Added ToolBlock component.
  • web/src/components/studio/blocks/index.ts
    • Added block exports.
  • web/src/lib/store/studio-store.ts
    • Updated store for new agent board state, persistence, and task management.
Activity
  • This pull request is a merge of a feature branch (pr 388), indicating a significant development effort was completed prior to this integration.
  • Extensive planning and architectural work is evident through the numerous detailed design proposals added in the docs/proposals/ directory.
  • The addition and modification of many unit tests across the codebase demonstrate a strong focus on ensuring the correctness and stability of the new multi-agent and UI features.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@jerry609
jerry609 merged commit 751bcb2 into dev Mar 14, 2026
14 of 15 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR merges a large set of Agent Board / “swarm” features across the backend and Studio UI, including sandbox-as-workspace execution, verification/E2E repair loops, and richer task log rendering in the frontend.

Changes:

  • Adds sandbox-as-workspace infrastructure (shared sandbox FS wrapper, sandbox tool executor, persistent sandbox manager) plus verification and E2E execution/repair utilities.
  • Expands Studio UI for Agent Board (focus page layout, sidebar with sandbox file tree + time estimate, typed log blocks).
  • Adds extensive unit test coverage for the new swarm/sandbox/dispatcher behaviors and some executor updates (Docker mount mode, optional deps fallbacks).

Reviewed changes

Copilot reviewed 80 out of 81 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
web/src/lib/store/studio-store.test.ts Adds tests for new store actions/state reset behaviors; clears localStorage between tests.
web/src/components/studio/blocks/index.ts Barrel export for new Studio log “block” components.
web/src/components/studio/blocks/ToolBlock.tsx New log block UI for tool commands and expandable observation previews.
web/src/components/studio/blocks/ThinkBlock.tsx New log block UI for “thinking” messages.
web/src/components/studio/blocks/ResultBlock.tsx New log block UI for success/warning/failure events with optional summaries.
web/src/components/studio/blocks/InfoBlock.tsx New log block UI for informational/system messages.
web/src/components/studio/blocks/DiffBlock.tsx New log block UI for file-change previews and file click-through.
web/src/components/studio/ContextPackPanel.tsx Comment tweak describing session creation behavior.
web/src/components/studio/ContextDialogPanel.tsx Reconstructs synthetic progress/observations timeline from a restored context pack.
web/src/components/studio/AgentBoardSidebar.tsx Adds sidebar sections: sandbox file tree + file viewer dialog, and a running time estimate/progress bar.
web/src/components/studio/AgentBoardEdges.tsx Adds animated edge type + injected CSS for edge animations.
web/src/components/layout/LayoutShell.tsx Hides sidebar for /studio/agent-board/* focus pages and adjusts main padding accordingly.
web/src/app/studio/page.tsx Adds automatic context-pack restore/fetch by contextPackId and “latest session” lookup for selected paper.
web/src/app/studio/agent-board/[paperId]/page.tsx Adds Agent Board “focus mode” page that loads papers, selects the paper, and provides a back action.
tests/unit/test_verification.py New tests for verification policy, command detection, and repair loop error handling.
tests/unit/test_tool_executor.py New tests for LocalToolExecutor tool behaviors and guardrails (path safety, allowlist, timeouts).
tests/unit/test_task_dag.py New tests for TaskDAG batching (linear, diamond, cycles, missing deps).
tests/unit/test_swarm_timeouts.py Adds test ensuring Codex tool dispatch timeout returns a failure result.
tests/unit/test_shared_sandbox.py New tests for SharedSandbox filesystem/command behaviors, download filtering, and slug shell escaping.
tests/unit/test_sandbox_tool_executor.py New tests for SandboxToolExecutor VM-native tool behavior and safety checks.
tests/unit/test_sandbox_runtime.py New tests for SandboxRuntime policy parsing and missing-package detection logic.
tests/unit/test_planner_agent.py New tests for PlannerAgent writing plan files into VM and on_step callback.
tests/unit/test_paper_slug.py New tests for filesystem-safe, deterministic paper_slug generation.
tests/unit/test_knowledge_manager.py New tests for KnowledgeManager writing curated outputs and preserving .status.
tests/unit/test_install_output_compression.py Tests install output compression logic for signal lines.
tests/unit/test_install_command_detection.py Tests install command detection helper.
tests/unit/test_executor_agent.py New tests for ExecutorAgent prompt construction, VM status writes, and failure handling.
tests/unit/test_e2b_executor.py New tests for E2B executor env config, keep-alive reuse, recovery, and upload behavior.
tests/unit/test_codex_tool_loop.py New tests covering tool loop behavior including stagnation/auto-budget/timeout/malformed args handling.
tests/unit/test_cache_metrics.py New tests for cache hit rate tracking.
tests/unit/repro/test_docker_executor.py New tests for DockerExecutor workspace mount mode and runtime_meta.
src/paperbot/repro/docker_executor.py Adds workspace_read_only flag and records it in runtime_meta; mount mode is now configurable.
src/paperbot/memory/extractor.py Narrows exception handling to ImportError for optional json_repair dependency.
src/paperbot/infrastructure/swarm/verification.py Adds verification policy, command detection, run_verification, and verify+repair loop.
src/paperbot/infrastructure/swarm/task_dag.py Adds DAG-based batching scheduler for parallel task execution.
src/paperbot/infrastructure/swarm/shared_sandbox.py Adds SharedSandbox VM abstraction for file ops and command execution; supports download filtering and sandbox expiry recovery.
src/paperbot/infrastructure/swarm/sandbox_tool_executor.py Adds VM-native tool executor with path safety, allowlist checks, output truncation/compression, and tool logging.
src/paperbot/infrastructure/swarm/sandbox_runtime.py Adds sandbox runtime command runner + verification policy parsing + missing-package detection helpers.
src/paperbot/infrastructure/swarm/persistent_sandbox.py Adds PersistentSandboxManager for per-user reusable sandbox executors and lease tracking.
src/paperbot/infrastructure/swarm/paper_slug.py Adds filesystem-safe paper slug generator for sandbox directory namespacing.
src/paperbot/infrastructure/swarm/e2e_execution.py Adds entrypoint detection, run command construction, E2E execution, and repair loop with diagnosis prompts.
src/paperbot/infrastructure/swarm/claude_commander.py Adds Anthropic cache_control on system prompts, includes subtasks in codex prompt, and adds a repair prompt builder.
src/paperbot/infrastructure/swarm/agents/planner.py Adds PlannerAgent that decomposes tasks and writes .plan/ artifacts into VM.
src/paperbot/infrastructure/swarm/agents/knowledge_manager.py Adds KnowledgeManager that writes .knowledge/ summaries and updates commander wisdom.
src/paperbot/infrastructure/swarm/agents/executor.py Adds ExecutorAgent that runs Codex tool loop in VM and writes .status/{task_id}.json.
src/paperbot/infrastructure/swarm/agents/init.py Exports new swarm agents.
src/paperbot/infrastructure/swarm/init.py Re-exports new swarm primitives (sandbox runtime, tools, verification, DAG, etc.).
src/paperbot/application/services/paper_dedup.py Adds fallback implementation when rapidfuzz isn’t installed.
src/paperbot/api/routes/jobs.py Narrows exception handling to ImportError for optional arq dependency.
src/paperbot/api/routes/auth.py Makes EmailStr optional via email_validator fallback for minimal envs.
src/paperbot/api/middleware/auth.py Expands default CORS origins for additional localhost ports.
src/paperbot/api/auth/jwt.py Makes python-jose optional and raises clear runtime errors when missing.
src/paperbot/api/auth/dependencies.py Makes jose.JWTError optional and broadens token decode failure handling.
env.example Documents E2B sandbox env vars and CODEX_MAX_ITERATIONS.
e2b-template/e2b.toml Adds E2B template config (id, resources).
e2b-template/e2b.Dockerfile Adds E2B sandbox image definition with common ML/science/dev tooling.
e2b-template/README.md Documentation for building/publishing E2B template and configuring env vars.
docs/proposals/task-detail-enrichment-plan.md Design proposal for typed content blocks and richer task detail views.
docs/proposals/session-state-persistence-plan.md Plan for persisting/restoring session state across refresh.
docs/proposals/persistent-user-sandbox-implementation-plan.md Plan for persistent per-user sandboxes and hardening roadmap.
docs/proposals/e2e-bugfix-repair-plan.md Plan documenting E2E execution bugfixes and test expectations.
docs/proposals/codex-loop-iteration-policy-plan-zh.md Chinese design proposal for tool-loop iteration policy and diagnostics.
config/scholar_subscriptions.yaml Updates last_seen_at timestamp for a subscription.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +28 to +32
) : (
<Terminal className="h-3.5 w-3.5 text-zinc-400 shrink-0" />
)}
<Terminal className="h-3.5 w-3.5 text-zinc-400 shrink-0" />
<code className="text-xs font-mono text-zinc-300 truncate">{command}</code>
Comment on lines +34 to +38
) : (
<FileCode className="h-3.5 w-3.5 text-zinc-400 shrink-0" />
)}
<FileCode className="h-3.5 w-3.5 text-amber-500 shrink-0" />
<span className="text-xs font-mono text-zinc-600 truncate group-hover:text-indigo-600 transition-colors">
Comment on lines +19 to +21
def __init__(self, tasks: List["AgentTask"]):
self._tasks = {t.title: t for t in tasks}
self._dependents: Dict[str, Set[str]] = defaultdict(set)
@jerry609
jerry609 deleted the codex/merge-pr-388 branch March 14, 2026 14:37

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is a substantial and impressive pull request that refactors the agent execution model to a sophisticated "Sandbox-as-Workspace" architecture, inspired by systems like Manus. The changes are well-documented in the numerous proposal files and introduce a more robust, secure, and feature-rich system. Key improvements include the move to a DAG-based UI using ReactFlow, full frontend state persistence for session restoration, and a sophisticated agent loop with policies for stagnation and budget extension. The code quality is high, with good attention to security practices like path sanitization and command quoting. I have one high-severity suggestion to improve the robustness of file writing within the sandbox, but overall, this is an excellent and well-executed architectural upgrade.

Comment on lines +332 to +337
def _ensure_dir(self, fs: Any, path: str) -> None:
"""Create a directory in the VM, ignoring 'already exists' errors."""
try:
fs.make_dir(path)
except Exception:
pass

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The _ensure_dir method is not recursive. It calls fs.make_dir(path), which likely only creates a single directory and will fail if parent directories do not exist. This could cause the write_file tool to fail unexpectedly if an agent attempts to write a file into a new, nested directory structure (e.g., src/utils/helpers.py when src/utils does not exist).

To make this more robust, I suggest implementing a recursive directory creation, similar to mkdir -p. A simple way to achieve this would be to use the existing run_command method.

    def _ensure_dir(self, fs: Any, path: str) -> None:
        """Create a directory in the VM, ignoring 'already exists' errors."""
        self.run_command(f"mkdir -p {shlex.quote(path)}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants