Skip to content

fix(sdk): inherit parent interrupt_on for subagents - #2334

Merged
Eugene Yurtsev (eyurtsev) merged 10 commits into
mainfrom
hunter/subagent-hitl
Apr 2, 2026
Merged

Eugene Yurtsev (eyurtsev) merged 10 commits into
mainfrom
hunter/subagent-hitl

Conversation

@hntrl

@hntrl Hunter Lovell (hntrl) commented Mar 30, 2026

Copy link
Copy Markdown
Member

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.

@github-actions github-actions Bot added package:deepagents Changes related to the `deepagents` SDK and agent harness. package:evals Changes related to the evaluation suite, benchmarks, and Harbor integration. fix org:internal Issue or pull request created by a member of the `langchain-ai` GitHub organization. size: S Pull request with a small diff. labels Mar 30, 2026
@codspeed

codspeed Bot commented Mar 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 32 untouched benchmarks
⏩ 15 skipped benchmarks1


Comparing hunter/subagent-hitl (b2444b0) with main (914eb9e)

Open in CodSpeed

Footnotes

  1. 15 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@eyurtsev

Copy link
Copy Markdown
Collaborator

Should we expose also an ability to update interrupt_on (since subagent spec supports custom tools?)

@mdrxy Mason Daugherty (mdrxy) changed the title fix(sdk): inherit parent interrupt_on for subagents fix(sdk): inherit parent interrupt_on for subagents Mar 30, 2026
@github-actions github-actions Bot added size: M Pull request with a medium diff. and removed size: S Pull request with a small diff. labels Apr 2, 2026
@github-actions github-actions Bot added size: S Pull request with a small diff. and removed size: M Pull request with a medium diff. labels Apr 2, 2026
@eyurtsev
Eugene Yurtsev (eyurtsev) enabled auto-merge (squash) April 2, 2026 17:40
@eyurtsev
Eugene Yurtsev (eyurtsev) merged commit acad9bb into main Apr 2, 2026
30 checks passed
@eyurtsev
Eugene Yurtsev (eyurtsev) deleted the hunter/subagent-hitl branch April 2, 2026 17:47
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

org:internal Issue or pull request created by a member of the `langchain-ai` GitHub organization. package:deepagents Changes related to the `deepagents` SDK and agent harness. package:evals Changes related to the evaluation suite, benchmarks, and Harbor integration. size: S Pull request with a small diff.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants