Skip to main content

Overview

Every request to /v1/execute (or /v1/execute/:skillName) passes through 8 sequential gates before a response is returned. All gates after ⑦ are non-blocking via ctx.waitUntil.

Native vs. Generic Execution

Native Skills (Hardcoded)

Eight official skills bypass the Generic Executor and use dedicated TypeScript handlers:

Generic Executor (engine/executor.ts)

All registry/market/private skills run through the declarative template engine:
  • {{param}} placeholders — resolved in URL, headers, and request body
  • {{SECRETS.KEY}} — decrypted from user’s AES-256 encrypted KV secrets
  • Declarative template detection — suppresses auto-appending when {{...}} is present
  • Response mapping — JSONPath extraction via response_mapping
  • 10s hard timeout via AbortController
  • Fail-fast circuit breaker — missing SECRETS placeholder → immediate error, no upstream call

Experience Injection Detail

Before execution (step ⑥.₅), the gateway performs a semantic similarity search:
  1. Noise keys (session_id, trace_id, etc.) are pruned from params
  2. Remaining params are vectorized via Voyage AI (voyage-code-3, 1024-dim)
  3. Vector queried against skill_learnings table via match_learnings_by_input RPC (threshold: 0.85)
  4. On match: preventionPatch string is retrieved and injected via:
    • Tactic B (native handlers): appended as plaintext suffix to error response body
    • Tactic C (LLM skills): injected into messages[-1].content in the request body