Repository navigation
feat(import): expose --max-files and warn on truncated code collection - #1196
Merged
Merged
Conversation
`teamai import` capped code collection at a hardcoded 200 source files per repository and truncated silently, so a larger repository produced a partial knowledge graph with no signal. `--max-files <n>` now sets the cap for `--dir`, `--from-repo` and `--from-repo-list`; the default stays 200. When a source has more candidate files than the cap, the run warns with both counts and points at the flag. Closes Tencent#1194
|
No findings in the scoped PR diff. The PR description documents sufficient testing, including a representative real-CLI run covering truncation, default collection, and invalid Review was read-only; I did not run, build, or install anything from the PR. |
jeff-r2026
approved these changes
Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1194
Summary
teamai importcollected at most 200 source files per repository from a hardcoded cap, and truncated silently — a repository with more files produced a partial knowledge graph with no signal. This adds--max-files <n>to set the cap per run (the default stays 200) and warns with both counts when a source is truncated.Change
CLI:
teamai import --max-files <n>, validated as a positive integer (--max-files must be a positive integerotherwise, exit 1).Plumbing:
import.ts→--dir/--from-repo/--from-repo-list→importLocalCheckout/importFromRepo/importFromRepoList→importCodebase→extractCodebase. The extractor already acceptedmaxFiles; only the CLI entry was missing.Warning:
collectCodenow also returns the candidate count, andextractCodebasewarns when files were dropped instead of truncating silently:Collection order is unchanged (key files first).
Docs:
docs/guide/knowledge.mdand its zh-CN page;skill-data/core/references/commands.mdregenerated withnpx vitest run commands-reference -u.Type of Change
Test Plan
npm run build✓,npx tsc --noEmit✓,npm run lint✓ (0 errors).npx vitest run codebase-extract-fallback→ 18 passed, including two new tests:--max-filescaps collection and warns with both counts; no warning when every candidate fits.codebase-*,import-*,ci-extract-mr,anchors,dry-run-load-path,scala/swift-extractor): 244 passed, 5 failed — all five are pre-existing Windows-only failures. A run on pristineorigin/main(fe3b906) reproduces the identical failures (C:/vsC:\path forms inanchors, a|in a temp path incodebase-reconcile, EPERM/timeout indry-run-load-path).dist/index.jsagainst a temp repo with 6 source files:Notes for Reviewers
--from-repo-listforwards the same cap to each repository it imports.--from-mrandteamai ci extract-mrkeep their own internal limits and are untouched.