Skip to content

[FEATURE] Expand interrupt support to all hook events #1588

@nagabharann

Description

@nagabharann

Problem Statement

Interrupts are currently only available for tools in one specific hook (AfterToolCallEvent). This limits the ability to implement checkpointing and branching capabilities at other points in the agent lifecycle. We need the ability to interrupt agent execution from any hook event to support advanced durability patterns.

Proposed Solution

Extend the interrupt mechanism to all hook events (e.g., BeforeModelInvocationEvent, AfterModelInvocationEvent, BeforeToolCallEvent, AgentInitializedEvent, etc.). This would allow hook implementations to signal an interrupt at any point in the agent execution flow.

Use Case

We are building a durability plugin that provides checkpointing and branching capabilities for Strands agents. To implement this, we need to be able to pause agent execution at various points—not just after tool calls. For example:

  1. Checkpoint before a model invocation to preserve state
  2. Interrupt before a tool call to implement approval workflows
  3. Branch execution paths based on conditions evaluated at different lifecycle stages

Alternatives Solutions

We have implemented workarounds by manipulating internal state, but this is fragile and not officially supported.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions