Skip to content

c0mpute first for AI text in edge functions (broadcast draft, metadata, news post) - #76

Merged
ralyodio merged 2 commits into
mainfrom
c0mpute-first-ai-v2
Nov 9, 2026
Merged

ralyodio merged 2 commits into
mainfrom
c0mpute-first-ai-v2

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Rebased #73 onto main now that saasrow runs again at saasrow.pwa.pit.world.

  • _shared/c0mpute.ts: c0mpute via @profullstack/ai-providers 0.2.0, 40 s budget inside the ~60 s edge worker limit
  • draft-email-broadcast ("Write with AI" on /admin/email-broadcast): c0mpute, then OpenAI, then Gemini
  • fetch-metadata, generate-news-post: same order

Edge functions are deployed by hand to the dev2 functions container; C0MPUTE_API_KEY (fleet ik_live_ key) goes in volumes/functions/secrets.env.

🤖 Generated with Claude Code

draft-email-broadcast, fetch-metadata and generate-news-post try the
c0mpute peer network first (npm:@profullstack/ai-providers@0.2.0 in Deno,
via supabase/functions/_shared/c0mpute.ts), then their existing OpenAI and
Gemini calls. Timeouts stay under the self-hosted edge runtime's ~60 s
worker limit. Banner images stay on OpenAI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

ThreatCrush Security Scan

15 finding(s)

HIGH/CRITICAL: 2 | MEDIUM: 11 | LOW: 2

Severity Rule Location
HIGH js-ssrf-outbound-request public/sw.js:21
HIGH js-ssrf-outbound-request src/lib/edgeProxy.ts:69
MEDIUM js-unescaped-html-sink src/components/JsonLd.tsx:13
MEDIUM redos-nested-quantifier src/lib/emailMarkdown.ts:43
MEDIUM redos-nested-quantifier src/lib/emailMarkdown.ts:302
MEDIUM js-unescaped-html-sink src/views/Admin.tsx:1811
MEDIUM js-unescaped-html-sink src/views/BlogPost.tsx:168
MEDIUM js-unescaped-html-sink src/views/EmailBroadcast.tsx:429
MEDIUM js-open-redirect src/views/Featured.tsx:279
MEDIUM js-unescaped-html-sink src/views/NewsPost.tsx:137
MEDIUM js-open-redirect src/views/SoftwareDetail.tsx:160
MEDIUM redos-nested-quantifier supabase/functions/_shared/emailMarkdown.ts:43
MEDIUM redos-nested-quantifier supabase/functions/_shared/emailMarkdown.ts:302
LOW secret-generic-credential __tests__/lib/webhooks/supabaseStore.test.ts:11
LOW secret-generic-credential cli/test/cli.test.mjs:309

Snippets are redacted; ThreatCrush never prints matched credential material.

A draft from the 9B peer model takes 2-5 minutes, longer than one edge
request lives (60 s worker clock, 150 s gateway), so the button hung and
came back empty. The function now queues the job and returns its id; the
page re-posts the id until the draft is ready (10 min cap) and shows
progress. Infernet 5xx during its redeploys counts as pending, and a live
done event that beats backfilled tokens triggers one full replay. OpenAI
then Gemini answer if c0mpute cannot take or finish the job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 78fa54e into main Nov 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant