Skip to content

Fix example regeneration timeouts - #261

Merged
tadaspetra merged 10 commits into
mainfrom
cursor/skills-examples-regeneration-6c5c
Oct 23, 2026
Merged

tadaspetra merged 10 commits into
mainfrom
cursor/skills-examples-regeneration-6c5c

Conversation

@cursor

@cursor cursor Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

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:

  1. Missing dependencies, but the prompt said they were installed. generate-examples.sh skips setup.sh whenever example/ exists, and example/ is committed without node_modules/.venv. The preamble still said "example/ is ready with dependencies installed", so agents spent 3-5 minutes on web searches, fetching .d.ts files from jsDelivr, and reading other clones before running pnpm install themselves (5 seconds).
  2. Browser verification. Agents started dev servers and installed playwright-core for headless Chrome checks.
  3. Examples that don't meet their own prompt, 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)

  • Install example dependencies before verification when they are missing (pnpm install; uv or python3 -m venv for Python). A failed install is a warning, not a failure, and the preamble only claims dependencies are installed when they are.
  • Tell the agent to check SDK signatures against the installed packages and to verify with typecheck and lint only (no dev servers, browsers, or extra tooling).

Prompts

  • Point the dubbing, voice-changer, and voice-isolator prompts at their own skills instead of /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 per DESIGN.md, real token/connection error messages, connecting/error status, stable history keys, and transient state cleared in onDisconnect/onError instead of setState in an effect (lint error).
  • voice-changer/nextjs/quickstart: fixes three react-hooks/set-state-in-effect lint 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 so react-hooks/immutability accepts .current writes.
  • sound-effects/typescript/quickstart and text-to-speech/typescript/quickstart: fix strict typecheck errors (DOM vs Node ReadableStream; Uint8Array chunks in a Buffer[]).

Verification

Full pnpm generate (default 600s timeout) on a fresh clone of this branch:

0 generated · 19 verified · 1 updated · 0 failed
Total time: 50m 28s

The one update was the text-to-speech/typescript type fix, which is now included here. Before these changes, the same run (after skills PR #143) was 0 generated · 16 verified · 1 updated · 3 failed in 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 --noEmit and eslint . on every changed Next.js example, Prettier on all changed files, bash -n on the script, and stub-cursor runs covering the uv install, failed-venv fallback, Node-with-assets, and fresh setup.sh paths.

Note: setup.sh needs rsync, which isn't installed on the automation runner image. That only matters when an example/ directory has to be scaffolded from scratch.

Open in Web View Automation 

cursoragent and others added 10 commits October 22, 2026 16:31
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>
@tadaspetra
tadaspetra marked this pull request as ready for review October 23, 2026 18:36
@cursor

cursor Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

PR Summary

Low Risk
Changes are limited to example apps, prompt docs, and the local generation script; no production API or auth paths are modified.

Overview
Fixes example regeneration timeouts by changing how generate-examples.sh prepares verify runs and by aligning several committed examples with their prompts, lint, and typecheck.

scripts/generate-examples.sh now installs missing node_modules/.venv when example/ already exists (instead of only skipping setup.sh), only tells the agent dependencies are ready when they actually are, and restricts verification to typecheck and lint (no dev servers, browsers, or extra tooling). Failed dependency-only installs warn and continue.

Prompts for dubbing, voice-changer, and voice-isolator now point at their own skills (/dubbing, /voice-changer, /voice-isolator) instead of /text-to-speech.

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.

@tadaspetra
tadaspetra merged commit 07454da into main Oct 23, 2026
3 checks passed
@tadaspetra
tadaspetra deleted the cursor/skills-examples-regeneration-6c5c branch October 23, 2026 18:48
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