address review comments on AGENTS.md injection

This commit is contained in:
aran-yogesh 2026-02-23 16:52:15 -08:00
parent 66bd62b69b
commit b8f5b735e2
3 changed files with 5 additions and 4 deletions

View file

@ -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:

View file

@ -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", "")

View file

@ -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