diff --git a/.forgejo/workflows/agent-test-deploy.yml b/.forgejo/workflows/agent-test-deploy.yml index 2975986..692f426 100644 --- a/.forgejo/workflows/agent-test-deploy.yml +++ b/.forgejo/workflows/agent-test-deploy.yml @@ -1,13 +1,6 @@ name: AI Agent - Test & Deploy on: - push: - branches: - - master - paths: - - 'mnemo_cards_web_v2/**' - - 'mnemo_cards_backend/**' - - 'mnemo_cards_common/**' workflow_dispatch: inputs: component: diff --git a/tools/agent/agent_orchestrator.py b/tools/agent/agent_orchestrator.py index 8a5a64a..0c9f2fb 100644 --- a/tools/agent/agent_orchestrator.py +++ b/tools/agent/agent_orchestrator.py @@ -710,7 +710,7 @@ This PR contains changes for task {task.id} completed by AI Agent. print(f"❌ Failed to create PR: {e}") return False -git def _create_branch_and_pr(self, task: Task) -> bool: + def _create_branch_and_pr(self, task: Task) -> bool: """Create a feature branch and PR for the task.""" # Get current task if not provided if not task: diff --git a/tools/agent/config.py b/tools/agent/config.py index ea341a4..37f2f78 100644 --- a/tools/agent/config.py +++ b/tools/agent/config.py @@ -77,7 +77,7 @@ class AgentConfig: max_retries=int(os.getenv("MAX_RETRIES", "3")), timeout_hours=int(os.getenv("TIMEOUT_HOURS", "6")), cursor_api_key=os.getenv("CURSOR_API_KEY"), - cursor_model=os.getenv("CURSOR_MODEL", "claude-3-5-sonnet-20241022"), + cursor_model=os.getenv("CURSOR_MODEL", "auto"), forgejo_token=os.getenv("FORGEJO_TOKEN"), forgejo_api_url=os.getenv("FORGEJO_API_URL") or os.getenv("GITHUB_API_URL"), commit_mode=os.getenv("COMMIT_MODE", "master"), diff --git a/tools/agent/cursor_cli_wrapper.py b/tools/agent/cursor_cli_wrapper.py index 1361150..ab2f4a5 100644 --- a/tools/agent/cursor_cli_wrapper.py +++ b/tools/agent/cursor_cli_wrapper.py @@ -39,7 +39,7 @@ class CursorCLI: def __init__(self, project_root: Path, api_key: str, - model: str = "claude-3-5-sonnet-20241022", + model: str = "auto", verbose: bool = True): self.project_root = project_root self.api_key = api_key @@ -123,13 +123,32 @@ class CursorCLI: # Add bash paths if they exist additional_paths = ":".join([p for p in bash_paths if os.path.exists(p)]) new_path = ":".join([additional_paths, current_path]) if additional_paths else current_path - + # Prepare environment variables env = { "CURSOR_API_KEY": self.api_key, - "CURSOR_MODEL": self.model, "PATH": new_path, } + # Prepare command + cmd = [self.cursor_agent_path] + + # Add model flag if provided + if self.model: + cmd.extend(["--model", self.model]) + + # Add prompt + cmd.append(task_description) + + # Add options + cmd.extend(["--output-format", "stream-json"]) + cmd.append("--stream-partial-output") + + if force: + cmd.append("--force") + + # Add print mode (non-interactive) + cmd.append("-p") + if self.verbose: print(f"🚀 Running cursor-agent in {self.project_root}") print(f"📝 Task: {task_description[:100]}...") diff --git a/tools/agent/doc_updater.py b/tools/agent/doc_updater.py index 529daec..c800228 100644 --- a/tools/agent/doc_updater.py +++ b/tools/agent/doc_updater.py @@ -12,7 +12,7 @@ def main(): """Main entry point.""" parser = argparse.ArgumentParser(description="Update documentation for a component") parser.add_argument("component", choices=["web_v2", "backend", "common"], help="Component to document") - parser.add_argument("--model", default="claude-3-5-sonnet-20241022", help="LLM model to use") + parser.add_argument("--model", default="auto", help="LLM model to use") args = parser.parse_args()