Skip to content

perf(setup): download an org in about 2s instead of 30s - #93

Merged
scott-lowe-vapi merged 1 commit into
mainfrom
perf/setup-download-speed
Nov 7, 2026
Merged

scott-lowe-vapi merged 1 commit into
mainfrom
perf/setup-download-speed

Conversation

@scott-lowe-vapi

@scott-lowe-vapi scott-lowe-vapi commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Value

V.A.L.U.E. tier: micro. It's a mechanical change of 36 lines across 3 files, and the before/after timings below prove it.

  • Problem: connecting an org through the setup wizard is slow. Picking "All" took 31.6s on an org of about 300 resources. Each API request returns in about 90ms and local work is under a second, so nearly all of that was fixed waiting.
  • Who it affects: everyone running npm run setup, including every npx create-vapi-app user, plus anyone running npm run pull.

How it works

  1. No --force pause for setup's own pulls. pull --force warns and waits 2s so someone typing it by hand can Ctrl+C. The wizard ran one --force pull per resource type, so 9 types meant 18s of pauses. setup now sets VAPI_GITOPS_FORCE_PAUSE=off for the pulls it starts, following the VAPI_GITOPS_ORG_PIN=off convention. A hand-typed --force still pauses.
  2. No request gap on GETs. api.ts waited 700ms between every request, reads included, which was about 9 of a plain pull's 11 seconds. Reads now skip the gap. A 429 is still retried with backoff (5 tries from 2s), as the config-free vapi-client.ts already does. Writes (POST, PATCH, DELETE) keep the gap.
  3. One pull for "All". Picking "All" ran 10 processes, each re-fetching credentials and its type's full list. It now runs the same two steps as non-interactive setup: a bindings-only pull, then one full --force --skip-bindings pull. "Let me pick…" still pulls by --id per type.
  4. Org folder created before the first pull. The org pin (.vapi-org.json) is only written into a folder that already exists. Non-interactive setup creates resources/<org>/ first, but the wizard didn't, so the pin used to come from its second per-type pull. With a single pull, nothing would have written it, so the wizard now creates the folder first too.

Verification

These are the exact command sequences each path runs, timed against a real org (scott-dev: 8 tools, 13 assistants, 8 structured outputs, 2 squads, 11 personalities, 118 scenarios, 118 simulations, 11 suites, 8 evals). They used read-only pulls in a throwaway copy of the repo.

Path Before After
Wizard, "All" 31.6s 2.2–2.5s
Wizard, "Let me pick…" with everything picked 31.6s 6.2s
Non-interactive setup / npm run pull 11.1s ~2.4s
Hand-typed npm run pull -- <org> --force 11.1s 3.8s (still pauses 2s)
  • Output unchanged: "All" via one pull and "pick everything" via per-type pulls wrote identical trees, 298 files, .vapi-org.json included.
  • No rate limiting: none of the runs logged a 429 retry. Separately, 11 concurrent list requests against production all returned 200.
  • npm run build passes, and npm test passes 584/584.

🤖 Generated with Claude Code

The wizard's All download took 31.6s on an org of about 300 resources;
almost all of it was fixed waiting, not network.

- Skip pull's 2s --force pause for setup's own pulls
  (VAPI_GITOPS_FORCE_PAUSE=off). The wizard ran one --force pull per type.
- Stop applying the 700ms request gap to GETs; 429s are still retried with
  backoff. Writes keep the gap.
- When All is picked, run one full pull instead of one per type.
- Create resources/<org>/ before the wizard's first pull, as non-interactive
  setup does, so the org pin is still written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@scott-lowe-vapi
scott-lowe-vapi marked this pull request as ready for review November 7, 2026 00:07
@scott-lowe-vapi
scott-lowe-vapi merged commit a820577 into main Nov 7, 2026
7 checks passed

Copy link
Copy Markdown
Contributor Author

Merge activity

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