Commit 8f5a4d4
authored
feat(subscriptions): add inline_body kwarg (cueapi #791 / Item 1 parity) (#42)
Server-side Item 1 (hosted PR #791) added `subscriptions.inline_body`
opt-in body embedding for pull subscriptions — when True, the source
message body is embedded in the event payload as `payload.body`,
eliminating the extra GET /v1/messages/{id} round-trip on the consumer
side.
This SDK port wires the kwarg through `AgentsResource.subscriptions_create()`:
optional `inline_body: Optional[bool] = None`. When None (default), the
field is OMITTED from the wire body — server default of False applies.
When True or False, the value is passed through verbatim.
Docstring updates:
- Document the 32KB cap (bodies > 32KB → `payload.body_omitted =
"size_too_large"` + `payload.body_size_bytes = N`, consumer falls
back to fetch).
- Note that both pull and webhook subscription responses surface
`inline_body` so list-callers can observe own state.
Tests (3 new):
- test_inline_body_omitted_when_none — default case, no payload noise
- test_inline_body_true_passes_through — opt-in path
- test_inline_body_false_explicit_passes_through — explicit-False path
(distinct from None for callers who want to force the no-embed
contract).
Out of scope:
- Parity-manifest refresh: manifest is dated 2026-05-07 and missing
the entire PR-1b event-emit coverage (subscriptions_create/list/
delete + events_pull). Filing a separate Backlog row for the
manifest refresh + audit-date bump.
Backlog row: cmp1v3ck3.1 parent ba1c45f commit 8f5a4d4
2 files changed
Lines changed: 76 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| |||
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
269 | 280 | | |
270 | 281 | | |
271 | 282 | | |
272 | 283 | | |
273 | | - | |
| 284 | + | |
| 285 | + | |
274 | 286 | | |
275 | 287 | | |
276 | 288 | | |
| |||
282 | 294 | | |
283 | 295 | | |
284 | 296 | | |
| 297 | + | |
| 298 | + | |
285 | 299 | | |
286 | 300 | | |
287 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
349 | 410 | | |
350 | 411 | | |
351 | 412 | | |
| |||
0 commit comments