Skip to content

Commit 0e9ae87

Browse files
authored
chore(integrations): drop Sentry->Paperclip webhook proxy (#212)
Paperclip v2026.416.0 ships signingMode='none', so Sentry can fire the QA routine trigger directly. Removed the FastAPI proxy that existed only because older Paperclip required Bearer auth on triggers. - Delete src/integrations/paperclip.py (proxy router + notify_qa_sync helper) - Remove paperclip_router mount from src/main.py - Drop config keys WEBHOOK_PROXY_SECRET, SENTRY_CLIENT_SECRET, PAPERCLIP_QA_TRIGGER_URL, PAPERCLIP_QA_TRIGGER_SECRET - Simplify notify_telegram_on_failure: Prefect failures now surface via the QA Log Scan 3h cron instead of an instant push (accepted: less code, slower detection) - Mark phase 3b done in docs/paperclip-native-migration.md Verified end-to-end on prod: Sentry Internal Integration webhook URL flipped to https://org.ffmemes.com/api/routine-triggers/public/<id>/fire, new RuntimeError event reached Paperclip directly and created routine_execution issue FFM-820 with raw Sentry payload.
1 parent fc68abf commit 0e9ae87

6 files changed

Lines changed: 2 additions & 189 deletions

File tree

docs/paperclip-native-migration.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ Concurrency group `paperclip-deploy-agents` prevents overlapping runs; `cancel-i
8989
**3a. Adapter config sync from `.paperclip.yaml`** (next iteration of `agents/deploy.sh`).
9090
Read agent block from manifest, PATCH `/api/agents/<id>` with `adapterConfig`, `runtimeConfig`, `permissions`, `desiredSkills` (parsed from AGENTS.md frontmatter). Currently we only sync the prompt text.
9191

92-
**3b. Retire the webhook proxy.** Paperclip v416 ships `none` and `github_hmac` signing modes (per `infra_paperclip_webhook_fix_shipped.md`). Switch QA trigger signing to `none`, point Sentry/Coolify/Prefect directly at the trigger URL, delete:
93-
- `src/integrations/paperclip.py` `/webhooks/qa-alert` route + HMAC helpers (~150 LOC)
94-
- `src/flows/hooks.py::notify_qa_sync` (~30 LOC) → replace with Prefect's native "Send a webhook" automation
95-
- env vars `WEBHOOK_PROXY_SECRET`, `SENTRY_CLIENT_SECRET`
92+
**3b. Retire the webhook proxy.** ✅ Done 2026-04-29. QA trigger `30901464-...` flipped to `signingMode: none`, Sentry Internal Integration `paperclip-qa-alert-b86aa3` now POSTs directly to `https://org.ffmemes.com/api/routine-triggers/public/18a2f9e439c396e9b21a02fa/fire`. Deleted: `src/integrations/paperclip.py`, `notify_qa_sync` callsite in `src/flows/hooks.py`, env vars `WEBHOOK_PROXY_SECRET` / `SENTRY_CLIENT_SECRET` / `PAPERCLIP_QA_TRIGGER_URL` / `PAPERCLIP_QA_TRIGGER_SECRET`. Coolify webhook path was unused (no hits in 24h prior to removal). Prefect failures now surface via the QA Log Scan 3h cron instead of an instant push — accepted tradeoff for less code. Trigger publicId leakage = at most noisy QA scans (no user input or commands accepted).
9693

9794
**3c. CLI-native agent skills.** In each AGENTS.md, replace raw `curl https://org.ffmemes.com/api/...` with `paperclipai issue list --json`, `paperclipai approval create`, `paperclipai dashboard get`, `paperclipai heartbeat run --agent-id`. Reduces per-wake context.
9895

src/config.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ class Config(BaseSettings):
5252
PREFECT_API_URL: str | None = None
5353
PREFECT_AUTH_STRING: str | None = None
5454

55-
PAPERCLIP_QA_TRIGGER_URL: str | None = None
56-
PAPERCLIP_QA_TRIGGER_SECRET: str | None = None
57-
WEBHOOK_PROXY_SECRET: str | None = None
58-
SENTRY_CLIENT_SECRET: str | None = None
59-
6055
TELEGRAM_API_ID: int | None = None
6156
TELEGRAM_API_HASH: str | None = None
6257
TELEGRAM_SESSION_STRING: str | None = None

src/flows/hooks.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,9 @@ def _extract_error_msg(state) -> str:
2828

2929

3030
def notify_telegram_on_failure(flow, flow_run, state):
31-
"""Send failure alerts to Telegram and Paperclip QA when a flow fails."""
31+
"""Send failure alert to Telegram admin chat when a flow fails."""
3232
error_msg = _extract_error_msg(state)
3333

34-
# Notify Paperclip QA (independent of Telegram config)
35-
try:
36-
from src.integrations.paperclip import notify_qa_sync
37-
38-
notify_qa_sync(flow.name, flow_run.name, error_msg)
39-
except Exception as e:
40-
logger.error("Failed to notify Paperclip QA: %s", e)
41-
42-
# Notify Telegram admin chat
4334
bot_token = settings.TELEGRAM_BOT_TOKEN
4435
chat_id = settings.ADMIN_LOGS_CHAT_ID
4536

src/integrations/__init__.py

Whitespace-only changes.

src/integrations/paperclip.py

Lines changed: 0 additions & 166 deletions
This file was deleted.

src/main.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,3 @@ async def prefect_deployments():
146146

147147

148148
app.include_router(tgbot_router, prefix="/tgbot", tags=["Telegram Bot"])
149-
150-
from src.integrations.paperclip import router as paperclip_router # noqa: E402
151-
152-
app.include_router(paperclip_router, tags=["Integrations"])

0 commit comments

Comments
 (0)