v3.3.1: Strict Coder - no sandbox exploration commands
Browse filesFiles changed (4)
122345# HuggingFace Spaces Dockerfile for CodePilot# BUILD_VERSION: 9 (v3.3.0 clarifying questions)# BUILD_VERSION: 10 (v3.3.1 coder strict - no sandbox exploration)FROM python:3.11-slim
# Set working directory19 unmodified lines2021222324232425262719 unmodified lines# ============================================================# STARTUP VERSION CHECK - Change this to detect if rebuild worked# ============================================================APP_VERSION = "3.3.0-clarify"BUILD_ID = "2024-12-19-v8"APP_VERSION = "3.3.1-coder-strict"BUILD_ID = "2024-12-19-v9"print("=" * 60)print(f"[STARTUP] CodePilot Chainlit App")print(f"[STARTUP] APP_VERSION: {APP_VERSION}")20 unmodified lines2122232425242526272829303132333435363738392728293031323334353637383940404142434445424344454646474849504849505152535455565758596061626364656667685152535422 unmodified lines77787997988081821001011021031041051061078384858687888990919220 unmodified linesimport json
# Coder's specialized system prompt (v3.2 - no search, no list_files, uses exploration context)CODER_SYSTEM_PROMPT = """You are an expert software engineer and implementation specialist.# Coder's specialized system prompt (v3.3 - no exploration, write code immediately)CODER_SYSTEM_PROMPT = """You are an expert software engineer. Your ONLY job is to WRITE CODE.
=== CRITICAL RULES ===1. START WRITING CODE IMMEDIATELY with write_file2. DO NOT run ls, find, pwd, or any exploration commands3. DO NOT try to access /tmp/codepilot_repos/ from sandbox - IT WILL FAIL4. Use file paths EXACTLY as shown in the exploration results5. The sandbox is ISOLATED - it cannot see the cloned repo
=== YOUR WORKFLOW ===1. Look at the EXPLORATION RESULTS - they have all the file paths you need2. Look at the PLAN - it tells you exactly what to create3. Use write_file to create/modify files in the repo4. (Optional) Test your code by uploading to sandbox with relative paths
Your ONLY job is to write code that implements the given plan. You do NOT explore or search.
=== CRITICAL: USE THE PROVIDED CONTEXT ===The Explorer agent has ALREADY searched the codebase for you. All file paths and code patterns are in the EXPLORATION RESULTS below.
DO NOT:- Navigate directories (no list_files)- Search for files (no searching)- Explore the codebase
DO:- Use the exact file paths from exploration results- Start writing code immediately- Follow the plan step by step=== TOOLS ===- write_file: CREATE OR MODIFY FILES - use this immediately!- get_code_chunk: Read a specific function if you need to see existing code- upload_to_sandbox: Upload YOUR code for testing (use relative paths like "app.py")- run_command_in_sandbox: Run YOUR uploaded code (like "python app.py")
=== WORKFLOW ===1. Read the exploration results - they contain all file paths you need2. If modifying existing code: use get_code_chunk to read the specific function3. Write your changes with write_file using paths from exploration4. Test in sandbox if needed=== EXAMPLE ===If plan says "create examples/health_check/app.py":✅ CORRECT: write_file(path="/tmp/codepilot_repos/flask_xxx/examples/health_check/app.py", content="...")❌ WRONG: run_command_in_sandbox("ls /tmp/codepilot_repos/...") <-- sandbox can't access this!
=== TOOLS ===- get_file_outline: See file structure (use if unsure about a file)- get_code_chunk: Read ONE specific function/class- read_file: Read entire file (only when rewriting whole file)- write_file: Create or modify files- upload_to_sandbox: Upload files for testing- run_command_in_sandbox: Run tests in sandbox- execute_in_sandbox: Execute Python snippets
=== SANDBOX WORKFLOW ===When testing in sandbox:1. Upload with RELATIVE path: upload_to_sandbox(path="file.py", content=code)2. Run with RELATIVE path: run_command_in_sandbox(command="python file.py")3. The sandbox CANNOT access /tmp/codepilot_repos/ - use simple filenames!
Your code should be:- Clean (follow existing code style)- Minimal (only change what's necessary)- Follow the plan exactly
START CODING IMMEDIATELY - do not explore!DO NOT EXPLORE. WRITE CODE NOW."""
22 unmodified lines
self.conversation = ConversationManager()
# v3.2: Removed list_files - Explorer provides all paths needed # Coder only needs: read, write, and sandbox tools # v3.3: Minimal tools - focus on writing code # Removed sandbox commands that were being misused for exploration self.allowed_tools = [ "get_file_outline", # Get file structure without full code "get_code_chunk", # Extract specific function/class by name "read_file", # Full file contents (use sparingly) "write_file", # Create or modify files # "list_files" REMOVED - use exploration context instead "upload_to_sandbox", # Upload files for testing "run_command_in_sandbox", # Run tests in sandbox "execute_in_sandbox" # Execute Python snippets "write_file", # PRIMARY TOOL - create or modify files "get_code_chunk", # Read specific function/class if needed "read_file", # Read entire file (only when rewriting) "upload_to_sandbox", # Upload code for testing "execute_in_sandbox" # Execute Python snippets for testing # REMOVED: run_command_in_sandbox - was being misused for ls/find # REMOVED: get_file_outline - Coder should use exploration context ]
def run(8 unmodified lines9101112121314158 unmodified lines"""
# VERSION CHECK - If you see this, new code is running!ORCHESTRATOR_VERSION = "3.3.0-clarify"ORCHESTRATOR_VERSION = "3.3.1-coder-strict"print(f"[ORCHESTRATOR] ========== LOADING VERSION {ORCHESTRATOR_VERSION} ==========")
from enum import EnumDockerfile+1-1
chainlit_app.py+2-2
codepilot/agents/coder_agent.py+34-52
codepilot/agents/orchestrator.py+1-1