open-swe/agent/tools
Johannes du Plessis 98b824bd54
feat: add size caps for PR diff, fetch_url, Slack threads, pagination, message queue [closes OPE-51] (#1567)
* feat: add size caps for PR diff, fetch_url, Slack threads, pagination, message queue

Per-source byte/token caps with explicit truncation markers to prevent
unbounded payloads from blowing up LLM context/memory.

- reviewer_diff.py: cap PR diff at 200K chars with head+tail truncation
- fetch_url.py: cap markdownify output at 100K chars
- slack.py: cap thread message fetch at 500 messages
- github_comments.py: cap _fetch_paginated at 50 pages
- thread_ops.py: cap queued messages at 100 (drop oldest)

Closes OPE-51

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>

* fix: compute diff line set from full diff, keep most recent Slack messages

Address PR review comments:

1. Truncated diffs rejected valid findings: fetch_pr_diff now returns the
   full diff; truncate_diff is called separately in reviewer.py so the
   line set used for add_finding/publish_review validation is computed
   from the complete diff, not the truncated prompt text.

2. Slack cap dropped recent thread context: fetch_slack_thread_messages
   now keeps the most recent SLACK_THREAD_MAX_MESSAGES messages (was
   keeping the oldest). The tool surfaces a truncation marker in the
   formatted output so the LLM knows the thread was truncated.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-06-17 15:40:59 -07:00
..
__init__.py feat: chat with your PR on the review page (#1534) 2026-06-15 17:17:30 -07:00
add_finding.py feat: disable out-of-diff reviewer findings (#1516) 2026-06-12 10:19:30 -07:00
fetch_url.py feat: add size caps for PR diff, fetch_url, Slack threads, pagination, message queue [closes OPE-51] (#1567) 2026-06-17 15:40:59 -07:00
http_request.py fix: harden http_request SSRF guard against DNS rebinding [closes AB-2321] (#1277) 2026-05-08 22:06:25 +00:00
linear_comment.py feat: move github workflows to gh cli (#1238) 2026-05-04 18:03:53 -07:00
linear_create_issue.py feat: add linear tools for listing teams, get/create/update/delete issues, and get issue comments (#1105) 2026-03-23 14:32:44 -07:00
linear_delete_issue.py feat: add linear tools for listing teams, get/create/update/delete issues, and get issue comments (#1105) 2026-03-23 14:32:44 -07:00
linear_get_issue.py feat: add linear tools for listing teams, get/create/update/delete issues, and get issue comments (#1105) 2026-03-23 14:32:44 -07:00
linear_get_issue_comments.py feat: add linear tools for listing teams, get/create/update/delete issues, and get issue comments (#1105) 2026-03-23 14:32:44 -07:00
linear_list_teams.py feat: add linear tools for listing teams, get/create/update/delete issues, and get issue comments (#1105) 2026-03-23 14:32:44 -07:00
linear_update_issue.py feat: add linear tools for listing teams, get/create/update/delete issues, and get issue comments (#1105) 2026-03-23 14:32:44 -07:00
list_findings.py fix: honest publish_review reporting + structured thread-not-found errors (#1481) 2026-06-10 10:44:13 -07:00
list_review_findings.py feat: chat with your PR on the review page (#1534) 2026-06-15 17:17:30 -07:00
open_pull_request.py feat: link Slack thread/Linear ticket in PRs and append ticket to title (#1504) 2026-06-11 15:52:40 -07:00
publish_review.py fix: point View trace link at the correct tracing project (#1521) 2026-06-13 09:37:15 -07:00
read_finding_outcomes.py feat: outcomes dataset + bootstrap/continual split via skills (#1365) 2026-06-01 13:25:12 -07:00
read_repo_file.py feat: chat with your PR on the review page (#1534) 2026-06-15 17:17:30 -07:00
reply_to_finding_thread.py fix: honest publish_review reporting + structured thread-not-found errors (#1481) 2026-06-10 10:44:13 -07:00
request_pr_review.py fix: route PR review requests through agent tool (#1340) 2026-05-27 10:29:43 -07:00
resolve_finding_thread.py fix: honest publish_review reporting + structured thread-not-found errors (#1481) 2026-06-10 10:44:13 -07:00
save_review_style.py feat: outcomes dataset + bootstrap/continual split via skills (#1365) 2026-06-01 13:25:12 -07:00
search_repo_code.py feat: chat with your PR on the review page (#1534) 2026-06-15 17:17:30 -07:00
slack_read_thread_messages.py feat: add size caps for PR diff, fetch_url, Slack threads, pagination, message queue [closes OPE-51] (#1567) 2026-06-17 15:40:59 -07:00
slack_thread_reply.py feat: add Slack Block Kit reply options (#1407) 2026-06-04 10:26:09 -07:00
update_finding.py fix: honest publish_review reporting + structured thread-not-found errors (#1481) 2026-06-10 10:44:13 -07:00
web_search.py fix: add Exa web search tool [closes: OPE-29] (#1133) 2026-03-25 16:24:31 -07:00