Skip to main content

Overview

Every successful skill execution triggers two parallel async chains, both dispatched non-blocking via ctx.waitUntil. Credits are only deducted on success — failures and rate-limit blocks never charge the user.

Chain A: Credit Deduction

The Vercel Webhook (VERCEL_WEBHOOK_URL) is the bridge to uniskill-web’s Supabase instance, writing the transaction into the persistent ledger.

Chain B: Telemetry (Dual Write)

1. recordSkillCall → Supabase RPC

Captures structured per-call statistics in tri-state format:
RPC payload sent to record_skill_usage:

2. saveInvocationLog → Supabase REST

Raw payload audit written directly to the invocations table:

Layered Cache Architecture

UUID Safety

Both telemetry chains validate all UUID fields with a strict regex before writing. Any non-UUID value (e.g. skill name strings, "anonymous") falls back to:
This prevents foreign key violations while preserving an audit trail of the actual identifier in p_metadata.