mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 18:33:15 +00:00
fix: include resolved repo in Linear prompt to prevent repo ambiguity (#1307)
The Linear webhook (`process_linear_issue` in `agent/webapp.py`) was the only trigger whose user prompt did not surface the resolved repo to the LLM: - Slack: `## Default Repository Hint` (line 947) - GitHub issue: `## Repository: ...` (`build_github_issue_prompt`, line 1443) - GitHub PR: `## Repository: ...` (`build_github_pr_review_prompt`, line 1526) - Linear: (missing) `configurable["repo"]` was still being set and consumed by `commit_and_open_pr`, but the agent itself never saw it. For tasks routed via Linear team/project mapping, the LLM had to guess which repo to clone — frequently falling back to `langchain-ai/open-swe` (via `SELF_AWARENESS_SECTION` in `agent/prompt.py`) or `langchain-ai/langchainplus` (via `default_prompt.md`), silently targeting the wrong repository. This is a regression: commit5e4c6bb8on branch `yogesh/stop-auto-cloning` ("fix: include resolved repo in Linear prompt to prevent repo ambiguity", 2026-03-16) added this exact line, but it was dropped when that branch was squash-merged as PR #1159 ("feat: stop auto-cloning and let agent manage repo setup",2039fe66, 2026-04-10). Subsequent refactors (e215f1ef,f662ad65) preserved the gap. Adding the line back mirrors the GitHub/Slack prompt builders and matches the rationale ofe215f1ef("Linear team/project mapping handles per-team routing"): routing is correct, the prompt just wasn't propagating it. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
This commit is contained in:
parent
27677c4949
commit
6b005cfb67
1 changed files with 1 additions and 0 deletions
|
|
@ -774,6 +774,7 @@ async def process_linear_issue( # noqa: PLR0912, PLR0915
|
|||
)
|
||||
prompt = (
|
||||
f"Please work on the following issue:\n\n"
|
||||
f"## Repository: {repo_config.get('owner')}/{repo_config.get('name')}\n\n"
|
||||
f"## Title: {title}\n\n"
|
||||
f"{triggered_by_line}"
|
||||
f"## Linear Ticket: {identifier} - Ticket ID: {issue_id}\n\n"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue