Skip to content

Lower tree-sitter parse limits to cut CLI memory - #1557

Closed
vincenzosco wants to merge 0 commit into
CodebuffAI:mainfrom
vincenzosco:main
Closed

vincenzosco wants to merge 0 commit into
CodebuffAI:mainfrom
vincenzosco:main

Conversation

@vincenzosco

Copy link
Copy Markdown

The CLI parses the whole project with tree-sitter on every run, which pushed client RAM toward 2GB. Lower the default file count, per-file size and total byte budget so typical projects stay well under 500MB. The CODEBUFF_MAX_PARSE_* env vars still override these defaults.

@codebuff-team

Copy link
Copy Markdown
Contributor

The title and description only describe lowering the tree-sitter parse defaults in packages/code-map/src/parse.ts (10k→2k files, 1MB→300KB per file, 500MB→60MB total). That piece is plausible in isolation, but it's unexplained — no data on what 'typical projects' need, and cutting the per-file cap by 3x and total budget by 8x risks silently truncating code-map coverage on anything but small repos, with no benchmarks or fallback behavior discussed.

More importantly, the diff is nowhere close to matching the stated scope. It also includes:

  • common/src/constants/freebuff-models.ts and the matching test: re-locks Muse Spark 1.3 behind a paid plan, reverting a change the existing comments say was a deliberate product decision (#1525 referenced but no context given here). That's a pricing/catalog policy reversal bundled into a memory-limit PR — it needs its own PR and its own justification, not to ride along silently.
  • cli/src/utils/keyboard-actions.ts + test: absorbs Ctrl+Z in the composer. Reasonable on its own, unrelated to this PR's purpose.
  • sdk/src/native/ripgrep.ts: reorders an error message. Cosmetic, unrelated.
  • sdk/src/tools/run-terminal-command.ts + windows-bash.ts: a real, non-trivial change adding Windows bash-fallback spawning with PassThrough streams on EPERM. This is the kind of change that needs its own review, its own tests, and its own description — it's currently undocumented and unmentioned entirely.

As submitted, a maintainer cannot review or port this as 'lower tree-sitter parse limits.' Please split this into separate PRs: one for the parse limits (with reasoning/benchmarks), and separate ones for the model catalog change, the keyboard handling, and the Windows bash fallback — each with its own description and tests.

@codebuff-team codebuff-team added bot:triaged Classified by the community triage bot pr:rejected Not a change this project wants; closed with an explanation labels Oct 27, 2026
@vincenzosco vincenzosco closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:triaged Classified by the community triage bot pr:rejected Not a change this project wants; closed with an explanation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants