Repository navigation
Conversation
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>
ThreatCrush Security Scan15 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 11 | LOW: 2
Snippets are redacted; ThreatCrush never prints matched credential material. |
Collaborator
Author
|
Closed (not merged) on purpose: CI is green, but saasrow.com is a stopped site and merging deploys it. gh-prs-merge sweeps merge any open green PR, so this is parked closed. Branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Do not merge while saasrow.com is stopped. The site's containers on dev2 are stopped on purpose (a dropped site). Merging to main triggers
deploy-dev2.yml, which deploys and restarts it.What moved to c0mpute
The three text features are Supabase edge functions (Deno). New
supabase/functions/_shared/c0mpute.tsimportsnpm:@profullstack/ai-providers@0.2.0(pinned exact) and uses its c0mpute provider only (paidFallback: false, peer nodes only). Each function's existing provider loop keeps its own OpenAI / Gemini calls as the paid tier, with c0mpute put at the head.draft-email-broadcast(admin email draft): c0mpute, then OpenAI, then Gemini. The answer goes through the existingparseDraft.fetch-metadata(listing title/description/category/tags on submit): c0mpute (30 s cap, since a submission waits on it), then OpenAI, then Gemini, then the page's own metadata as before.generate-news-post(admin blog draft): c0mpute, then OpenAI. The "OpenAI API key not configured" gate now only fires when c0mpute is disabled too..env.exampledocumentsC0MPUTE_API_KEY.Timeouts, and a limit to know about
The self-hosted edge runtime stops a worker after about 60 s of wall clock (the stock
mainservice), so c0mpute gets 40 s by default (C0MPUTE_TIMEOUT_MSoverrides). Peer nodes write about 2 tokens a second, so short JSON (metadata, email drafts) fits, but a 500 to 700 word news post usually will not finish in time and will fall through to OpenAI. Raising the worker timeout involumes/functions/main/index.tson dev2 would let it.Stays on the vendor
generate-banner-images: DALL-E images.src/lib/aiClients.tsis a user-agent list of AI crawlers, not a model call.Fallback
Both paid keys are dead today. On a c0mpute failure: drafts fail with the same 502 as now if Gemini is also unset or failing, metadata falls back to the page's own tags as now, and the news post returns the same 500.
Privacy
Inputs are admin-written prompts and public pages of submitted product URLs. No private user content goes to peer nodes.
Deploy notes
C0MPUTE_API_KEY(fleetik_live_account key) must be in the functions container env on dev2, not onlyapp.env; without it c0mpute runs on the 10 a day free tier.Tests
bun run typecheckclean,bun run test:unit298 pass (as CI runs it). The edge functions are not covered by tsc or vitest, so:deno checkpasses for_shared/c0mpute.tsand all three functions (it also showed 2 olderror is unknownerrors ingenerate-news-post's catch block, fixed here), and a Deno smoke run ofaskC0mputeagainst a fake Infernet job stream returned the parsed JSON withp2p_only: true.Aside, not changed here:
generate-news-postauthorizes by comparing a bodyemailfield toADMIN_EMAIL, so anyone who knows that address can create unpublished posts and spend AI calls.draft-email-broadcastusesrequireAdmin; this one probably should too.🤖 Generated with Claude Code