open-swe/agent
langsmith-forge[bot] e5bc27a0ad
fix: notify users via Slack when agent hits model call step limit (#1204)
* fix: notify users via Slack when agent hits model call step limit

- Root cause: GraphRecursionError at 1000 steps bypassed all @after_agent
  middleware including open_pr_if_needed, leaving users with no notification
- Change: Added ModelCallLimitMiddleware(run_limit=60) to intercept gracefully
  before the hard recursion limit, and added notify_step_limit_reached
  @after_agent middleware to post a Slack thread reply when the limit fires
- Verified: 107 existing tests pass, no regressions

* fix: harden step-limit Slack notification

Ensure the step-limit notification runs after the PR safety net and cover the new middleware behavior with focused unit tests.

---------

Co-authored-by: LangSmith Forge <forge-agent@langsmith.ai>
Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
2026-05-01 14:24:25 -07:00
..
integrations fix: lower default LangSmith sandbox size to fit "large" tier (#1226) 2026-04-30 13:24:15 -07:00
middleware fix: notify users via Slack when agent hits model call step limit (#1204) 2026-05-01 14:24:25 -07:00
tools fix: warn against using http_request for GitHub PR creation (#1203) 2026-05-01 14:14:44 -07:00
utils fix: update existing PR title and body when create returns 422 (#1163) 2026-05-01 14:02:39 -07:00
encryption.py chore: Drop monorepo (#1029) 2026-03-06 16:10:34 -08:00
prompt.py fix: warn against using http_request for GitHub PR creation (#1203) 2026-05-01 14:14:44 -07:00
server.py fix: notify users via Slack when agent hits model call step limit (#1204) 2026-05-01 14:24:25 -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