Skip to content

[PUP-528] feat: add configurable global sub-agent recursion limit#662

Merged
mpfaffenberger merged 1 commit into
mpfaffenberger:mainfrom
thomwebb:feat/subagent-recursion-limit
Jul 21, 2026
Merged

[PUP-528] feat: add configurable global sub-agent recursion limit#662
mpfaffenberger merged 1 commit into
mpfaffenberger:mainfrom
thomwebb:feat/subagent-recursion-limit

Conversation

@thomwebb

@thomwebb thomwebb commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Jira

https://jira.walmart.com/browse/PUP-528

Summary

  • add a global subagent_recursion_limit setting with a default of 4
  • enforce the limit at the shared invocation seam for both sub-agent tools
  • preserve the stricter existing GPT-5.6 single-level recursion policy
  • expose the setting through /set; 0 disables sub-agent invocation
  • localize user-facing recursion errors and add focused boundary/config coverage

Closes #660

Semantics

  • main agent: depth 0
  • directly invoked sub-agent: depth 1
  • default limit 4: depths 1-4 are allowed; creating depth 5 is blocked
  • invalid or negative values fall back to 4

Validation

  • ruff check --fix .
  • ruff format .
  • full clean-environment suite: 12,436 passed, 81 skipped, 1 xpassed
  • adversarial review: LGTM
  • final post-rebase review: LGTM

GitHub issue

#660

Adds a configurable global recursion limit with a default of four while preserving the stricter GPT-5.6 caller policy.

Refs mpfaffenberger#660
@thomwebb
thomwebb force-pushed the feat/subagent-recursion-limit branch from 6ccf18b to b3b2fad Compare July 21, 2026 20:35
@thomwebb thomwebb changed the title feat: add configurable global sub-agent recursion limit [PUP-528] feat: add configurable global sub-agent recursion limit Jul 21, 2026
@mpfaffenberger
mpfaffenberger merged commit 350c5c6 into mpfaffenberger:main Jul 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add configurable global sub-agent recursion limit

2 participants