feat(subscriptions): add inline_body kwarg (cueapi #791 / Item 1 parity)#42
Merged
Merged
Conversation
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.
mikemolinet
added a commit
that referenced
this pull request
May 12, 2026
…dy coverage, bump audit to 2026-05-12 (#43) Manifest was dated 2026-05-07 and missing the PR-1b event-emit endpoint coverage (4 endpoints) plus the body-verify Phase 2 + inline_body extensions that shipped 2026-05-09 → 2026-05-12. Brings the manifest back in sync with SDK head. Endpoints added to `endpoints_covered`: - POST /v1/agents/{ref}/subscriptions (subscriptions_create, PR #38; inline_body kwarg in PR #42 / cueapi #791 Item 1) - GET /v1/agents/{ref}/subscriptions (subscriptions_list, PR #38) - DELETE /v1/agents/{ref}/subscriptions/{sub_id} (subscriptions_delete, PR #38) - GET /v1/agents/{ref}/events (events_pull, PR #38) Updates to existing entries: - POST /v1/messages — added auto_verify body-verify Phase 2 (PR #39 + #40, cueapi/cueapi #795 + #798 parity) - POST /v1/cues/{id}/fire — note that #33 shipped (was "in-flight") - GET /v1/agents/roster — note that #35 shipped (was "in-flight") - GET /v1/agents/{ref}/presence — note that #35 shipped (was "in-flight") Replaced `in_flight_ports_2026_05_07` section with `ports_shipped_2026_05_08_to_2026_05_12` (now-resolved entries) plus a near-empty `ports_in_flight_2026_05_12` placeholder for future ports. Backlog row: cmp1vukmc. Out of scope: - `model_drift` section walk-through (Cue/Execution/Worker missing fields) — PR #31 just landed the Execution + Worker + Agent + Message additive models; a fuller `model_drift` refresh deserves a separate audit pass against the now-shipped models to figure out what's still drifting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires the server-side
subscriptions.inline_bodyopt-in (hosted PR #791, Item 1) into the Python SDK via a newinline_body: Optional[bool] = Nonekwarg onAgentsResource.subscriptions_create().When
True, the server embeds the source message body in the event payload aspayload.body— eliminates the extraGET /v1/messages/{id}round-trip on the consumer side. Bodies > 32KB are NOT embedded; the payload instead carriespayload.body_omitted = "size_too_large"+payload.body_size_bytes = Nso consumers fall back to the fetch.Wire shape
inline_bodyfieldinline_body=None(default)Falseappliesinline_body=Truetrueinline_body=Falsefalse(explicit, distinct from default)Tests (3 new)
test_inline_body_omitted_when_none— default case, no payload noisetest_inline_body_true_passes_through— opt-in pathtest_inline_body_false_explicit_passes_through— explicit-False pathFull file: 34/34 passing. Full unit suite: 155/155 passing.
Out of scope
Parity-impact checklist
SubscriptionCreate.inline_body: bool = False, 32KB cap with body_omitted fallback, response surfacesinline_bodyfield.--inline-bodyflag (separate Backlog rowcmp1v3azw— different PR / different repo).cmp1v39ihcovers body-verify Phase 2 first; inline_body for MCP can ride on top).Backlog row:
cmp1v3ck3.🤖 Generated with Claude Code