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
Commit 355f39d
Browse filesBrowse the repository at this point in the historyBrowse files
- Introduce SSEParserConfig record with builder to make SSE parser
limits (maxLineLength, maxBufferLines, maxBufferChars) configurable
- Raise default per-line limit from 64 KB to 1 MB so large JSON-RPC
responses are no longer silently dropped
- Thread SSEParserConfig through all HTTP client implementations
(JDK, Android, OkHttp) via new constructors and provider methods
- Prevent corrupt/skipped event blocks from advancing lastEventId,
which could cause event loss on reconnect
- Add AbstractA2AHttpClientSSETest for shared cross-client SSE tests
- Document SSEParserConfig usage and security considerations
Fixesa2aproject#1123
Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
Copy file name to clipboardExpand all lines: docs/content/dev/client.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -185,6 +185,35 @@ Client client = Client
185
185
.build();
186
186
```
187
187
188
+
### SSE Parser Configuration
189
+
190
+
The client uses a Server-Sent Events (SSE) parser for streaming responses. You can tune its limits via `SSEParserConfig` to handle agents that return large payloads (e.g., large artifacts or tool results):
|`maxLineLength`| Max bytes per raw SSE line (`0` = disabled) | 1 MB |
195
+
|`maxBufferLines`| Max `data:` lines per event block | 1 000 |
196
+
|`maxBufferChars`| Max total characters across all `data:` values per event | 1 MB |
197
+
198
+
The defaults are suitable for most deployments. To override them, build a custom `SSEParserConfig` and pass it to the HTTP client.
199
+
200
+
> **Security note:** setting `maxLineLength` to `0` disables the per-line memory protection entirely. Without this limit, a malicious server sending a single unterminated line (no newline) can consume unbounded memory — `maxBufferChars` only limits accumulated `data:` field values _after_ lines have been decoded, not the raw line itself. Only disable the per-line check when you trust the remote agent or have other safeguards (e.g. a reverse proxy with its own line-length limit). Note that `maxLineLength` is enforced as a byte limit on raw UTF-8 data; for ASCII content (the common case) bytes and characters are equivalent.
Copy file name to clipboardExpand all lines: extras/http-client-android/src/main/java/org/a2aproject/sdk/client/http/android/AndroidA2AHttpClientProvider.java
Copy file name to clipboardExpand all lines: extras/http-client-android/src/test/java/org/a2aproject/sdk/client/http/android/AndroidA2AHttpClientSSETest.java
0 commit comments