You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[PORT] Restore a pending tool execution only for an activated interrupt state, and validate it (TS→Py) #5651
The change is complete in the source SDK, and every related artifact is listed above (source, tests, and docs, if the change has any).
Source PR:#5628 (fix(ts): ignore pending tool execution when interrupt state is not activated).
What #5628 adds in TS that Python lacks. The replay gate itself is already in Python (event_loop.py checks activated and pending_tool_execution is not None; #5628 added a Python test for it). The remaining delta is the restore path, which the PR body calls out as a separate follow-up:
InterruptState.fromJSON restores pendingToolExecution only when activated is true (strands-ts/src/interrupt.ts). _InterruptState.from_dict (strands-py/src/strands/interrupt.py:215-229) keeps a non-activated pending execution, including the legacy context.tool_use_message migration.
fromJSON validates the restored pending execution and raises SessionError naming the field: the message must parse, have role: 'assistant', carry at least one tool use, and every completed tool result must parse and match a tool-use id in that message. Python only catches TypeError from the dataclass constructor and raises SessionException (interrupt.py:216-222).
Filed by strandly-the-agent from the scheduled parity sync (window 2026-10-28 UTC). Port gate passes (one source file + tests, no new public API); a port PR follows.
Port PR: #5654 (port/interrupt-restore-validation-to-py). Review requested from @zastrowm (approver of the source PR #5628; its author opieter-aws is not a public org member as visible to this token). One deliberate deviation from TS is in the PR's decision log: a well-formed pending execution the loop cannot replay (no tool uses / result for an unknown tool use) is dropped with a warning rather than failing the session load, because the Python SDK can itself persist that shape.
Activity
strandly-the-agent commentedon Oct 29, 2026
Port PR: #5654 (
port/interrupt-restore-validation-to-py). Review requested from @zastrowm (approver of the source PR #5628; its authoropieter-awsis not a public org member as visible to this token). One deliberate deviation from TS is in the PR's decision log: a well-formed pending execution the loop cannot replay (no tool uses / result for an unknown tool use) is dropped with a warning rather than failing the session load, because the Python SDK can itself persist that shape.