diff --git a/apps/agent/agent/prompt.py b/apps/agent/agent/prompt.py index ad94bfbf..85adab26 100644 --- a/apps/agent/agent/prompt.py +++ b/apps/agent/agent/prompt.py @@ -73,7 +73,7 @@ def construct_system_prompt( working_dir: str, linear_project_id: str = "", linear_issue_number: str = "", - agents_md: str | None = None, + agents_md: str = "", ) -> str: agents_md_section = "" if agents_md: diff --git a/apps/agent/agent/server.py b/apps/agent/agent/server.py index 1dad6586..eb297579 100644 --- a/apps/agent/agent/server.py +++ b/apps/agent/agent/server.py @@ -140,7 +140,6 @@ async def _clone_or_pull_repo_in_sandbox( # noqa: PLR0915 logger.info("Repo updated at %s", repo_dir) return repo_dir - # If we reach here, repo doesn't exist or is invalid - clone it logger.info("Cloning repo %s/%s to %s", owner, repo, repo_dir) try: result = await loop.run_in_executor( @@ -325,6 +324,10 @@ async def get_agent(config: RunnableConfig) -> Pregel: # noqa: PLR0915 SANDBOX_BACKENDS[thread_id] = sandbox_backend + if not repo_dir: + msg = "repo_dir is not defined; cannot operate without a cloned repository" + raise RuntimeError(msg) + linear_issue = config["configurable"].get("linear_issue", {}) linear_project_id = linear_issue.get("linear_project_id", "") linear_issue_number = linear_issue.get("linear_issue_number", "") diff --git a/apps/agent/agent/utils/agents_md.py b/apps/agent/agent/utils/agents_md.py index 715de9f9..6afd63e7 100644 --- a/apps/agent/agent/utils/agents_md.py +++ b/apps/agent/agent/utils/agents_md.py @@ -31,6 +31,4 @@ async def read_agents_md_in_sandbox( return None content = result.output or "" content = content.strip() - if content: - logger.info("Loaded AGENTS.md from %s", safe_agents_path) return content or None