fix: correct path resolution in runners for module imports and .env loading
The runners in auto-claude/runners/ were using incorrect relative paths that only went up one directory level instead of two, causing: - ModuleNotFoundError for 'debug' module - Missing .env file (CLAUDE_CODE_OAUTH_TOKEN not found) - Script not found errors for analyzer.py - Prompt files not found for agent execution Fixed paths in: - roadmap_runner.py: sys.path and .env now resolve to auto-claude/ - ideation_runner.py: sys.path and .env now resolve to auto-claude/ - roadmap/executor.py: scripts_base_dir and prompts_dir now resolve correctly from the nested roadmap/ subdirectory 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,12 +24,12 @@ import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Add auto-claude to path
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
# Load .env file
|
||||
# Load .env file from auto-claude/ directory
|
||||
from dotenv import load_dotenv
|
||||
|
||||
env_file = Path(__file__).parent / ".env"
|
||||
env_file = Path(__file__).parent.parent / ".env"
|
||||
if env_file.exists():
|
||||
load_dotenv(env_file)
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ class ScriptExecutor:
|
||||
|
||||
def __init__(self, project_dir: Path):
|
||||
self.project_dir = project_dir
|
||||
self.scripts_base_dir = Path(__file__).parent.parent
|
||||
# Go up from roadmap/ -> runners/ -> auto-claude/
|
||||
self.scripts_base_dir = Path(__file__).parent.parent.parent
|
||||
|
||||
def run_script(self, script: str, args: list[str]) -> tuple[bool, str]:
|
||||
"""Run a Python script and return (success, output)."""
|
||||
@@ -76,7 +77,8 @@ class AgentExecutor:
|
||||
self.output_dir = output_dir
|
||||
self.model = model
|
||||
self.create_client = create_client_func
|
||||
self.prompts_dir = Path(__file__).parent.parent / "prompts"
|
||||
# Go up from roadmap/ -> runners/ -> auto-claude/prompts/
|
||||
self.prompts_dir = Path(__file__).parent.parent.parent / "prompts"
|
||||
|
||||
async def run_agent(
|
||||
self,
|
||||
|
||||
@@ -18,12 +18,12 @@ import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Add auto-claude to path
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
# Load .env file
|
||||
# Load .env file from auto-claude/ directory
|
||||
from dotenv import load_dotenv
|
||||
|
||||
env_file = Path(__file__).parent / ".env"
|
||||
env_file = Path(__file__).parent.parent / ".env"
|
||||
if env_file.exists():
|
||||
load_dotenv(env_file)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user