Skip to content

feat(sdk): effector types and client - #601

Open
ccf-lisa[bot] wants to merge 1 commit into
effectors/08b-agentconfig-paramsfrom
effectors/09-sdk
Open

ccf-lisa[bot] wants to merge 1 commit into
effectors/08b-agentconfig-paramsfrom
effectors/09-sdk

Conversation

@ccf-lisa

@ccf-lisa ccf-lisa Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

What

The Go SDK side of the effector wire protocol (wire interface):

  • sdk/types/effector.go: registration (EffectorRegistration, actions with target schemes, observations and params schema/defaults/locks), DeliveryKey, the webhook body, the effect document (Effect with rule, action incl. params, target, trigger, exceptions, applied status, links), EffectStatusReport (links nil keeps / empty clears; refs merged key by key), list options and pages, and the heartbeat's effector block and response. Kebab-case on the effector routes; the heartbeat keeps its snake_case.
  • sdk.Client.Effector: Register (PUT /api/agent/instances/{id}/effector), ListEffects / ListAllEffects (cursor paging, fails on a repeated cursor), GetEffect, ReportStatus. Every request carries ccf-effector-protocol: 1, requires agent credentials (ErrEffectorAuthRequired without a request otherwise) and bounds response bodies; 404 and 409 map to ErrEffectNotFound / ErrEffectGenerationConflict.
  • Heartbeat.Send: like Create but returns the response ({"effector": {"resync", "delivery_keys"}}); an empty body from an older API is a response with no effector block. Create is unchanged.

Ported unchanged from the PoC.

Why

The agent uses this client for registration, effect fetches, status reports and the heartbeat. The API routes behind it come in stack 3; until then nothing calls these methods (an older API ignores the heartbeat's new optional effector field, so the change is backwards compatible). Plan: stack 1, PR 9.

Test evidence

sdk/effector_test.go runs every method against an httptest server (headers, paths, envelopes, paging, error mapping, heartbeat bodies, JSON round trips); new code is 75–100% covered.

Gate on this branch: go build ./... pass; go vet -tags integration ./... pass; make lint 0 new issues (6 pre-existing on main, untouched files); make test pass; make swag no diff; go mod tidy no diff; go test -tags integration -p 1 ./sdk/... pass.

Size

Counted: 933 lines.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0f4344b6-7e6c-4696-b205-1c4dcc417acf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

sdk/types: the effector wire types (registration, delivery keys, the
effect document, status reports, the heartbeat's effector block and
response). sdk: Client.Effector (register, list and get held effects,
report status) with the ccf-effector-protocol header and typed errors
for 404 and 409, and Heartbeat.Send, which returns the heartbeat
response (docs/effectors/wire-interface.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@gusfcarvalho gusfcarvalho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ccf-review: APPROVE

no findings.

Stack (gh stack 604): #592 → #593 → #594 → #595 → #596 → #597 → #598 → #599 → #600 → #601 → #602 → #603 → #605 → #606 → #607 → #608 → #609 → #610 → #611 → #612 → #613 → #614 → #615 → #616 → #617 → #618 → #619 → #620 → #621 → #622 → #623 → #624 → #625 → #626 → #627 → #628 → #629 → #630

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant