Commit 3fb4ad2
fix: raise specific error for interrupt responses without active interrupt state
When interrupt responses (list of interruptResponse dicts) are passed to
an agent that is not in interrupt state, _convert_prompt_to_messages now
raises a clear ValueError explaining the cause instead of the generic
'Input prompt must be of type: str | list[Contentblock] | Messages | None'
error.
This helps users diagnose the issue when using stateless setups where the
interrupt state is not preserved across requests (e.g. serverless), guiding
them to use session management or preserve the agent instance.
Closes #1644
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent fca208b commit 3fb4ad2
2 files changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
965 | 973 | | |
966 | 974 | | |
967 | 975 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1866 | 1866 | | |
1867 | 1867 | | |
1868 | 1868 | | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
1869 | 1878 | | |
1870 | 1879 | | |
1871 | 1880 | | |
| |||
0 commit comments