fix: drop hardcoded planning-agent ban from GPT-5.6 delegation guard - #864
Open
AndrewTilson wants to merge 1 commit into
Open
fix: drop hardcoded planning-agent ban from GPT-5.6 delegation guard#864AndrewTilson wants to merge 1 commit into
AndrewTilson wants to merge 1 commit into
Conversation
The GPT-5.6 prompt overlay hardcoded an instruction never to invoke the planning-agent sub-agent. Agents on any model matching gpt-5.6 refused to delegate to it, reporting a runtime prohibition that does not exist: enforcement in subagent_invocation is depth-based only, never name-based, and planning-agent remains listed by list_agents. Unlike the sibling depth cap, which is tunable via the subagent_recursion_limit_gpt_5_6 config key, this ban had no config escape hatch and no documented rationale. Refs: https://jira.walmart.com/browse/PUP-665
WSxDemise
reviewed
Aug 25, 2026
WSxDemise
left a comment
Collaborator
There was a problem hiding this comment.
[Wes's CodePuppy Agent Review]
Removes the GPT-5.6 prompt-level ban on planning-agent while retaining the configured depth cap. Scope is limited to the requested guard text; no user-facing strings or comments changed. PUP-665 AC4 remains incomplete because no guard-text test was added or updated. Qodo: not configured for OSS/public GitHub.
What you're being asked to change on this PR
- [P0] [AC NOT MET] Add coverage for the changed GPT-5.6 guard —
code_puppy/agents/_builder.py:548
| "Use `invoke_agent` only for focused work that benefits from separate " | ||
| "context or specialized tools. Handle work directly when you can. " | ||
| "Never invoke `planning-agent`. " | ||
| f"Hard cap: as a GPT-5.6 caller you may only invoke a sub-agent while " |
Collaborator
There was a problem hiding this comment.
[P0] [AC NOT MET] Add coverage for the changed GPT-5.6 guard
- Why: The removed prohibition can return without a regression signal, leaving PUP-665's required guard-text coverage unmet.
- Do: Add a focused test asserting the GPT-5.6 guard preserves the depth cap and omits the planning-agent prohibition.
Evidence
PUP-665 AC4 requires tests covering the GPT-5.6 guard text to be updated; this PR changes only _builder.py, and no test references _build_gpt_5_6_invoke_agent_guard_text or the removed literal.
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.
What
Removes a single hardcoded line from
_build_gpt_5_6_invoke_agent_guard_text()incode_puppy/agents/_builder.py:"Never invoke \`planning-agent\`. "Why
This string is appended to the system prompt of any agent whose model name contains
gpt-5.6(substring match via_is_gpt_5_6_family). The result is that GPT-5.6 agents refuse to delegate toplanning-agentand explain the refusal as a runtime prohibition.That explanation is misleading, because no such runtime block exists:
_invoke_agent_implincode_puppy/tools/subagent_invocation.pyrefuses only on depth grounds (_subagent_recursion_blocked/_gpt_5_6_recursion_blocked). There is no agent-name allow/deny list anywhere in the invocation path.planning-agentremains registered and visible inlist_agentsoutput, so users see an agent that is listed, appears invocable, and is nonetheless refused.The guard text is also appended last — after the system prompt, puppy rules, and the extended-thinking note — which maximises its salience for exactly the models that treat terse imperatives most literally.
Worth noting the inconsistency with its immediate neighbour: the sibling depth cap in the same function is user-tunable via the
subagent_recursion_limit_gpt_5_6config key and carries a comment explaining why the limit is read at prompt-assembly time. This agent-name ban had no config escape hatch and no stated rationale.Scope
One line deleted. The depth cap and the shell-safety overlay are untouched.
Testing
python -m py_compile code_puppy/agents/_builder.py— passespytest tests/test_subagent_invocation_usage.py— 51 passedtests/asserts on the removed stringNote for reviewers
If this ban was originally added to work around a specific GPT-5.6 failure mode (for example a planning-agent delegation loop), then removing it outright is the wrong fix and it should instead become a documented, config-gated option. I could not find a comment or commit message stating such a rationale, so this PR takes the straightforward reading. Happy to convert it to a config key if you know the backstory.
Ref: https://jira.walmart.com/browse/PUP-665