Skip to content

bug: WEBHOOK-001 GET/DELETE schedule webhook endpoint returns 404 — DatabaseManager missing facade delegations #724

Closed

Description

@vybe

Summary

`GET /api/agents/{name}/schedules/{id}/webhook` and `DELETE /api/agents/{name}/schedules/{id}/webhook` return 404 (`{"detail":"Agent not found"}`) instead of the expected 200/204. The `DatabaseManager` facade in `src/backend/database.py` is missing delegation methods for `get_webhook_status`, `revoke_webhook_token`, and related WEBHOOK-001 operations.

Context

Full test suite run on 2026-05-08 identified 3 failures in `test_webhook_triggers.py`:
```
AssertionError: Expected status 200, got 404. Response body: {"detail":"Agent not found"}
```

The `POST .../webhook` endpoint (generate/rotate token) likely works, but the GET and DELETE surface is unreachable. This is the database facade delegation pattern issue — the router calls `db.get_webhook_status()` or similar, but the method was never wired from `DatabaseManager` down to the underlying `ScheduleOperations` domain class.

Acceptance Criteria

  • `GET /api/agents/{name}/schedules/{id}/webhook` returns 200 with `{webhook_token, webhook_enabled, webhook_url}` when token exists
  • `DELETE /api/agents/{name}/schedules/{id}/webhook` returns 200 and nulls the token (subsequent trigger calls return 404)
  • All 3 `test_webhook_triggers.py` webhook status tests pass
  • `DatabaseManager` in `src/backend/database.py` delegates the missing WEBHOOK-001 methods to `ScheduleOperations`

Technical Notes

  • Router: `src/backend/routers/schedules.py` — WEBHOOK-001 GET/DELETE handlers
  • DB operations class: `src/backend/db/schedules.py` — likely has the methods; they're just not exposed on `DatabaseManager`
  • Pattern: add delegation in `database.py` matching the three-layer invariant (Router → Service → DB)
  • Related: WEBHOOK-001 feature was implemented in a prior PR; this is a wiring omission, not a missing feature

Activity

  1. added
    priority-p1
    type-bug
    on May 8, 2026
  2. vybe commented on May 8, 2026

    @vybe
    ContributorAuthor

    /claim

  3. github-actions commented on May 8, 2026

    @github-actions

    Claimed by @vybe. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/724-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #724
  4. added
    status-in-progress
    on May 8, 2026
  5. vybe commented on May 8, 2026

    @vybe
    ContributorAuthor

    Fixed in #727 — GET webhook status endpoint now uses name: str + can_user_access_agent to match POST/DELETE, restoring auth parity across all three WEBHOOK-001 endpoints.

  6. added
    status-in-dev
    and removed
    status-in-progress
    on May 8, 2026
  7. added
    complexity-low
    on Jun 3, 2026
  8. added a commit that references this issue on Jun 12, 2026
  9. removed
    status-in-dev
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-lowpriority-p1type-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions