Skip to content

[feat] Add events and webhooks#3632

Merged
junaway merged 68 commits intorelease/v0.89.0from
feature/webhooks
Mar 3, 2026
Merged

[feat] Add events and webhooks#3632
junaway merged 68 commits intorelease/v0.89.0from
feature/webhooks

Conversation

@ashrafchowdury
Copy link
Copy Markdown
Contributor

@ashrafchowdury ashrafchowdury commented Feb 5, 2026

This PR implements the new Webhooks feature, including backend APIs, worker tasks, and frontend UI components.

Documentation

Please read the README.md and DESIGN.md files for detailed design and implementation documentation.


Open with Devin

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Mar 3, 2026 0:55am

Request Review

Copy link
Copy Markdown
Member

@mmabrouk mmabrouk left a comment

Choose a reason for hiding this comment

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

Reviewing solely against the new backend requirements in AGENTS.md.

Must-fix (does not comply with AGENTS backend patterns)

  1. Layering violations (core/db depend on API + entrypoints)
  • Core imports API schemas (AGENTS: core should not depend on apis/fastapi/*):
    • api/oss/src/core/webhooks/service.py imports oss.src.apis.fastapi.webhooks.schemas
  • DB layer imports API schemas (AGENTS: DB should not depend on API layer):
    • api/oss/src/dbs/postgres/webhooks/dao.py imports oss.src.apis.fastapi.webhooks.schemas
  • Core imports entrypoints for worker wiring via global lazy singleton (AGENTS: wire concrete deps in api/entrypoints/* only; avoid core -> entrypoints):
    • api/oss/src/core/webhooks/trigger.py imports entrypoints.worker_webhooks

Expected direction: Router -> Service -> DAO Interface -> DAO Impl -> DB.

  1. DBE placement doesn’t follow the new-stack structure
  • Webhook DB models are added into legacy/monolithic api/oss/src/models/db_models.py (WebhookSubscriptionDB, WebhookEventDB, WebhookDeliveryDB).
  • AGENTS requires new DBEs to live under api/oss/src/dbs/postgres/<domain>/dbes.py (plus optional dbas.py + mappings.py).
  1. Returning DBEs from service/router contracts
  • api/oss/src/core/webhooks/service.py returns WebhookSubscriptionDB and lists of DBEs.
  • Router response models serialize DBEs via from_attributes = True (api/oss/src/apis/fastapi/webhooks/schemas.py).
  • AGENTS explicitly says: do not return DBEs from router/service contracts; introduce DTOs + mapping.
  1. Endpoint conventions don’t follow AGENTS patterns
    AGENTS conventions:
  • POST /query for filtering/search (payload support + cursor windowing)
  • POST /{id}/archive and POST /{id}/unarchive for lifecycle transitions
  • response envelopes with count + payload

Current API uses:

  • GET /webhooks/ for list, DELETE /webhooks/{id} for “delete” (but implementation actually archives via archived_at)
  • no /query, no Windowing

Migration seam / coupling note

  • Webhook triggering is added into legacy router: api/oss/src/routers/variants_router.py calls trigger_webhook(...).
  • AGENTS says avoid net-new features in api/oss/src/routers/*; if deploy still lives there, treat this as a temporary migration seam and keep the coupling minimal (especially avoid core importing entrypoints to make it work).

Style/consistency (lower priority)

  • API contracts are in schemas.py; AGENTS convention is models.py for request/response models.
  • New code doesn’t follow the keyword-only + grouped # argument style seen in new-stack services (not mandatory everywhere, but it’s the convention documented).

What I’d expect to align with AGENTS

  • api/oss/src/core/webhooks/dtos.py (+ optional interfaces.py) and a DAO interface.
  • Move DBEs into api/oss/src/dbs/postgres/webhooks/dbes.py and add mappings.py to isolate ORM.
  • Make api/oss/src/dbs/postgres/webhooks/dao.py accept/return core DTOs (no imports from API schemas).
  • Rework router to follow /query + archive/unarchive patterns (or document why webhooks is an explicit exception).
  • Remove core -> entrypoints worker import; keep DI at composition roots (api/entrypoints/*).

…re/webhooks

# Conflicts:
#	api/entrypoints/routers.py
#	api/oss/src/routers/variants_router.py
devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Member

@mmabrouk mmabrouk left a comment

Choose a reason for hiding this comment

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

Thanks a lot @jp-agenta and @ashrafchowdury great work! LGTM

Devin has a couple of comments, worth looking into.

Comment thread api/oss/src/core/environments/service.py
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Mar 2, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 3, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ mmabrouk
✅ junaway
✅ jp-agenta
❌ allcontributors[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@junaway junaway changed the base branch from release/v0.87.3 to release/v0.89.0 March 3, 2026 12:55
@junaway junaway merged commit 386164f into release/v0.89.0 Mar 3, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend feature Frontend lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants