Repository navigation
feat(delegation): harden governed delegation for enablement (#11266) - #11276
Merged
Merged
Conversation
…an-out guards, observability, validation plan (#11266)
Applied Black, isort, and autoflake to match code-quality checks. Triggered by workflow auto-fix-formatting.yml.
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
This was referenced Jul 8, 2026
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thinking Path
The governed subagent runner (
chat_workflow/delegation.py, #11207) is built and depth-bounded but dormant behindAUTOBOT_DELEGATION_ENABLED(default OFF). Rather than flip it blindly, this hardens the enforcement and documents a validation plan so enabling becomes a safe one-line config change.What Changed
chat_workflow/delegation.py: switched rawos.environreads to canonicalenv_flag/env_int(fixes a latent bug whereAUTOBOT_DELEGATION_ENABLED=onwas silently ignored); addedMAX_DELEGATIONS_PER_TURN(default 5); addedparent_agent_idobservability torun_delegated_subtask; added an "Enablement / validation plan" checklist docstring. Flag stays OFF by default.chat_workflow/tool_handler.py: enforces the per-turn delegation fan-out limit and threadsparent_agent_idthrough. Depth bound remains enforced centrally inrun_delegated_subtask(both engines).Verification
chat_workflow/delegation_test.py— 21 passed (no-op when flag OFF, depth-limit rejectsdepth=MAX, per-turn fan-out limit, forbidden-work enforced, observability).Closes #11266
Model Used
Claude Opus 4.8