mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 08:03:15 +00:00
fix: warn against using http_request for GitHub PR creation (#1203)
* fix: warn against using http_request for GitHub PR creation - Root cause: http_request tool description and system prompt lacked explicit guidance not to use it for GitHub PR operations, causing the agent to fall back to it and receive 401 Unauthorized responses - Change: added clear warnings to both the http_request docstring and the TOOL_USAGE_SECTION in prompt.py directing agents to use commit_and_open_pr instead - Verified: docstring and prompt changes are minimal and scoped * fix: clarify http_request PR guidance --------- Co-authored-by: LangSmith Forge <forge-agent@langsmith.ai> Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
This commit is contained in:
parent
1a206c94d0
commit
0464126c83
2 changed files with 6 additions and 0 deletions
|
|
@ -138,6 +138,7 @@ Fetches a URL and converts HTML to markdown. Use for web pages. Synthesize the c
|
|||
|
||||
#### `http_request`
|
||||
Make HTTP requests (GET, POST, PUT, DELETE, etc.) to APIs. Use this for API calls with custom headers, methods, params, or request bodies — not for fetching web pages.
|
||||
Do not use this tool to create or update the pull request for completed code changes. Use `commit_and_open_pr` for that workflow so commits are pushed and GitHub authentication is handled correctly. For other PR-related actions, use the dedicated GitHub PR tools when available.
|
||||
|
||||
#### `commit_and_open_pr`
|
||||
Commits all changes, pushes to a branch, and opens a **draft** GitHub PR. If a PR already exists for the branch, it is updated instead of recreated.
|
||||
|
|
|
|||
|
|
@ -107,6 +107,11 @@ def http_request(
|
|||
) -> dict[str, Any]:
|
||||
"""Make HTTP requests to APIs and web services.
|
||||
|
||||
Do not use this tool to create or update the pull request for completed code
|
||||
changes. Use `commit_and_open_pr` for that workflow so commits are pushed and
|
||||
GitHub authentication is handled correctly. For other PR-related actions, use
|
||||
the dedicated GitHub PR tools when available.
|
||||
|
||||
Args:
|
||||
url: Target URL
|
||||
method: HTTP method (GET, POST, PUT, DELETE, etc.)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue