mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-07 00:02:12 +00:00
address review comments on AGENTS.md injection
This commit is contained in:
parent
66bd62b69b
commit
b8f5b735e2
3 changed files with 5 additions and 4 deletions
|
|
@ -73,7 +73,7 @@ def construct_system_prompt(
|
||||||
working_dir: str,
|
working_dir: str,
|
||||||
linear_project_id: str = "",
|
linear_project_id: str = "",
|
||||||
linear_issue_number: str = "",
|
linear_issue_number: str = "",
|
||||||
agents_md: str | None = None,
|
agents_md: str = "",
|
||||||
) -> str:
|
) -> str:
|
||||||
agents_md_section = ""
|
agents_md_section = ""
|
||||||
if agents_md:
|
if agents_md:
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,6 @@ async def _clone_or_pull_repo_in_sandbox( # noqa: PLR0915
|
||||||
logger.info("Repo updated at %s", repo_dir)
|
logger.info("Repo updated at %s", repo_dir)
|
||||||
return 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)
|
logger.info("Cloning repo %s/%s to %s", owner, repo, repo_dir)
|
||||||
try:
|
try:
|
||||||
result = await loop.run_in_executor(
|
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
|
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_issue = config["configurable"].get("linear_issue", {})
|
||||||
linear_project_id = linear_issue.get("linear_project_id", "")
|
linear_project_id = linear_issue.get("linear_project_id", "")
|
||||||
linear_issue_number = linear_issue.get("linear_issue_number", "")
|
linear_issue_number = linear_issue.get("linear_issue_number", "")
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,4 @@ async def read_agents_md_in_sandbox(
|
||||||
return None
|
return None
|
||||||
content = result.output or ""
|
content = result.output or ""
|
||||||
content = content.strip()
|
content = content.strip()
|
||||||
if content:
|
|
||||||
logger.info("Loaded AGENTS.md from %s", safe_agents_path)
|
|
||||||
return content or None
|
return content or None
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue