feat(events): SDK methods for event-emit primitive (PR-1b)#38
Merged
Conversation
Adds 4 SDK methods to AgentsResource (since all 4 endpoints are
rooted under /v1/agents/{ref}/):
- subscriptions_create(ref, *, event_type, delivery_target, webhook_url=None)
- subscriptions_list(ref)
- subscriptions_delete(ref, subscription_id)
- events_pull(ref, *, since=None, limit=100, event_type=None)
Mirrors the existing AgentsResource shape (.inbox, .sent,
.webhook_secret_get etc are also sub-resource methods on agents).
## Wire format pinned
- subscriptions_create: POST body with event_type + delivery_target +
optional webhook_url (default-omit when None to match server's
extra="forbid" expectation for pull subs)
- subscriptions_list: GET (no params)
- subscriptions_delete: DELETE on /subscriptions/{id} (idempotent
per server contract — re-DELETE returns 200)
- events_pull: GET with limit (default 100, server caps at 1000) +
optional since (cursor) + optional event_type filter. Server
endpoint takes since/event_type as query params.
## Tests
11 new tests in tests/test_agents_resource.py covering:
- pull-subscription minimal body
- webhook-subscription with URL
- webhook_url omitted when None (default-omit discipline)
- subscriptions_list GET path (opaque id + slug-form)
- subscriptions_delete DELETE path
- events_pull defaults
- events_pull with since cursor
- events_pull with event_type filter
- events_pull with all params combined
- events_pull explicit since=0 passed (not collapsed to default)
11/11 pass locally. Full local suite: 118 passed + 19 pre-existing
errors (test_cues.py "api_key is required" — env-specific, not from
this PR).
## Depends on cueapi-core PR-1b
The endpoints these SDK methods call land via cueapi/cueapi-core
PR #71 (in flight). This SDK PR will sit on the branch until #71
merges + cueapi-core deploys; safe to merge afterward (SDK methods
return 404 against a server that doesn't have the endpoints yet,
which is acceptable for a parity port).
Closes Backlog row: cmp0h2mbg000104l8jgnzvgnu
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
Adds 4 SDK methods to
AgentsResourcefor the new event-emit primitive endpoints (cueapi-core PR #71, merged 03:53Z, OSS sibling of cueapi/cueapi#731). All 4 endpoints are rooted under/v1/agents/{ref}/, so they fit the existing AgentsResource sub-resource shape (.inbox,.sent,.webhook_secret_getare also agent-scoped sub-resource methods).Closes Backlog row
cmp0h2mbg000104l8jgnzvgnu.New methods
subscriptions_create(ref, *, event_type, delivery_target, webhook_url=None)POST /v1/agents/{ref}/subscriptionssubscriptions_list(ref)GET /v1/agents/{ref}/subscriptionssubscriptions_delete(ref, subscription_id)DELETE /v1/agents/{ref}/subscriptions/{id}events_pull(ref, *, since=None, limit=100, event_type=None)GET /v1/agents/{ref}/eventsWire format pinned
subscriptions_create: POST body{event_type, delivery_target, webhook_url?}.webhook_urlis default-omitted whenNone(matches server'sextra="forbid"for pull-subscription bodies).subscriptions_list: GET (no params).subscriptions_delete: DELETE on/subscriptions/{id}. Idempotent per server contract — re-DELETE returns 200.events_pull: GET withlimit(default 100, server caps at 1000) + optionalsince(cursor, BIGSERIALid) + optionalevent_typefilter.Tests
11 new tests in
tests/test_agents_resource.py:TestSubscriptionsCreate: pull-minimal, webhook-with-url, webhook_url-omitted-when-NoneTestSubscriptionsList: GET path (opaque id + slug-form)TestSubscriptionsDelete: DELETE pathTestEventsPull: defaults, since-cursor, event_type filter, all-params combined, explicit since=0 (not collapsed to default)Full local suite: 118 passed + 19 pre-existing errors in
test_cues.py(api_key is required— environment-specific, NOT from this PR). Zero regressions.Depends on cueapi-core PR #71 (now merged)
Endpoints these SDK methods call live in cueapi-core via PR #71 — merged 2026-05-11 03:53Z, commit 50d2b2c2. Self-hosters running cueapi-core ≥ that revision get the endpoints; older revisions would return 404 (acceptable behavior for a server that hasn't picked up the substrate yet).
Test plan
app/routers/events.pybody schemas +app/services/events_service.pyquery semanticswebhook_urlwhen None🤖 Generated with Claude Code