Skip to content

ad-generator-agent: make every ad type on c0mpute, on by default - #425

Merged
sh1pt-actions-fleet[bot] merged 2 commits into
masterfrom
feat/ad-generator-agent
Nov 2, 2026
Merged

sh1pt-actions-fleet[bot] merged 2 commits into
masterfrom
feat/ad-generator-agent

Conversation

@sh1pt-actions-fleet

Copy link
Copy Markdown
Contributor

Replaces ad generation on `/dashboard/ads/new` with the c0mpute ad-generator-agent plugin (profullstack/c0mpute#106, DIP 0029). On by default; `AD_GENERATOR_AGENT=off` restores the old providers.

Ad type Before Now
Copy for every format (Medium Rectangle, Leaderboard, Mobile Banner, Text Link, Terminal, Feed, pre-roll lines, summaries) c0mpute first via #424 same route, labelled `ad-generator-agent/c0mpute`
Narration (video pre-roll voice + `audio` companion) ElevenLabs c0mpute `tts.synthesize` (kokoro `af_sarah`) via `C0MPUTE_SPEECH_URL`/`C0MPUTE_SPEECH_TOKEN`, else Infernet's public voice route. No worker = retryable error, never a paid voice
`image` hero gpt-image-2.5, then og:image og:image; gpt-image only with `AD_GENERATOR_PAID_IMAGES=1`. c0mpute has no live diffusion workers yet (see DIP 0029 for what is missing)
`static` / `gif` / `video` / `audio` assembly own worker (Chromium frames + ffmpeg) unchanged, no model involved

New: `lib/ads/agent.ts` (switches + speech target), c0mpute route in `lib/ads/video/narration.ts` (writes `narration.wav`, validates RIFF/WAVE).

Tests: `tests/ads-generator-agent.test.ts` mocks the Infernet `/api/chat` + SSE stream and the speech gateway: copy comes from c0mpute with no other network call, the hero step gets no paid client, narration posts one TTS job with the gateway bearer and never reaches ElevenLabs, 503 is retryable, 400/401 are not, non-audio is refused. Existing ElevenLabs tests pinned to `route: "elevenlabs"`. Full suite: 3012 passed.

🤖 Generated with Claude Code

/dashboard/ads/new now generates through the c0mpute ad-generator-agent
plugin (c0mpute DIP 0029):

- copy for every format: Infernet inference on c0mpute (backendAi router,
  p2p_only), provider shown as ad-generator-agent/c0mpute
- narration for video pre-roll + audio companion: c0mpute tts.synthesize
  through a speech gateway (C0MPUTE_SPEECH_URL/_TOKEN, else Infernet's
  public voice route), kokoro af_sarah; no worker = retryable, never a
  paid voice
- hero image: og:image; no gpt-image unless AD_GENERATOR_PAID_IMAGES=1
  (c0mpute has no live diffusion workers yet)
- static/gif/video/audio assembly unchanged: our own Chromium + ffmpeg

AD_GENERATOR_AGENT=off restores gpt-image heroes and ElevenLabs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
]);

it("buys one tts.synthesize job and writes the WAV it returns", async () => {
process.env.ELEVENLABS_API_KEY = "paid-key-must-not-be-used";
});

it("retries when no c0mpute worker took the job, instead of paying for a voice", async () => {
process.env.ELEVENLABS_API_KEY = "paid-key-must-not-be-used";
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

ThreatCrush Security Scan

50 finding(s)

HIGH/CRITICAL: 2 | MEDIUM: 30 | LOW: 18

Severity Rule Location
HIGH tls-verification-disabled lib/onion.ts:48
HIGH secret-generic-credential lib/sp/platforms/facebook.ts:32
MEDIUM js-unescaped-html-sink app/(app)/dashboard/admin/email-broadcast/EmailBroadcastForm.tsx:125
MEDIUM js-unescaped-html-sink app/(app)/dashboard/projects/[id]/autoblog/articles/[articleId]/page.tsx:214
MEDIUM js-unescaped-html-sink app/(marketing)/blog/[slug]/page.tsx:74
MEDIUM js-unescaped-html-sink app/(marketing)/blog/[slug]/page.tsx:102
MEDIUM js-unescaped-html-sink app/(marketing)/recent/page.tsx:177
MEDIUM js-unescaped-html-sink app/(marketing)/recent/page.tsx:181
MEDIUM js-unescaped-html-sink app/c/[project]/[slug]/page.tsx:76
MEDIUM js-unescaped-html-sink app/c/[project]/page.tsx:58
MEDIUM js-unescaped-html-sink app/careers.js/route.ts:228
MEDIUM js-unescaped-html-sink app/careers.js/route.ts:285
MEDIUM js-unescaped-html-sink app/layout.tsx:129
MEDIUM js-open-redirect app/login/form.tsx:40
MEDIUM js-unescaped-html-sink app/r/[token]/page.tsx:164
MEDIUM js-open-redirect app/signup/form.tsx:65
MEDIUM js-unescaped-html-sink app/surveys/[slug]/invite/page.tsx:68
MEDIUM js-unescaped-html-sink components/json-ld.tsx:8
MEDIUM js-unescaped-html-sink components/pit-footer.tsx:17
MEDIUM js-unescaped-html-sink components/report/markdown-view.tsx:16
MEDIUM js-unescaped-html-sink lib/careers/page-templates.ts:198
MEDIUM js-dynamic-code-execution lib/crawl-limits.ts:67
MEDIUM redos-nested-quantifier lib/emailMarkdown.ts:41
MEDIUM redos-nested-quantifier lib/emailMarkdown.ts:324
MEDIUM redos-nested-quantifier lib/lx/articleGen.ts:100
MEDIUM redos-nested-quantifier lib/tracker/agent-gate.ts:61
MEDIUM sh-predictable-temp-path ops/selfhost/server/setup-supabase.sh:218
MEDIUM sql-template-interpolation scripts/detect-slot-themes.ts:31
MEDIUM sql-template-interpolation scripts/purge-constructed-keywords.ts:163
MEDIUM sql-template-interpolation scripts/purge-offniche-keywords.ts:124
MEDIUM js-dynamic-code-execution scripts/test-crawl-limits.mjs:14
MEDIUM js-dynamic-code-execution scripts/test-crawl-limits.mjs:24
LOW secret-generic-credential app/(marketing)/docs/autoblog-webhook/page.tsx:156
LOW secret-generic-credential lib/sealed/migrate.ts:38
LOW secret-generic-credential lib/sp/platforms/linkedin.ts:25
LOW secret-generic-api-key tests/ads-generator-agent.test.ts:160
LOW secret-generic-api-key tests/ads-generator-agent.test.ts:187
LOW js-dynamic-code-execution tests/careers-page-templates.test.ts:21
LOW js-dynamic-code-execution tests/careers-widget-script.test.ts:19
LOW js-dynamic-code-execution tests/careers-widget-script.test.ts:69
LOW js-dynamic-code-execution tests/contract/ad-visitor-id.test.ts:51
LOW js-dynamic-code-execution tests/contract/ad-visitor-id.test.ts:52
LOW js-dynamic-code-execution tests/contract/ads-click-cooldown-redis.test.ts:20
LOW js-dynamic-code-execution tests/contract/ads-click-cooldown-redis.test.ts:24
LOW js-dynamic-code-execution tests/contract/ads-click-cooldown-redis.test.ts:25
LOW js-dynamic-code-execution tests/contract/ads-click-cooldown-redis.test.ts:26
LOW js-dynamic-code-execution tests/contract/ads-click-cooldown-redis.test.ts:31
LOW js-dynamic-code-execution tests/contract/ads-click-cooldown-redis.test.ts:35
LOW secret-generic-credential tests/contract/posthog-integration.test.ts:13
LOW secret-generic-credential tests/lead-campaign.test.ts:16

Snippets are redacted; ThreatCrush never prints matched credential material.

if (!isWav(buf)) throw new NarrationError("narration_bad_audio", true);

const filePath = path.join(input.workDir, "narration.wav");
await writeFile(filePath, buf);
…d on the shell

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sh1pt-actions-fleet
sh1pt-actions-fleet Bot merged commit bb37585 into master Nov 2, 2026
10 checks passed
@sh1pt-actions-fleet
sh1pt-actions-fleet Bot deleted the feat/ad-generator-agent branch November 2, 2026 13:25
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.

2 participants