feat(agent): add human-in-the-loop interrupt system#586
Open
jsamuel1 wants to merge 2 commits intostrands-agents:mainfrom
Open
feat(agent): add human-in-the-loop interrupt system#586jsamuel1 wants to merge 2 commits intostrands-agents:mainfrom
jsamuel1 wants to merge 2 commits intostrands-agents:mainfrom
Conversation
61c4af7 to
c8212dd
Compare
jsamuel1
added a commit
to jsamuel1/sdk-typescript
that referenced
this pull request
Mar 3, 2026
Combines the following feature branches: - feat/summarizing-conversation-manager (PR strands-agents#524) - feat/structured-output-integ-tests (PR strands-agents#588) - feat/interrupt-system (PR strands-agents#586) - feat/swarm-multi-agent (PR strands-agents#587) - feat/graph-multi-agent (PR strands-agents#594) All 1277 unit tests pass. No type errors.
c8212dd to
09dbc0a
Compare
09dbc0a to
106c923
Compare
Port the interrupt system from the Python SDK to TypeScript: - Interrupt class and InterruptException for pausing agent execution - BeforeToolCallEvent.interrupt() API for hook-based interrupts - BeforeToolCallEvent.cancelTool for tool cancellation without interrupt - Agent.resumeFromInterrupt() for resuming after human response - InterruptEvent stream event emitted when interrupts pause the loop - AgentResult.interrupts and stopReason 'interrupt' support - _InterruptState for tracking active interrupts and resume flow - Deferred tool execution on resume (skip model, re-execute pending tools)
106c923 to
91a1e0d
Compare
- Replace this.hooks with this._hooksRegistry in agent.ts - Replace AgentData with LocalAgent in InterruptEvent - Rewrite tests to use Plugin interface instead of HookProvider - Fix interrupt return path to use correct variables (modelMessage instead of modelResult which is out of scope) --- Prompt: review the tests and fix them
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.
Description
Port the interrupt system from the Python SDK to TypeScript, enabling human-in-the-loop workflows where hook callbacks can pause agent execution to request human input.
Changes
Interruptclass andInterruptExceptionfor pausing agent executionBeforeToolCallEvent.interrupt()API for hook-based interruptsBeforeToolCallEvent.cancelToolfor tool cancellation without interruptAgent.resumeFromInterrupt()for resuming after human responseInterruptEventstream event emitted when interrupts pause the loopAgentResult.interruptsandstopReason: 'interrupt'support_InterruptStatefor tracking active interrupts and resume flowTesting