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:
AndyMik90
2025-12-18 20:03:46 +01:00
parent 9106038a17
commit 3d24f8f59e
3 changed files with 10 additions and 8 deletions
+3 -3
View File
@@ -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)
+4 -2
View 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,
+3 -3
View File
@@ -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)