Replace Replicate: Gondola for non-agentic, Cursor CLI Grok high for agentic #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Stop using Replicate in this worker. Split live generation:
https://api.gondola-ai.com/v1.agent) on the latest Cursor Grok SKU at high, not fast. Today that is Grok 4.6 (cursor-grok-4.6-high). Detect a newer Cursor Grok when the catalog ships one and prefer it, still high / not-fast. At most one agentic workflow per UTC day.This replaces the live path in #5. Do not keep investing in
api.replicate.com. Fixture tests stay local (FixturePredictor). Voice copy remains canonical in CL8Y-webblog_gen/SKILL.md. Hero contract (path, JPEG, one image per week) stays; the provider for this worker's--imagepath becomes Gondola, not Replicate.Current codebase
src/replicate.rs+--liveare a Replicatepredictions.createclient (unverified API shape, budget charged before POST, poll does not wait for terminal status). Every paid text step (plan,outline,draft, editor bundle, optional image) goes throughPredictor::create_oncewithmodel: "fixture-or-replicate".There is no agent runtime: the pipeline cannot inspect
sources.json, run search, cycle lint, or write files except via a single string return. #6 (editor cycle + grounding) is a poor fit for a one-shot HTTP completion.Env today:
REPLICATE_API_TOKEN,REPLICATE_TEXT_MODEL,REPLICATE_IMAGE_MODEL,REPLICATE_WEEKLY_CREATE_BUDGET.cl8y-research fetch PREDICTION_IDis Replicate-only.Why this is needed
Replicate is the wrong spend and the wrong API for both jobs:
gnd_….predictions.create. Cursor CLI is already how this repo is developed; pin Cursor Grok high, never the fast SKU (fast costs more and is the default trap).Constraints / guardrails
api.replicate.com. Remove or gateREPLICATE_*once Gondola + Cursor CLI land. Secret lint must includeGONDOLA_,gnd_,CURSOR_API_KEY(keep existingREPLICATE_markers until leftovers are gone).api.gondola-ai.comonly; no redirects; no private/link-local; allowlist insrc/allowlist.rs. Base URL ishttps://api.gondola-ai.com/v1(do not append/chat/completions). Pin model ids in config; discover viaGET /v1/models. Gondola is not bound by the daily agentic cap (weekly request budget still applies).agent -p --trust --workspace <run-or-repo>(no--yolo/--forceunless a later issue justifies it). Model: latest Cursor Grok, reasoning high, fast=false. Do not usecursor-grok-*-high-fastor Composer as the weekly writer. If the CLI/SDK would silently flip to fast, fail closed.weekthat reaches plan/outline/draft/editor is that day's workflow. Prefer one Cursor session for the whole agentic pipeline that day (--resumeof that chat id between stages).#6editor cycles must stay inside that same session/day — they are not a second workflow. A secondweek --live(or any newagentsession) on the same UTC date fails closed and must not spawnagent.--resumeof the logged chat id from today is recovery, not a new workflow.--dry-run, fixtures, collect-only, Gondola-only, andfetchdo not count. Persist the day + chat id (Postgres when available, else a 0600 lock file under the run/state dir) before spawningagent; crash after persist without a session still consumes the day (fail closed, recover with--resumeif an id exists). Clock is UTC. No operator override flag in v1.agent --list-models/agent models) and pick the newest Cursor Grok high / not-fast. Cache the pin in the run report. If the catalog has no Grok high / not-fast, abort — do not fall back to fast or to a random flagship. Today:cursor-grok-4.6-high(confirm slug againstagent --list-modelsat implement time). Catalog listing is not an agentic workflow.wrap_untrusted/ lint /assert_clean_artifact. Agents must not execute collected repo content. SSRF rules unchanged.GONDOLA_API_KEY/CURSOR_API_KEY.FixturePredictor(rename ok) so CI needs neither Gondola nor Cursor.--liverequires Gondola key for non-agentic steps and Cursor auth (CURSOR_API_KEYoragent login) for agentic steps.CL8Y-webmain. Do not remountRETIRED_HOMEPAGE_MODULES. Do not rewriteCL8Y_WHITEPAPER.md.Suggested stage split
EMBEDDING_DIMor this issue includes a documented migration)--mode planis acceptable for the plan stage); shares the day's single workflow--resume)--resume)--imageIf a step can be a single JSON completion with no tools, it may stay on Gondola. Do not send agentic work to Gondola and do not send one-shot image/embed to Cursor CLI.
Relevant files
src/replicate.rsPredictor/ budget / wrapsrc/pipeline.rssrc/main.rs--live,fetch; add model-pin / catalog commandsrc/config.rssrc/allowlist.rsapi.gondola-ai.comsrc/embed.rssrc/invariants.rssrc/secrets.rs.env.exampleGONDOLA_*,CURSOR_*; retireREPLICATE_*docs/invariants.md+ READMERecommended direction
src/gondola.rsor renamereplicate): OpenAI-compatiblechat.completions+ images (+ embeddings if catalog has a dim we can pin).GONDOLA_API_KEY,GONDOLA_BASE_URL=https://api.gondola-ai.com/v1, pinnedGONDOLA_TEXT_MODEL/GONDOLA_IMAGE_MODEL(fail--liveif unset). httpmock cassettes. Charge budget after accept+id.agentwith--model <resolved-slug> -p --output-format json --trust --workspace. Resolve slug from catalog: newestcursor-grok-*that is high and not*-fast. Log resolved id inreport.md. Parse output; treat as untrusted.agentic_utc_date+ optionalchat_idbefore the firstagentspawn. Same-day second spawn →Error(typed, testable). Next UTC date clears the lock. Do not use local TZ.cl8y-research modelsprints GondolaGET /v1/modelsandagent --list-models, and the pin this week would use.fetchrecovers Gondola ids; agentic recovery is--resume <chatId>for today's session only.Cursor CLI notes (implement against current
agent --help, do not copy stale slugs blindly):--modelexists;--list-models/agent modelslist account SKUs. Fast vs high is a separate SKU (…-high-fastvs…-high). Fast has been a silent default in other Cursor surfaces — pin and assert.Acceptance criteria
--livedoes not send traffic toapi.replicate.com.GONDOLA_API_KEYor pinned models fails closed.agentprocess).--resumeof today's id still allowed. Next UTC day is allowed.GONDOLA_API_KEY/gnd_/CURSOR_API_KEY.--imagewrites a JPEG via Gondola (or placeholder when off), same hero path contract.report.mdrecords provider, model pins, prediction/session ids, and the UTC date of the agentic run — never tokens.docs/invariants.mdno longer describe Replicate as the live generator; they state the daily agentic cap.Test plan — functional paths
--model(high, not fast) and--workspace; stdout parsed.cursor-grok-4.6-high,cursor-grok-4.6-high-fast,cursor-grok-4.7-high→ pick4.7-high.--dry-runstill collect + plan only; live plan uses agentic backend when--live.agent; run on D+1 succeeds.--resumeof the D chat id on D does not count as a second workflow; a new session on D does.Test plan — attack, hack, and abuse
agentsessions on poll/timeout without a logged id; scheduler/week --livetwice the same day cannot launch a second Grok run.*-high-fastis an error.--workspaceis the run dir or repo root, not/.--live. Do not honor a future-dated lock as "already ran tomorrow."agentsession.Verification criteria
agent --list-modelspin recorded in a throwaway run.report.mdwhich Grok slug ran, that it was not fast, and the UTC date of the agentic workflow.marked as related to #5
changed the description
Amendment: agentic Cursor CLI workflows are capped at once per UTC day. One live week (plan → editor, including #6 cycles) is that day's workflow;
--resumeof today's chat id is recovery. A secondweek --live/ newagentsession the same day fails closed. Gondola non-agentic calls are not under this cap. Description updated accordingly.