Skip to content

The TypeScript tier cannot index a large monorepo through its root tsconfig, and every delta repeats the full cost #1678

Done

Description

@KaloyanNaumov

Company

Independent

Component

Code index

Describe what's wrong

Loom has a hard time indexing large TypeScript monorepos such as OpenClaw. Loading the umbrella root tsconfig.json (project references plus workspaces) eats more memory than a large host can give: scip-typescript ran out at a 24 GiB V8 heap, with RSS still climbing when it died and no project finished. The cost isn't only on the first index. Every delta pays it again, because the delta re-runs every configured project and only narrows the converted output to the changed files. And even with enough memory, a pass takes hours.

TL;DR: a TypeScript monorepo with an umbrella root can't be indexed through that root, and once it is indexed some other way, each new commit re-runs the whole project set. A tier that chose projects by the commit's changed paths, and recognised an umbrella root, would make these repositories practical.

What we measured on OpenClaw, listing its projects by hand in scip_ts_projects (223 entries, which we expanded from globs on our side):

run wall time peak RSS
root tsconfig.json, scip_ts_projects unset aborted (V8 out of memory at a 24 GiB heap, RSS still rising) over 24 GiB
full pass over the 223 projects about 75 to 95 min about 23 GiB
a delta after a one-file TypeScript change the same as the full pass the same

In run_typescript_delta.sh, every configured target is indexed on each pass, and the changed-file list only skips the run when no TypeScript file changed and bounds what is converted afterwards.

Does it reproduce on the latest release or main?

Yes

How to reproduce

  1. Configure an entry for https://github.com/openclaw/openclaw with scip_ts_projects unset, and let the TypeScript tier run: node aborts with a heap out-of-memory.
  2. Set scip_ts_projects to its project directories: the first full pass completes in about an hour and a half.
  3. Push a one-line change to a TypeScript file: the next delta runs every project again, for about the same time and memory.

Expected behavior

Could the delta index only the projects that contain the commit's changed files, falling back to the full set when a shared config or lockfile changes? And could the tier recognise an umbrella root (one that only references other projects) and index its member projects itself, instead of needing the list by hand?

Environment

Built from main; ClickHouse 26.10; Kubernetes; @sourcegraph/scip-typescript 0.4.0; node 22; the workers pod has a 64 GiB limit.

How this was found

I found and reproduced it myself

Redaction

  • I removed tokens, keys, passwords and personal or customer data from everything above.

Activity

  1. added
    bug
    help wanted
    up-for-grabs
    on Nov 28, 2026
  2. ZYZ666-RGB commented on Nov 30, 2026

    @ZYZ666-RGB
    Contributor

    I'll work on this. Plan is a scoped fix in the TypeScript tier: treat an umbrella root tsconfig (project references only) as its member projects, and on a delta index only the projects that contain the commit's changed files, falling back to the full set when a shared config or lockfile changes.

  3. added a commit that references this issue on Dec 1, 2026
    1bc5be8
  4. KaloyanNaumov commented on Dec 1, 2026

    @KaloyanNaumov
    ContributorAuthor

    A correction to this issue's text: the repository's root tsconfig.json does not only reference other projects. It has "include": ["src/**/*", "ui/**/*", "extensions/**/*", "packages/**/*"] and no references, so the memory goes into that root program, not into a references graph.

    What #1782 detects is the shape this issue described, a root with references and no files of its own, so this repository's root is still indexed as one program unless scip_ts_projects lists its projects; without the list the full pass still runs out of heap. With the list, #1782's per-member runs and delta selection work here: a delta in one package runs one project in under a minute at 0.95 GB. The include-style root is tracked in #1960.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bughelp wantedup-for-grabs

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions