docs agent failed: search index rebuild timed out on large repo
Fixes a docs search-index rebuild that times out on large repositories. Use when the index step of a docs build exceeds the agent's timeout and the site ships with a stale or missing search index. Key trigger: the search index step consistently hits the timeout on big repos.
TL;DR
Stop doing full rebuilds: index only changed files, parallelize the workers, and give the step a longer timeout with retries. Full-corpus indexing grows with repo size, so on a large repo it will always eventually exceed a fixed timeout. Incremental indexing keeps each run roughly constant time.
docs agent failed: search index rebuild timed out on large repoSteps
- Measure the step: time the index rebuild on the full repo and compare against the agent's timeout. Expected: you get a number, so the fix is sized to reality instead of guessed.
- Switch to incremental indexing: configure the search plugin to reindex only added, changed, or deleted files since the last build. Expected: the index step drops from minutes to seconds on typical runs.
- Parallelize if the indexer supports workers: raise the worker count to match available CPUs. Expected: near-linear speedup on the unchanged full-rebuild path.
- Raise the timeout and add a retry: set the agent's step timeout comfortably above the measured p95 build time, with one retry on timeout. Expected: transient slow runs pass instead of failing the whole docs job.
- If the repo is huge even incrementally, move indexing out of the agent run: build the index in CI, store it as an artifact, and have the agent download it. Expected: the agent's docs step no longer indexes at all.
Use this when
- the docs search index step times out on large repos
- the built site has a stale or empty search index after agent runs
- index rebuild time grows with every release
Not for this skill when
- search is broken but the index builds fine (query or frontend bug)
- the whole docs build times out, not just indexing (build performance problem)
- the index is small and still slow (misconfiguration, not scale)
Variant phrasings
- docs search index build timed out
- search index rebuild too slow on monorepo
- agent timed out building docs search index
Why it happens
Full rebuilds re-read and re-tokenize every page on every run, so index time scales with total corpus size while the agent's timeout stays fixed. Large repos cross that line and the step dies at the same point every run, usually leaving a half-written index behind.
Edge cases
- A half-written index from a killed run can corrupt search: delete the partial index before retrying.
- Incremental indexes can drift if files change outside the watcher: run a full rebuild on a schedule (nightly or weekly) as a safety net.
- Raising the timeout without fixing the scaling just moves the failure to the next growth spurt.
- Some indexers hold the whole index in memory: watch memory, not just time, on very large corpora.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstpJUq4sUB3oAuyMUKr3UDg