open-swe/agent
Johannes du Plessis ccea80b887
feat: inline AGENTS.md into reviewer system prompt (#1328)
* feat(reviewer): inline AGENTS.md into reviewer system prompt

Fetches AGENTS.md from the PR's head_sha via the GitHub contents API
during reviewer setup and inlines it as a "Repository conventions"
block in the system prompt. Mirrors how the per-repo review style
prompt is already wired.

The main agent has long had a mandatory step to read AGENTS.md after
cloning, but the reviewer often skips cloning entirely (it can
`gh pr diff` directly), so it never saw the file. Loading it
deterministically means the reviewer judges findings against the
project's own conventions instead of relying on the model to fetch
the file itself.

* fix(reviewer): fetch AGENTS.md from base_sha, not head_sha

The reviewer inlines AGENTS.md into its system prompt. Reading from
head_sha means a PR author can edit AGENTS.md in the same PR being
reviewed and smuggle instructions like "ignore all bugs" / "publish
no findings" into the reviewer's prompt. Switch to base_sha (the
target branch's pre-PR state, which is trusted) and update the prompt
text to reflect that the contents come from the base, not the head.

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-05-22 14:58:27 -07:00
..
dashboard feat: auto-review PRs on opened / ready-for-review (#1325) 2026-05-22 13:36:14 -07:00
integrations feat: add idle TTL and delete-after-stop sandbox lifecycle controls (#1265) 2026-05-08 00:30:14 -04:00
middleware feat: add Agents chat UI for cloud threads (#1323) 2026-05-22 18:15:59 +00:00
tools feat: auto-review PRs on opened / ready-for-review (#1325) 2026-05-22 13:36:14 -07:00
utils feat: inline AGENTS.md into reviewer system prompt (#1328) 2026-05-22 14:58:27 -07:00
_patch_messages_reducer.py feat: add Agents chat UI for cloud threads (#1323) 2026-05-22 18:15:59 +00:00
encryption.py feat: support TOKEN_ENCRYPTION_KEY rotation via MultiFernet [closes AB-2323] (#1275) 2026-05-08 14:29:23 -07:00
prompt.py feat: restructure Open SWE Review tab + wire create_prs (#1319) 2026-05-21 09:17:07 -07:00
review_style_analyzer.py feat: add Agents chat UI for cloud threads (#1323) 2026-05-22 18:15:59 +00:00
review_style_collector.py feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
review_style_guidance.py feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
reviewer.py feat: inline AGENTS.md into reviewer system prompt (#1328) 2026-05-22 14:58:27 -07:00
reviewer_diff.py fix(open-swe): surface reviewer diff-prep failures instead of swallowing (#1260) 2026-05-07 18:20:27 -07:00
reviewer_findings.py feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
reviewer_publish.py fix: publish_review tool returns generic "Failed to POST PR review" without GitHub API status/body, agent retries with no signal (#1299) 2026-05-12 13:55:39 -07:00
server.py feat: add Agents chat UI for cloud threads (#1323) 2026-05-22 18:15:59 +00:00
webapp.py feat: auto-review PRs on opened / ready-for-review (#1325) 2026-05-22 13:36:14 -07:00