Commit cf17875
feat: SSE status filter + fix ResponseNotRead in streaming error path
* fix(sdk): increase SSE stream timeout to prevent ReadTimeout
SSE streaming calls now use wait_seconds + 15s read timeout instead of
the global 15s client timeout. Fixes agent.listen() crashing when the
server holds the connection open for 30s keepalive cycles.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add status parameter to listen() for SSE stream filtering
Server now excludes terminal statuses (COMPLETED, FAILED, CANCELED,
TIMED_OUT) by default. SDK gains optional status parameter to override
the server default when needed (e.g. for debugging or audit).
Backward-compatible: existing agents that call listen() without status=
benefit from server-side zombie filtering automatically.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: handle ResponseNotRead in SSE streaming error path
When the SSE stream returns a 4xx/5xx, _raise_http_error accessed
response.text inside a streaming context, causing httpx.ResponseNotRead.
This crashed agents on transient 503s instead of allowing reconnect.
Fix: call response.read() before accessing .text/.json().
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 8a13e12 commit cf17875
1 file changed
+36
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
| 835 | + | |
835 | 836 | | |
836 | 837 | | |
837 | 838 | | |
| |||
843 | 844 | | |
844 | 845 | | |
845 | 846 | | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
846 | 851 | | |
847 | 852 | | |
848 | 853 | | |
| |||
854 | 859 | | |
855 | 860 | | |
856 | 861 | | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
857 | 865 | | |
858 | 866 | | |
859 | 867 | | |
| |||
895 | 903 | | |
896 | 904 | | |
897 | 905 | | |
| 906 | + | |
898 | 907 | | |
899 | 908 | | |
900 | 909 | | |
| |||
1670 | 1679 | | |
1671 | 1680 | | |
1672 | 1681 | | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
1673 | 1688 | | |
1674 | 1689 | | |
1675 | 1690 | | |
1676 | 1691 | | |
1677 | 1692 | | |
| 1693 | + | |
1678 | 1694 | | |
1679 | 1695 | | |
1680 | 1696 | | |
| |||
1710 | 1726 | | |
1711 | 1727 | | |
1712 | 1728 | | |
| 1729 | + | |
1713 | 1730 | | |
1714 | 1731 | | |
1715 | 1732 | | |
1716 | 1733 | | |
1717 | 1734 | | |
1718 | 1735 | | |
1719 | 1736 | | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
1720 | 1748 | | |
1721 | 1749 | | |
1722 | 1750 | | |
1723 | | - | |
| 1751 | + | |
1724 | 1752 | | |
| 1753 | + | |
1725 | 1754 | | |
1726 | 1755 | | |
1727 | 1756 | | |
| |||
1876 | 1905 | | |
1877 | 1906 | | |
1878 | 1907 | | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
1879 | 1914 | | |
1880 | 1915 | | |
1881 | 1916 | | |
| |||
0 commit comments