Repository navigation
Fix example regeneration timeouts - #261
Conversation
generate-examples.sh skips setup.sh whenever example/ already exists, but example/ is committed without node_modules or .venv. The prompt preamble still told the agent dependencies were installed, so on a fresh clone the agent spent minutes searching the web and other directories for SDK types before installing them itself, pushing slow examples past the 600s timeout. Install dependencies when they are missing, and point the agent at the installed packages for SDK signature checks. Co-authored-by: tadas <tadas@elevenlabs.io>
… skills These prompts referenced /text-to-speech, so generate-examples.sh loaded the TTS SDK reference instead of the product skill, and the agent had to go find the right API docs on its own. Co-authored-by: tadas <tadas@elevenlabs.io>
Traces of timed-out runs showed the agent starting dev servers and installing playwright-core for headless browser checks, which eats the 600s budget and can hang the run. Co-authored-by: tadas <tadas@elevenlabs.io>
One cleanup effect depended on both object URLs, so setting the dubbed URL revoked the original recording and broke its player. Revoke each URL only when it is replaced or on unmount. Also show "Transcribing your recording…" as soon as polling starts and use the "Dub Recording" label, as PROMPT.md requires. The generator kept attempting these fixes and timing out midway. Co-authored-by: tadas <tadas@elevenlabs.io>
On runners without python3-venv, the new dependency install turned every Python example into a setup failure even though the agent can verify those examples without a virtualenv. Use uv when it is available, remove partial installs, warn instead of failing, and only tell the agent dependencies are installed when they actually are. Co-authored-by: tadas <tadas@elevenlabs.io>
The page used bordered boxes, a wrapped waveform, and uppercase headings, which DESIGN.md disallows, and it cleared state with setState inside an effect, which fails react-hooks/set-state-in-effect. The generator rewrote this page on almost every run and usually timed out partway. Flatten the layout, clear transient state in onDisconnect/onError, surface real token and connection errors, show connecting/error status, show the waveform processing state while connecting, and key history by id. Co-authored-by: tadas <tadas@elevenlabs.io>
Object URLs and stale-result handling were driven by setState inside effects, which fails react-hooks/set-state-in-effect. Create URLs in the event handlers and revoke each one when it is replaced or on unmount. Changing the voice or recording again now also ignores any in-flight conversion, and the player is labeled "Converted Audio" per PROMPT.md. Co-authored-by: tadas <tadas@elevenlabs.io>
react-hooks/immutability rejects writing .current on a prop unless the prop name ends in Ref. Co-authored-by: tadas <tadas@elevenlabs.io>
The SDK returns the DOM ReadableStream type, which Node's Readable.fromWeb typings reject under strict typecheck. The generator added this same cast on most runs. Co-authored-by: tadas <tadas@elevenlabs.io>
The SDK stream yields Uint8Array chunks, which are not assignable to Buffer[] under strict typecheck. The generator made this same change on the last two verification runs. Co-authored-by: tadas <tadas@elevenlabs.io>
PR SummaryLow Risk Overview
Prompts for dubbing, voice-changer, and voice-isolator now point at their own skills ( Example fixes so verify runs stop rewriting: dubbing splits object-URL cleanup so the original player isn’t revoked when the dub arrives, plus prompt-aligned polling copy; realtime STT gets DESIGN.md-style layout, stable history keys, and disconnect/error handling without setState-in-effect; voice-changer drops effect-driven setState, ignores stale conversions after voice changes, and uses per-URL revoke effects; agents quickstart renames the transcript ref prop for immutability lint; TypeScript quickstarts fix strict typing for audio streams/chunks. Reviewed by Cursor Bugbot for commit 065f1a6. Bugbot is set up for automated code reviews on this repo. Configure here. |
Why regeneration kept timing out
Stream traces of the Cursor CLI runs that hit the 600s limit (dubbing, speech-engine, realtime speech-to-text) showed three causes:
generate-examples.shskipssetup.shwheneverexample/exists, andexample/is committed withoutnode_modules/.venv. The preamble still said "example/is ready with dependencies installed", so agents spent 3-5 minutes on web searches, fetching.d.tsfiles from jsDelivr, and reading other clones before runningpnpm installthemselves (5 seconds).playwright-corefor headless Chrome checks.DESIGN.md, or lint. The agent correctly flagged real gaps and started a large rewrite each run, then got cut off partway. This is the source of the recurring leftover diffs in dubbing, realtime STT, and voice-changer.Changes
Script (
scripts/generate-examples.sh)pnpm install;uvorpython3 -m venvfor Python). A failed install is a warning, not a failure, and the preamble only claims dependencies are installed when they are.Prompts
/text-to-speech, so the right SDK reference is auto-loaded.Examples (each one is something the generator kept trying to fix)
dubbing/nextjs/quickstart: the single cleanup effect revoked the original recording's object URL as soon as the dub arrived, which broke its player. Also uses the "Dub Recording" label and initial "Transcribing your recording…" status from the prompt.speech-to-text/nextjs/realtime: flat layout perDESIGN.md, real token/connection error messages, connecting/error status, stable history keys, and transient state cleared inonDisconnect/onErrorinstead of setState in an effect (lint error).voice-changer/nextjs/quickstart: fixes threereact-hooks/set-state-in-effectlint errors, ignores in-flight conversions after the voice changes, and labels the player "Converted Audio" per the prompt.agents/nextjs/quickstart: rename the ref prop soreact-hooks/immutabilityaccepts.currentwrites.sound-effects/typescript/quickstartandtext-to-speech/typescript/quickstart: fix strict typecheck errors (DOM vs NodeReadableStream;Uint8Arraychunks in aBuffer[]).Verification
Full
pnpm generate(default 600s timeout) on a fresh clone of this branch:The one update was the
text-to-speech/typescripttype fix, which is now included here. Before these changes, the same run (after skills PR #143) was0 generated · 16 verified · 1 updated · 3 failedin 1h 23m 26s. Slow examples are now well under the limit: dubbing 1m 31s, realtime STT 1m 43s, speech-engine 4m 31s, voice-changer 2m 19s.Also ran:
tsc --noEmitandeslint .on every changed Next.js example, Prettier on all changed files,bash -non the script, and stub-cursorruns covering the uv install, failed-venv fallback, Node-with-assets, and freshsetup.shpaths.Note:
setup.shneedsrsync, which isn't installed on the automation runner image. That only matters when anexample/directory has to be scaffolded from scratch.