open-swe/agent/tools/__init__.py

59 lines
1.8 KiB
Python
Raw Normal View History

from .commit_and_open_pr import commit_and_open_pr
from .edit_pull_request import edit_pull_request
from .fetch_url import fetch_url
feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] (#1159) * feat: authenticate git operations via sandbox proxy instead of credential files * feat: authenticate git operations via sandbox proxy instead of credential files * feat: authenticate git operations via sandbox proxy instead of credential files * removing logger.info * formatting and linting * fix: resolve lint errors in server.py (imports, unused vars, undefined names) * feat: use opaque proxy headers for GitHub auth in sandbox * linting formatting and test changes * linting * Delete .claude directory * Delete tests/evals directory * fix: address PR review — guard missing tokens, quote shell paths, add proxy auth tests * fix: restore authorship, branch_name support, and installation token for PR creation * linitng * fix: move installation token fetch before commit, clean up dead proxy validation code * feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] * feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] * fix: address review feedback — restore agents_md, add git user config, lint fixes * fix: drop github_token arg from sandbox creation, use generic create_sandbox factory with langsmith-only proxy config * fix: use _get_langsmith_api_key() for prod key fallback, warn when API key missing for proxy config * linting * linting * feat: add installation token auth to list_repos GitHub API call * agents.md update * linting * fix: address PR review feedback — shell precedence bug in prompt, remove dead code * linting * Apply suggestion from @bracesproul Co-authored-by: Brace Sproul <braceasproul@gmail.com> * Apply suggestion from @bracesproul Co-authored-by: Brace Sproul <braceasproul@gmail.com> * fix: address PR review feedback — restore {working_dir} in prompt, remove clone code block * fix:Extract check_or_recreate_sandbox utility from inline sandbox health check * fix: address PR review feedback — async list_repos, restore template name, fix prompt colon * fix: resolve merge conflicts with main, adopt deepagents v0.5.0a4 LangSmithSandbox * linting * yogesh/ope-21-stop-auto-cloning * Update agent/tools/list_repos.py Co-authored-by: Brace Sproul <braceasproul@gmail.com> * Update agent/prompt.py Co-authored-by: Brace Sproul <braceasproul@gmail.com> * feat: address PR review — list_repos uses GitHub API only, PR trigger includes org/repo * linting * feat: address PR review feedback — list_repos pagination, simpler return, sandbox health check * feat: support listing repos for personal user accounts via is_organization flag --------- Co-authored-by: Brace Sproul <braceasproul@gmail.com>
2026-04-10 17:04:55 -07:00
from .get_branch_name import get_branch_name
from .get_pr_review_comments import get_pr_review_comments
feat: add github CI check run tools for shepherding CI (#1121) * feat: add github CI check run tools for shepherding CI Add get_pr_check_runs and rerun_failed_check_runs tools that authenticate using the GitHub App installation token so the agent can query and retry CI status on private repos without relying on GH_TOKEN or unauthenticated http_request calls. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: handle paginated GitHub CI results * refactor(github_ci): address review feedback - Rename rerun_failed_check_runs -> rerun_failed_workflow_runs and clarify in docstrings that the tool only retries GitHub Actions workflow runs (not third-party CI checks surfaced by get_pr_check_runs). - Skip action_required workflow runs when rerunning; those need manual approval, not a rerun. - Run rerun-failed-jobs requests concurrently via asyncio.gather instead of sequentially. - Fix latent pagination bug in _fetch_paginated_items where caller-supplied params could overwrite per_page/page and break the end-of-pagination check; reserved keys now always win and the threshold uses a PER_PAGE constant. - Set an explicit 30s httpx timeout so a hung GitHub call cannot stall the agent loop. - Restore alphabetical ordering of tools in agent/tools/__init__.py. - Add tests for: a 500 surfaced on a later pagination page, and action_required runs being filtered out of rerun candidates. --------- Co-authored-by: Claude Agent <agent@anthropic.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
2026-05-01 12:19:04 -07:00
from .github_ci import get_pr_check_runs, rerun_failed_workflow_runs
from .github_comment import github_comment
from .github_review import (
create_pr_review,
dismiss_pr_review,
get_pr_review,
list_pr_review_comments,
list_pr_reviews,
submit_pr_review,
update_pr_review,
)
from .http_request import http_request
from .linear_comment import linear_comment
from .linear_create_issue import linear_create_issue
from .linear_delete_issue import linear_delete_issue
from .linear_get_issue import linear_get_issue
from .linear_get_issue_comments import linear_get_issue_comments
from .linear_list_teams import linear_list_teams
from .linear_update_issue import linear_update_issue
feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] (#1159) * feat: authenticate git operations via sandbox proxy instead of credential files * feat: authenticate git operations via sandbox proxy instead of credential files * feat: authenticate git operations via sandbox proxy instead of credential files * removing logger.info * formatting and linting * fix: resolve lint errors in server.py (imports, unused vars, undefined names) * feat: use opaque proxy headers for GitHub auth in sandbox * linting formatting and test changes * linting * Delete .claude directory * Delete tests/evals directory * fix: address PR review — guard missing tokens, quote shell paths, add proxy auth tests * fix: restore authorship, branch_name support, and installation token for PR creation * linitng * fix: move installation token fetch before commit, clean up dead proxy validation code * feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] * feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] * fix: address review feedback — restore agents_md, add git user config, lint fixes * fix: drop github_token arg from sandbox creation, use generic create_sandbox factory with langsmith-only proxy config * fix: use _get_langsmith_api_key() for prod key fallback, warn when API key missing for proxy config * linting * linting * feat: add installation token auth to list_repos GitHub API call * agents.md update * linting * fix: address PR review feedback — shell precedence bug in prompt, remove dead code * linting * Apply suggestion from @bracesproul Co-authored-by: Brace Sproul <braceasproul@gmail.com> * Apply suggestion from @bracesproul Co-authored-by: Brace Sproul <braceasproul@gmail.com> * fix: address PR review feedback — restore {working_dir} in prompt, remove clone code block * fix:Extract check_or_recreate_sandbox utility from inline sandbox health check * fix: address PR review feedback — async list_repos, restore template name, fix prompt colon * fix: resolve merge conflicts with main, adopt deepagents v0.5.0a4 LangSmithSandbox * linting * yogesh/ope-21-stop-auto-cloning * Update agent/tools/list_repos.py Co-authored-by: Brace Sproul <braceasproul@gmail.com> * Update agent/prompt.py Co-authored-by: Brace Sproul <braceasproul@gmail.com> * feat: address PR review — list_repos uses GitHub API only, PR trigger includes org/repo * linting * feat: address PR review feedback — list_repos pagination, simpler return, sandbox health check * feat: support listing repos for personal user accounts via is_organization flag --------- Co-authored-by: Brace Sproul <braceasproul@gmail.com>
2026-04-10 17:04:55 -07:00
from .list_repos import list_repos
from .slack_read_thread_messages import slack_read_thread_messages
from .slack_thread_reply import slack_thread_reply
from .web_search import web_search
__all__ = [
"commit_and_open_pr",
"create_pr_review",
"dismiss_pr_review",
"edit_pull_request",
"fetch_url",
feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] (#1159) * feat: authenticate git operations via sandbox proxy instead of credential files * feat: authenticate git operations via sandbox proxy instead of credential files * feat: authenticate git operations via sandbox proxy instead of credential files * removing logger.info * formatting and linting * fix: resolve lint errors in server.py (imports, unused vars, undefined names) * feat: use opaque proxy headers for GitHub auth in sandbox * linting formatting and test changes * linting * Delete .claude directory * Delete tests/evals directory * fix: address PR review — guard missing tokens, quote shell paths, add proxy auth tests * fix: restore authorship, branch_name support, and installation token for PR creation * linitng * fix: move installation token fetch before commit, clean up dead proxy validation code * feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] * feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] * fix: address review feedback — restore agents_md, add git user config, lint fixes * fix: drop github_token arg from sandbox creation, use generic create_sandbox factory with langsmith-only proxy config * fix: use _get_langsmith_api_key() for prod key fallback, warn when API key missing for proxy config * linting * linting * feat: add installation token auth to list_repos GitHub API call * agents.md update * linting * fix: address PR review feedback — shell precedence bug in prompt, remove dead code * linting * Apply suggestion from @bracesproul Co-authored-by: Brace Sproul <braceasproul@gmail.com> * Apply suggestion from @bracesproul Co-authored-by: Brace Sproul <braceasproul@gmail.com> * fix: address PR review feedback — restore {working_dir} in prompt, remove clone code block * fix:Extract check_or_recreate_sandbox utility from inline sandbox health check * fix: address PR review feedback — async list_repos, restore template name, fix prompt colon * fix: resolve merge conflicts with main, adopt deepagents v0.5.0a4 LangSmithSandbox * linting * yogesh/ope-21-stop-auto-cloning * Update agent/tools/list_repos.py Co-authored-by: Brace Sproul <braceasproul@gmail.com> * Update agent/prompt.py Co-authored-by: Brace Sproul <braceasproul@gmail.com> * feat: address PR review — list_repos uses GitHub API only, PR trigger includes org/repo * linting * feat: address PR review feedback — list_repos pagination, simpler return, sandbox health check * feat: support listing repos for personal user accounts via is_organization flag --------- Co-authored-by: Brace Sproul <braceasproul@gmail.com>
2026-04-10 17:04:55 -07:00
"get_branch_name",
feat: add github CI check run tools for shepherding CI (#1121) * feat: add github CI check run tools for shepherding CI Add get_pr_check_runs and rerun_failed_check_runs tools that authenticate using the GitHub App installation token so the agent can query and retry CI status on private repos without relying on GH_TOKEN or unauthenticated http_request calls. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: handle paginated GitHub CI results * refactor(github_ci): address review feedback - Rename rerun_failed_check_runs -> rerun_failed_workflow_runs and clarify in docstrings that the tool only retries GitHub Actions workflow runs (not third-party CI checks surfaced by get_pr_check_runs). - Skip action_required workflow runs when rerunning; those need manual approval, not a rerun. - Run rerun-failed-jobs requests concurrently via asyncio.gather instead of sequentially. - Fix latent pagination bug in _fetch_paginated_items where caller-supplied params could overwrite per_page/page and break the end-of-pagination check; reserved keys now always win and the threshold uses a PER_PAGE constant. - Set an explicit 30s httpx timeout so a hung GitHub call cannot stall the agent loop. - Restore alphabetical ordering of tools in agent/tools/__init__.py. - Add tests for: a 500 surfaced on a later pagination page, and action_required runs being filtered out of rerun candidates. --------- Co-authored-by: Claude Agent <agent@anthropic.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
2026-05-01 12:19:04 -07:00
"get_pr_check_runs",
"get_pr_review",
"get_pr_review_comments",
"github_comment",
"http_request",
"linear_comment",
"linear_create_issue",
"linear_delete_issue",
"linear_get_issue",
"linear_get_issue_comments",
"linear_list_teams",
"linear_update_issue",
feat: add github CI check run tools for shepherding CI (#1121) * feat: add github CI check run tools for shepherding CI Add get_pr_check_runs and rerun_failed_check_runs tools that authenticate using the GitHub App installation token so the agent can query and retry CI status on private repos without relying on GH_TOKEN or unauthenticated http_request calls. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: handle paginated GitHub CI results * refactor(github_ci): address review feedback - Rename rerun_failed_check_runs -> rerun_failed_workflow_runs and clarify in docstrings that the tool only retries GitHub Actions workflow runs (not third-party CI checks surfaced by get_pr_check_runs). - Skip action_required workflow runs when rerunning; those need manual approval, not a rerun. - Run rerun-failed-jobs requests concurrently via asyncio.gather instead of sequentially. - Fix latent pagination bug in _fetch_paginated_items where caller-supplied params could overwrite per_page/page and break the end-of-pagination check; reserved keys now always win and the threshold uses a PER_PAGE constant. - Set an explicit 30s httpx timeout so a hung GitHub call cannot stall the agent loop. - Restore alphabetical ordering of tools in agent/tools/__init__.py. - Add tests for: a 500 surfaced on a later pagination page, and action_required runs being filtered out of rerun candidates. --------- Co-authored-by: Claude Agent <agent@anthropic.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
2026-05-01 12:19:04 -07:00
"list_pr_review_comments",
"list_pr_reviews",
feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] (#1159) * feat: authenticate git operations via sandbox proxy instead of credential files * feat: authenticate git operations via sandbox proxy instead of credential files * feat: authenticate git operations via sandbox proxy instead of credential files * removing logger.info * formatting and linting * fix: resolve lint errors in server.py (imports, unused vars, undefined names) * feat: use opaque proxy headers for GitHub auth in sandbox * linting formatting and test changes * linting * Delete .claude directory * Delete tests/evals directory * fix: address PR review — guard missing tokens, quote shell paths, add proxy auth tests * fix: restore authorship, branch_name support, and installation token for PR creation * linitng * fix: move installation token fetch before commit, clean up dead proxy validation code * feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] * feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] * fix: address review feedback — restore agents_md, add git user config, lint fixes * fix: drop github_token arg from sandbox creation, use generic create_sandbox factory with langsmith-only proxy config * fix: use _get_langsmith_api_key() for prod key fallback, warn when API key missing for proxy config * linting * linting * feat: add installation token auth to list_repos GitHub API call * agents.md update * linting * fix: address PR review feedback — shell precedence bug in prompt, remove dead code * linting * Apply suggestion from @bracesproul Co-authored-by: Brace Sproul <braceasproul@gmail.com> * Apply suggestion from @bracesproul Co-authored-by: Brace Sproul <braceasproul@gmail.com> * fix: address PR review feedback — restore {working_dir} in prompt, remove clone code block * fix:Extract check_or_recreate_sandbox utility from inline sandbox health check * fix: address PR review feedback — async list_repos, restore template name, fix prompt colon * fix: resolve merge conflicts with main, adopt deepagents v0.5.0a4 LangSmithSandbox * linting * yogesh/ope-21-stop-auto-cloning * Update agent/tools/list_repos.py Co-authored-by: Brace Sproul <braceasproul@gmail.com> * Update agent/prompt.py Co-authored-by: Brace Sproul <braceasproul@gmail.com> * feat: address PR review — list_repos uses GitHub API only, PR trigger includes org/repo * linting * feat: address PR review feedback — list_repos pagination, simpler return, sandbox health check * feat: support listing repos for personal user accounts via is_organization flag --------- Co-authored-by: Brace Sproul <braceasproul@gmail.com>
2026-04-10 17:04:55 -07:00
"list_repos",
feat: add github CI check run tools for shepherding CI (#1121) * feat: add github CI check run tools for shepherding CI Add get_pr_check_runs and rerun_failed_check_runs tools that authenticate using the GitHub App installation token so the agent can query and retry CI status on private repos without relying on GH_TOKEN or unauthenticated http_request calls. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: handle paginated GitHub CI results * refactor(github_ci): address review feedback - Rename rerun_failed_check_runs -> rerun_failed_workflow_runs and clarify in docstrings that the tool only retries GitHub Actions workflow runs (not third-party CI checks surfaced by get_pr_check_runs). - Skip action_required workflow runs when rerunning; those need manual approval, not a rerun. - Run rerun-failed-jobs requests concurrently via asyncio.gather instead of sequentially. - Fix latent pagination bug in _fetch_paginated_items where caller-supplied params could overwrite per_page/page and break the end-of-pagination check; reserved keys now always win and the threshold uses a PER_PAGE constant. - Set an explicit 30s httpx timeout so a hung GitHub call cannot stall the agent loop. - Restore alphabetical ordering of tools in agent/tools/__init__.py. - Add tests for: a 500 surfaced on a later pagination page, and action_required runs being filtered out of rerun candidates. --------- Co-authored-by: Claude Agent <agent@anthropic.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
2026-05-01 12:19:04 -07:00
"rerun_failed_workflow_runs",
"slack_read_thread_messages",
"slack_thread_reply",
"submit_pr_review",
"update_pr_review",
"web_search",
]