Skip to content

feat(api): agent-facing effector routes - #619

Open
ccf-lisa[bot] wants to merge 2 commits into
effectors/20b-effector-runtimefrom
effectors/21-agent-routes
Open

ccf-lisa[bot] wants to merge 2 commits into
effectors/20b-effector-runtimefrom
effectors/21-agent-routes

Conversation

@ccf-lisa

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

Copy link
Copy Markdown
Contributor

What

Agent-facing effector routes (wire interface; API LLD, agent-facing routes) on the effector service of #613 and #616. Agent JWT only (AgentJWTMiddleware) and agent:sync, like config sync; every response carries the effector protocol header.

Route Does
PUT /api/agent/instances/{instanceId}/effector Registration: 200 with revision and delivery keys; 409 on a base URL mismatch (actions still stored) or the instance cap; 422 with field paths (actions[0].params.defaults.layout)
GET /api/agent/effects The held effects, keyset paged (meta.next-cursor), by plugin and state; 403 until the agent registered actions
GET /api/agent/effects/{id} One effect, document built now; 404 for another agent's effect
PUT /api/agent/effects/{id}/status Status report: 204; 409 stale generation; 422 unknown generation or status; invalid links are dropped (follow-up 8)
  • Heartbeat: an agent-authenticated heartbeat with an effector block answers 201 with {"effector": {"resync", "delivery_keys"}} (snake_case, like the heartbeat); others still get no body. A failure is logged and answered without a body (the agent retries next heartbeat).
  • APIServices.EffectorSigner (loaded from CCF_EFFECTOR_SIGNING_KEY when nil and effectors are on) and APIServices.EffectorJobs, which cmd/run.go takes from the new worker accessor EffectorJobs() (nil, not a typed nil, without the rule engine).
  • Agent config reports: remote_config.overridable_action_config_flags (added in feat(agentconfig): effector actions and targets #599) is scrubbed, length-capped and bounded (40 entries) like the other remote-config lists, so the stored block stays within 64 KiB.

Why

Plan: stack 3, PR 21. First PR of stack 3.

Test evidence

  • effector_agent_integration_test.go (through the SDK against the real routes): registration 409/200/idempotent/revision bump/422, a params field error's path in the body, effects 403 before registering, only held effects listed, 404 for another agent's effect, refs merged, 409/422 on reports, a non-https link dropped with the status kept, the held set shrinking, heartbeats with and without the effector block (resync on digest mismatch and once after an admin request, verification enqueued while pending), user tokens refused (401) on all four routes. The service tests of feat(effector): registration #613/feat(effector): status reports and held set #616 cover each check.
  • TestEffectorJobsAccessor; TestNormalizeReportBoundsActionConfigFlags and the remote-config/summary budget tests with the third list.

Gate on this branch: go build ./... pass; go vet -tags integration ./... pass; golangci-lint v2.15.0 (shared CI config, incl. unconvert) 0 new issues; make test pass; make swag no diff (regenerated docs/ committed here); go mod tidy no diff; go test -tags integration -p 1 on ./internal/api/handler/..., ./internal/service/effector/..., ./internal/service/worker/... pass.

Size

Counted: 749 lines (added + removed, tests included; docs/docs.go and docs/swagger.* excluded).

🤖 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: 33a9cadc-2356-4de5-bbdc-39629ee83045

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

@ccf-lisa
ccf-lisa Bot added this pull request to stack #604 December 1, 2026 20:11
@ccf-lisa
ccf-lisa Bot force-pushed the effectors/21-agent-routes branch from 9305d9b to ff1781b Compare December 2, 2026 12:07
ccf-lisa Bot added a commit that referenced this pull request Dec 2, 2026
Stack 3 as built (#619-#626) with counted lines, #613's count, and the
two decided follow-ups (#627 closed streams, #628 resumed repeats).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ccf-lisa Bot and others added 2 commits December 2, 2026 11:04
PUT /api/agent/instances/{id}/effector, GET /api/agent/effects,
GET /api/agent/effects/{id} and PUT /api/agent/effects/{id}/status on
the effector service, agent JWT only and agent:sync. An agent heartbeat
with an effector block answers {"effector": {resync, delivery_keys}}.
The worker service hands the API its effector jobs (EffectorJobs), and
agent reports bound the effector action config flags like the other
remote-config lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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