docs(agent): agent builder tools design (triggers, cron, find-triggers)#4919
docs(agent): agent builder tools design (triggers, cron, find-triggers)#4919mmabrouk wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
🤖 The AI agent says: What this covers. The tools and skills the build flow still needs. The trigger and cron backend already ships in full, so what is missing is the thin agent-facing tools over it plus event discovery. This PR also covers the agent-driven trigger-test UX. Where to look. Section 3 (the missing tools and Feedback needed. Please confirm:
And please weigh in on the five smaller open questions (README section 7):
|
|
🤖 The AI agent says: The doc was rewritten for quality. The first version was rejected, so this is a clean rewrite. The structure is tighter, every tool now carries a design-interfaces role analysis (input, config, routing, credentials, metadata, policy), and the whole doc aligns to inject-not-commit: the builder tools ride the injected build kit and never enter stored config. What to review. The tool set (section 4), the new Four open questions, all non-blocking (section 8), with recommendations:
|
| |---|---|---|---| | ||
| | `find_triggers` | `POST /api/triggers/discover` (new) | read | allow | | ||
| | `create_schedule` | `POST /api/triggers/schedules/` | mutate | ask, approval | | ||
| | `create_subscription` | `POST /api/triggers/subscriptions/` | mutate | ask, approval | |
There was a problem hiding this comment.
It seems to me that we need also the ability to remove subscriptions and remove triggers, at least for the current application, because you might add them and then you change your mind.
| follow-up (5.1). A skill-authoring choice, low risk to change later. Recommend sample-first. | ||
| 2. **Same-session or new-session dry test.** Same-session for v1 avoids a new invoke surface | ||
| (5.3). Recommend same-session. | ||
| 3. **`test_subscription` permission.** `ask` (it opens a real provider watch and blocks) or `allow` |
|
|
||
| 1. **Test order in the skill.** Sample-first as the default, with a live test as the prove-it | ||
| follow-up (5.1). A skill-authoring choice, low risk to change later. Recommend sample-first. | ||
| 2. **Same-session or new-session dry test.** Same-session for v1 avoids a new invoke surface |
| (5.3). Recommend same-session. | ||
| 3. **`test_subscription` permission.** `ask` (it opens a real provider watch and blocks) or `allow` | ||
| (it is non-destructive)? Recommend `ask`. | ||
| 4. **The test gap.** A public `/api` invoke wrapper now, or same-session dry testing plus the |
There was a problem hiding this comment.
i dont understand this point
…it overlay model Claude-Session: https://claude.ai/code/session_01GYo3UEfvsZpncagqb28Mbc
|
🤖 The AI agent says: Aligned this doc to the approved #4917 build-kit overlay model and added the undo tools. What changed:
Please confirm the undo tool set (remove + pause/resume for both schedules and subscriptions) and the approval gating on them. |
| | `create_schedule` | `POST /api/triggers/schedules/` | mutate | ask, approval | | ||
| | `create_subscription` | `POST /api/triggers/subscriptions/` | mutate | ask, approval | | ||
| | `test_subscription` | `POST /api/triggers/subscriptions/test` | probe | ask, approval | | ||
| | `remove_schedule` | `DELETE /api/triggers/schedules/{id}` | mutate | ask, approval | |
There was a problem hiding this comment.
New undo tools: remove_schedule / remove_subscription delete by id, and the pause/resume pairs below map onto the existing /start and /stop endpoints. All mutating and approval-gated, so the agent can take back down what it set up. Contract in section 4.6.
| adding each op to the overlay's `tools` list as a `{ "type": "platform", "op": ... }` entry. Adding | ||
| the builder tools to `PLATFORM_OPS` is therefore the whole integration: the new tools join the | ||
| overlay with no extra wiring. The backend serves the overlay read-only on the inspect response at | ||
| `additional_context.playground_build_kit.agent_template_overlay`; the frontend applies it on a |
There was a problem hiding this comment.
Section 6 now states the overlay model precisely: the backend assembles PLATFORM_OPS into the overlay served read-only here, and the frontend applies it. No backend injection, no run flag. Adding a builder op to PLATFORM_OPS is the whole integration.
What this designs
A new agent on Agenta should turn itself into a real app by chatting with the user: discover the tools it needs, connect the integrations, edit its own instructions, set a trigger or a cron job, and commit. This doc designs the trigger-and-cron half of that flow: the agent-facing builder tools, plus the one event-discovery endpoint the flow is missing.
The finding
The trigger and cron engine already ships as a full backend: event subscriptions, cron schedules, delivery logs, a Composio event catalog, a worker, and a per-minute tick. We do not build a scheduler. The gap is narrow. There is no agent-facing tool layer over that engine, and there is no way to search the event catalog. This design fills both.
What it adds
Builder tools over endpoints that already ship, plus one new backend piece.
create_scheduleandcreate_subscription: mutating, self-targeted, approval-gated.test_subscription: a probe that opens a real provider watch and blocks; approval-gated.remove_scheduleandremove_subscription, plus a pause and resume pair for each (over the existing delete and start/stop endpoints): the agent can take back down a schedule or subscription it set up. Mutating, approval-gated. New in this pass.list_schedules,list_subscriptions,list_deliveries,list_connections: reads, default allow.find_triggers: the one new backend piece. A keyword search over the event catalog atPOST /api/triggers/discover, shaped likefind_capabilities. It joins the catalog match with shared connection state, so the agent learns the event and whether it can subscribe to it in one call.Two role rules run through the whole set. The destination is routing, and it is bound server-side from run context the way
commit_revisionbinds the variant id, so the model can only target the running agent itself. The connection is a credential reference (an id, never a secret). The agent holds the reference and asks the frontend to make the connection throughrequest_connection, a non-runnable reference tool the overlay embeds via@ag.embed(owned by #4920), not one of the platform ops in this set.The part to read closely
Section 5 walks the agent-driven build flow end to end on a concrete ask: run yourself on every new GitHub issue in
acme/app, and triage it. The key finding is the dry-vs-live test split. A live test (test_subscription) needs the connection, because it long-polls the provider for a real event. A dry test does not: the agent runs itself against the catalog's sample payload with no connection. That split sets the build order. The recommendation is sample-first: build and dry-test the mapping offline, show the user the agent working, then ask for the connection and go live with one live test as the prove-it follow-up.Decided this pass
The finer questions are settled and recorded in section 8: dry test is same-session for v1,
test_subscriptionpermission isask, and the public invoke wrapper is deferred. One open question remains (section 9): test order in the build skill (lean sample-first).Scope / risk
Doc only, no code. The builder tools reach a run through the build-kit overlay the frontend applies and never enter stored config, so a published production agent never carries them (section 6). This design depends on the connection round-trip (owned by the frontend round-trip PR) and the skills that teach the flow (owned by the platform skills PR).
Related PRs
Part of the "agent builds an app" initiative. Read the map first: #4921.
https://claude.ai/code/session_01GYo3UEfvsZpncagqb28Mbc