Skip to content

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

Open
vincenzosco wants to merge 5 commits into
CodebuffAI:mainfrom
vincenzosco:main
Open

vincenzosco wants to merge 5 commits 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.

vincenzosco and others added 5 commits October 27, 2026 07:20
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.
When antivirus or ASR blocks the bundled bash.exe, spawn fails with EPERM
as an async error event, so the command never ran. Retry the same command
with the next installed bash, keeping one set of stdout/stderr streams.
Muse Spark 1.3 now requires a plan again, matching the README (CodebuffAI#1525).
The ripgrep error no longer prints "undefined" when the bundled binary
is missing (CodebuffAI#1493).

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Ctrl+Z fell through every rule in resolveChatKeyboardAction and ended in the
final "none" branch, so nothing in the composer handled it. Handle it
explicitly as a no-op so it cannot reach any other handler, and cover it with
a test next to the Ctrl+Q tests.
@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

This branch has not been deployed

No deployments
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