v3.3.1: Strict Coder - no sandbox exploration commands
Browse filesFiles changed (4)
12345# HuggingFace Spaces Dockerfile for CodePilot# BUILD_VERSION: 9 (v3.3.0 clarifying questions)FROM python:3.11-slim# Set working directory12345# HuggingFace Spaces Dockerfile for CodePilot# BUILD_VERSION: 10 (v3.3.1 coder strict - no sandbox exploration)FROM python:3.11-slim# Set working directory
19 unmodified lines202122232425262719 unmodified lines# ============================================================# STARTUP VERSION CHECK - Change this to detect if rebuild worked# ============================================================APP_VERSION = "3.3.0-clarify"BUILD_ID = "2024-12-19-v8"print("=" * 60)print(f"[STARTUP] CodePilot Chainlit App")print(f"[STARTUP] APP_VERSION: {APP_VERSION}")19 unmodified lines202122232425262719 unmodified lines# ============================================================# STARTUP VERSION CHECK - Change this to detect if rebuild worked# ============================================================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 lines21222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707122 unmodified lines94959697989910010110210310410510610710810911020 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.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 codebaseDO:- Use the exact file paths from exploration results- Start writing code immediately- Follow the plan step by step=== 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=== 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 exactlySTART CODING IMMEDIATELY - do not explore!"""22 unmodified linesself.conversation = ConversationManager()# v3.2: Removed list_files - Explorer provides all paths needed# Coder only needs: read, write, and sandbox toolsself.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]def run(20 unmodified lines2122232425262728293031323334353637383940414243444546474849505152535422 unmodified lines7778798081828384858687888990919220 unmodified linesimport json# 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=== 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")=== 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!DO NOT EXPLORE. WRITE CODE NOW."""22 unmodified linesself.conversation = ConversationManager()# v3.3: Minimal tools - focus on writing code# Removed sandbox commands that were being misused for explorationself.allowed_tools = ["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 lines91011121314158 unmodified lines"""# VERSION CHECK - If you see this, new code is running!ORCHESTRATOR_VERSION = "3.3.0-clarify"print(f"[ORCHESTRATOR] ========== LOADING VERSION {ORCHESTRATOR_VERSION} ==========")from enum import Enum8 unmodified lines91011121314158 unmodified lines"""# VERSION CHECK - If you see this, new code is running!ORCHESTRATOR_VERSION = "3.3.1-coder-strict"print(f"[ORCHESTRATOR] ========== LOADING VERSION {ORCHESTRATOR_VERSION} ==========")from enum import Enum
Dockerfile+1-1
chainlit_app.py+2-2
codepilot/agents/coder_agent.py+34-52
codepilot/agents/orchestrator.py+1-1