Commit 7efcf99
fix: replace BaseHTTPMiddleware with pure ASGI middleware to fix streaming
BaseHTTPMiddleware.call_next() silently buffers or drops StreamingResponse
bodies in several starlette versions. Since message_send_wrapper always
returns an AsyncGenerator (wrapped in StreamingResponse), the Agentex server
proxy received result=null for every message/send call through that path.
Replace RequestIDMiddleware with a pure ASGI implementation that sets the
request-ID context variable and passes scope/receive/send through unmodified,
never touching the response body. This unblocks all message/send tutorial
integration tests (010_multiturn, 020_streaming, 030_langgraph).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e26b11d commit 7efcf99
1 file changed
+19
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| |||
0 commit comments