Prevent duplicate comments on rapid Paperclip retries:
- Check plugin instance state for requestId before processing
- Skip if same requestId was seen within 5 minutes
- Store requestId with ISO timestamp after first successful delivery
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Declare two new cron jobs in plugin.json and manifest.ts, and implement
their handlers in worker.ts. stale-case-reminder runs daily at 08:00 and
posts a warning comment on any Paperclip issue linked to a legal-ai case
that has not been updated in 3+ days. weekly-feedback-analysis runs every
Sunday at 19:00, fetches the weekly chair-feedback summary from legal-ai,
and invokes the CEO agent to update decision-lessons.md with new lessons.
Add webhooks[] array to plugin.json and manifest.ts with the
'case-status' endpointKey. Without this declaration, Paperclip
registers 0 webhooks even when onWebhook() is implemented, so
POST /api/plugins/marcusgroup.legal-ai/webhooks/case-status would
return 501 and never reach the handler.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the onWebhook lifecycle hook to the definePlugin() call. When
legal-ai POSTs to /webhooks/case-status, the handler finds the linked
Paperclip issue (via plugin state scan), posts a Hebrew status comment,
and wakes the CEO agent on qa_failed. Hoists PluginContext and
CEO_AGENT_IDS to module scope so onWebhook can access them after setup().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add event handler that intercepts user comments on issues and wakes the
CEO agent (instead of only the assigned agent). The CEO reads the comment,
checks for attachments, and routes to the appropriate agent.
- Add issue.comment.created event subscription
- Add agents.read, agents.invoke, issue.comments.read capabilities
- CEO receives comment body + issue context in the invoke prompt
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>