# Fix the locale QA agent timing out scanning a monorepo

## TL;DR

The QA scan tries to do the whole monorepo in one pass, so shard it by package and raise the timeout per shard. Missing-strings checks are per package anyway, so splitting is natural. Run packages in parallel with a per-shard timeout, then merge the reports.

## The error

```text
Locale QA agent timed out after 30 minutes scanning the monorepo
missing-strings check never finished, no report produced
```

## Fix it

### Step 1: List the packages to shard by

```bash
ls packages/ | head -20
```

Expected: You see the shard units.

### Step 2: Run the QA check per package

```bash
node -e "console.log('loop packages, run the missing-strings check per package with its own timeout, collect JSON reports')"
```

Expected: Each shard gets its own deadline.

### Step 3: Raise the per-shard timeout sanely

```bash
node -e "console.log('10 minutes per package beats 30 for everything, and a stuck package fails alone')"
```

Expected: Slow packages fail individually instead of killing the run.

### Step 4: Merge the shard reports

```bash
node -e "const fs=require('fs'); console.log('concat the per-package JSON reports into one missing-strings report')"
```

Expected: One report covers the monorepo.

## When to use this

- A locale QA agent times out on a monorepo scan
- Missing-strings checks never complete

## When NOT to use this

- The scan finishes but is wrong, check the check logic
- One package alone times out, that package has the problem

## Tool and version compatibility

- Any monorepo layout with per-package sources
- Missing-strings checks that read per-package catalogs

## Variant phrasings

### timeouts only in CI

CI runners are slower. Shard there too, or raise CI timeouts to match local.

### one giant package dominates

Shard that package by folder. Sharding is recursive, apply it where the time goes.

## Why it happens

A single timeout for a whole monorepo assumes linear scaling, but large repos have superlinear slowdowns from cross-package file walks. One stuck package eats the whole budget and no report comes out.

## Edge cases

- Shared packages get scanned multiple times, dedupe shared deps across shards
- Report merging must handle duplicate keys across packages deliberately
- Cache per-shard results, unchanged packages skip on the next run

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_aG2jPCkxJKoddHrkN8Xpow
