open-swe/agent/utils
langsmith-forge[bot] bd97678a5e
fix: prevent futile retry loop when commit_and_open_pr fails (#1210)
* fix: prevent futile retry loop when commit_and_open_pr fails with git/API errors

- Root cause: when git checkout or GitHub PR API fails, the tool returned a generic {"success": false} error with no signal that retrying is futile, causing the agent to loop 9-13+ times until hitting the 1000-step recursion limit
- Change: (1) git_checkout_branch now returns (bool, str) so the actual git error output is surfaced in the tool response; (2) checkout and PR creation failures now include "fatal": true and an explicit "Do not retry" message; (3) prompt.py COMMIT_PR_SECTION adds an explicit instruction to stop on fatal errors
- Verified: 109 unit tests pass, no regressions

* fix: skip PR safety net on fatal commit failures

* style(open_pr): ruff-format fatal retry skip condition

---------

Co-authored-by: LangSmith Forge <forge-agent@langsmith.ai>
Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
2026-05-01 22:05:22 +00:00
..
auth.py fix: log all exceptions (#1089) 2026-03-19 10:26:26 -07:00
authorship.py Revert "fix: Auto assign PRs to creator (#1211)" (#1214) 2026-04-22 13:46:44 -07:00
comments.py chore: Drop monorepo (#1029) 2026-03-06 16:10:34 -08:00
github.py fix: prevent futile retry loop when commit_and_open_pr fails (#1210) 2026-05-01 22:05:22 +00:00
github_app.py feat: add GitHub PR comment trigger and reply support [closes OPE-1] (#1014) 2026-03-09 17:14:13 -07:00
github_comments.py feat: stop auto-cloning and let agent manage repo setup [closes OPE-21] (#1159) 2026-04-10 17:04:55 -07:00
github_token.py fix(open_pr): reuse config for GitHub token; defer installation token lookup (#1227) 2026-04-30 17:48:15 -07:00
github_user_email_map.py adding myself as user (#1162) 2026-04-03 15:52:04 -07:00
langsmith.py fix: use thread-level LangSmith URLs instead of run-level URLs to fix broken trace links (#1217) 2026-04-23 13:46:28 -07:00
linear.py fix: use thread-level LangSmith URLs instead of run-level URLs to fix broken trace links (#1217) 2026-04-23 13:46:28 -07:00
linear_team_repo_map.py chore: Add langsmith deployments data plane linear project (#1044) 2026-03-09 18:36:00 -07:00
messages.py chore: Drop monorepo (#1029) 2026-03-06 16:10:34 -08:00
model.py feat(open-swe): Default to GPT-5.5 medium reasoning (#1224) 2026-04-28 15:03:21 -07:00
multimodal.py feat: add Slack image support with url_private auth and content-type validation [closes: OPE-23] (#1073) 2026-03-20 14:34:14 -07:00
repo.py feat: extract repo parsing into shared util, add linear comment repo override (#1103) 2026-03-20 13:34:00 -07:00
sandbox.py feat: migrate LangSmith sandbox creation to snapshot API (#1201) 2026-04-21 12:17:19 -07:00
sandbox_paths.py fix: better custom backend support (#1071) 2026-03-17 11:55:36 -07:00
sandbox_state.py fix: better custom backend support (#1071) 2026-03-17 11:55:36 -07:00
slack.py feat: give agent ability to read cross-posted Slack message links [closes OPE-37] (#1200) 2026-04-29 17:42:27 -07:00