[bug] The index shrink guard blocks legitimate rebuilds, so recall returns resources the member no longer has
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #1019 by @SaulMoro — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Start with guardIndexShrink in src/utils/search-index.ts and trace how the rebuild determines which files it was given versus how many it read. Adjust the guard to preserve the old index only for a partial read failure, then run the relevant search-index tests and verify that a legitimate rebuild to zero entries clears the stale index.
Written by the indexing model from the issue text.
Description
Description
teamai pull rebuilds the search index from what this member receives (#707). When that set shrinks to under 20% of the old index, guardIndexShrink in src/utils/search-index.ts treats the rebuild as a read failure and keeps the old index:
⚠ Index rebuild skipped: new index (0) is <20% of existing (7), likely partial failure
Nothing clears it, pull --force included. Recall keeps returning skills, rules, and docs the member no longer has, and every pull prints the warning.
Normal use triggers it. A member leaves a project with teamai projects set, switches roles, or the team deletes most of its resources.
The index should follow what the member receives. The guard should keep the old index only when the build read fewer files than it was given, the failure the guard exists to catch.
#83 reported the same symptom for deleted docs. Its fix (#98) lowered the threshold from 50% to 20%, so a large legitimate shrink still sticks.
Reproduction
The team has a project app whose skills namespace ns holds 7 skills, zqx-skill-1 to zqx-skill-7.
teamai init <team-url> --provider git --agent claude --scope project --project app
teamai installs the 7 skills in.claude/skills/. The index holds 7 entries.teamai projects set
No ids, so the member leaves every project.teamai pull
Pull removes the 7 skills and prints the warning above. The index still holds 7 entries.teamai recall "zqx-skill-3"
Recall returns[skills] zqx skill 3fromteam-repo/skills/ns/zqx-skill-3/SKILL.md.
To work around it, delete ~/.teamai/projects/<project>/search-index.json, then run teamai pull.
Environment
- OS: macOS (Darwin 27.0)
- Node.js: v24.21.0
- teamai:
mainat ec7d4db0 - Provider: git
- AI tool(s): Claude Code
Logs
Step 3, teamai pull
ℹ [project] Removed 7 skill(s) no longer delivered here: zqx-skill-1, zqx-skill-2, zqx-skill-3, zqx-skill-4, zqx-skill-5, zqx-skill-6, zqx-skill-7.
ℹ [project] No resources to sync
⚠ Index rebuild skipped: new index (0) is <20% of existing (7), likely partial failure
- Dominant language
- TypeScript
- Stars
- 5.6k
- Forks
- 471
- Avg merge
- 20h 16m
- Merged PRs (30d)
- 399
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Tencent/teamai-cli
-
bug help wanted
Difficulty 3/5 1-2 days Newbie friendliness 64/100
Tencent/teamai-cli#1539 ·
Maintainers usually reply within 1 day
-
[bug] codebase --deep-enrich in a team repo reports success but never publishes, and leaves the team clone dirtyPossibly taken @Kiddo4993 claimed this today. Openbug help wanted
Difficulty 4/5 1-2 days Newbie friendliness 35/100
Tencent/teamai-cli#1537 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
Tencent/teamai-cli#1523 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Tencent/teamai-cli#1516 ·
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Tencent/teamai-cli#1504 · 2 comments ·
Maintainers usually reply within 1 day
All issues in Tencent/teamai-cli
Similar issues
-
Parallel reticle_verify opens per-flow leases without the source lease's ignoreHTTPSErrorsPossibly taken @as992949791 claimed this today. Opengood first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
reticlehq/reticle#2033 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:quality p3-medium ready-for-agent type:docs
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
fderuiter/deruiter.dev#3589 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
manfredsteyer/angular-oauth2-oidc#1514 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
marmelab/react-admin#11431 ·
Maintainers usually reply within 1 day