Skip to content

feat(subscriptions): add inline_body kwarg (cueapi #791 / Item 1 parity)#42

Merged
mikemolinet merged 1 commit into
mainfrom
feat/subscriptions-inline-body
May 12, 2026
Merged

feat(subscriptions): add inline_body kwarg (cueapi #791 / Item 1 parity)#42
mikemolinet merged 1 commit into
mainfrom
feat/subscriptions-inline-body

Conversation

@mikemolinet
Copy link
Copy Markdown
Collaborator

Summary

Wires the server-side subscriptions.inline_body opt-in (hosted PR #791, Item 1) into the Python SDK via a new inline_body: Optional[bool] = None kwarg on AgentsResource.subscriptions_create().

When True, the server embeds the source message body in the event payload as payload.body — eliminates the extra GET /v1/messages/{id} round-trip on the consumer side. Bodies > 32KB are NOT embedded; the payload instead carries payload.body_omitted = "size_too_large" + payload.body_size_bytes = N so consumers fall back to the fetch.

Wire shape

SDK call Wire inline_body field
inline_body=None (default) OMITTED — server default False applies
inline_body=True true
inline_body=False false (explicit, distinct from default)

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

Full file: 34/34 passing. Full unit suite: 155/155 passing.

Out of scope

  • Parity-manifest refresh. The manifest is dated 2026-05-07 and missing the entire PR-1b event-emit coverage (subscriptions_create/list/delete + events_pull) — pre-existing drift. Filing a separate Backlog row for the manifest refresh + audit-date bump rather than expanding this PR.

Parity-impact checklist

  • Server contract (PR #791) reviewed — SubscriptionCreate.inline_body: bool = False, 32KB cap with body_omitted fallback, response surfaces inline_body field.
  • SDK kwarg additive (default None = omit; preserves pre-#791 wire format).
  • Tests cover all 3 truth-states (None / True / False).
  • Docstring documents the 32KB cap + response-side surface.
  • cueapi-cli --inline-body flag (separate Backlog row cmp1v3azw — different PR / different repo).
  • cueapi-mcp tool inline_body parameter (deferred — Backlog cmp1v39ih covers body-verify Phase 2 first; inline_body for MCP can ride on top).
  • Parity-manifest refresh (separate Backlog row to be filed).

Backlog row: cmp1v3ck3.

🤖 Generated with Claude Code

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.
@govindkavaturi-art govindkavaturi-art enabled auto-merge (squash) May 12, 2026 00:19
@mikemolinet mikemolinet merged commit 8f5a4d4 into main May 12, 2026
4 checks passed
@mikemolinet mikemolinet deleted the feat/subscriptions-inline-body branch May 12, 2026 00:20
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant