fix(sdk): inherit parent interrupt_on for subagents - #2334
Merged
Merged
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Collaborator
|
Should we expose also an ability to update interrupt_on (since subagent spec supports custom tools?) |
interrupt_on for subagents
Eugene Yurtsev (eyurtsev)
enabled auto-merge (squash)
April 2, 2026 17:40
james8814
pushed a commit
to james8814/deepagents
that referenced
this pull request
May 1, 2026
) This change fixes inconsistent HITL behavior across subagents by making declarative custom subagents inherit the parent agent `interrupt_on` config when they do not define their own. Previously, parent `interrupt_on` was wired into the default general-purpose subagent but not propagated as a default to custom `SubAgent` specs, leading to different approval behavior for equivalent tool calls. ## Changes - `libs/deepagents/deepagents/graph.py` - Stops attaching `HumanInTheLoopMiddleware` directly to the general-purpose subagent middleware stack. - Propagates parent `interrupt_on` into the generated general-purpose subagent spec. - Propagates parent `interrupt_on` as a default for each declarative custom subagent spec, while preserving per-subagent override semantics. - `libs/evals/tests/evals/test_hitl.py` - Adds a LangSmith HITL integration test that validates a custom subagent without explicit `interrupt_on` inherits parent interrupt policy and interrupts the expected tools. --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
james8814
pushed a commit
to james8814/deepagents
that referenced
this pull request
May 1, 2026
Merges upstream-sync-round11 into master. Key upstream changes: - fix: remove legacy subagents API (langchain-ai#2443) — backward-compat shim retained - fix: inherit parent interrupt_on for subagents (langchain-ai#2334) - fix: plumb through generics for create_deep_agent (langchain-ai#2383) - fix: improvements in sandbox.write/read (langchain-ai#2321) - fix(acp): block dangerous shell patterns (langchain-ai#2308) - chore: update unset logic (langchain-ai#2435) - feat(evals): auto-regenerate eval catalog (langchain-ai#2432) - Various evals CI improvements, deps bumps (aiohttp, anthropic, litellm) Local fixes: - Restore local enhancements (logging, stream_writer, skills_allowlist, _EXCLUDED_STATE_KEYS expansion) - Manual langchain>=1.2.15 dependency extraction (version kept at 0.5.0) - Regenerate EVAL_CATALOG.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> # Conflicts: # libs/acp/deepagents_acp/server.py # libs/acp/uv.lock # libs/deepagents/deepagents/middleware/subagents.py
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
) This change fixes inconsistent HITL behavior across subagents by making declarative custom subagents inherit the parent agent `interrupt_on` config when they do not define their own. Previously, parent `interrupt_on` was wired into the default general-purpose subagent but not propagated as a default to custom `SubAgent` specs, leading to different approval behavior for equivalent tool calls. ## Changes - `libs/deepagents/deepagents/graph.py` - Stops attaching `HumanInTheLoopMiddleware` directly to the general-purpose subagent middleware stack. - Propagates parent `interrupt_on` into the generated general-purpose subagent spec. - Propagates parent `interrupt_on` as a default for each declarative custom subagent spec, while preserving per-subagent override semantics. - `libs/evals/tests/evals/test_hitl.py` - Adds a LangSmith HITL integration test that validates a custom subagent without explicit `interrupt_on` inherits parent interrupt policy and interrupts the expected tools. --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
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.
This change fixes inconsistent HITL behavior across subagents by making declarative custom subagents inherit the parent agent
interrupt_onconfig when they do not define their own. Previously, parentinterrupt_onwas wired into the default general-purpose subagent but not propagated as a default to customSubAgentspecs, leading to different approval behavior for equivalent tool calls.Changes
libs/deepagents/deepagents/graph.pyHumanInTheLoopMiddlewaredirectly to the general-purpose subagent middleware stack.interrupt_oninto the generated general-purpose subagent spec.interrupt_onas a default for each declarative custom subagent spec, while preserving per-subagent override semantics.libs/evals/tests/evals/test_hitl.pyinterrupt_oninherits parent interrupt policy and interrupts the expected tools.