open-swe/agent
langsmith-forge-dev[bot] b5ed2a6b8b
fix: safety net middleware never fires due to key-existence check (#1051)
* fix: safety net middleware always skipped due to key-existence check

The open_pr_if_needed after-agent middleware checked `if 'success' in pr_payload`
which evaluates True for BOTH success and failure responses from commit_and_open_pr
(all responses include the 'success' key). This meant the safety net never fired.

Fix: use `pr_payload.get('success')` to check the VALUE instead of key existence.

Evidence: 6+ production traces in last 24h where commit_and_open_pr returned
success=False but the safety net silently skipped (non-fast-forward push failures,
missing GitHub token, workflow permission errors, API 500 errors).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* update

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Palash Shah <palash@langchain.dev>
2026-04-30 17:22:11 -07:00
..
integrations fix: lower default LangSmith sandbox size to fit "large" tier (#1226) 2026-04-30 13:24:15 -07:00
middleware fix: safety net middleware never fires due to key-existence check (#1051) 2026-04-30 17:22:11 -07:00
tools fix: add get_pr_review_comments tool to fetch PR review comments with auth (#1043) 2026-04-30 17:01:13 -07:00
utils feat: give agent ability to read cross-posted Slack message links [closes OPE-37] (#1200) 2026-04-29 17:42:27 -07:00
encryption.py chore: Drop monorepo (#1029) 2026-03-06 16:10:34 -08:00
prompt.py fix: add get_pr_review_comments tool to fetch PR review comments with auth (#1043) 2026-04-30 17:01:13 -07:00
server.py fix: add get_pr_review_comments tool to fetch PR review comments with auth (#1043) 2026-04-30 17:01:13 -07:00
webapp.py feat: give agent ability to read cross-posted Slack message links [closes OPE-37] (#1200) 2026-04-29 17:42:27 -07:00