Repository navigation
[Bug] Lags due to a heavy usage of subagents #1044
Description
Summary
When I tried to use commandcode for a very long and heavy tasks (analyzing ~25 of PDF files using subagents, reading many .docx, usage of cadcraft-cli mcp), the whole commandcode started lagging visibly (animation was slower, subagents stopped responding after a while completely, so the whole work was stopped because of that and I lost some tokens). In my other tasks, more simple (like change one feature on the website to another one) commandcode didn't have such behaviour, so I guess exactly heavy usage causes that.
Expected Behavior
A normal, perhaps opencode-like work on the tasks
Actual Behavior
First it was working accurately, but then it started lagging, most of subagents (I guess) were ratelimited, and meanwhile the whole CommandCode was lagging visibly in the terminal.
Steps to reproduce the issue
- Install CADCraft and cadcraft-cli (from https://github.com/storytold/cadcraft)
- Create a directory (for example,
test) - Put some folders and files inside (a few folders with ~25-30 .pdf, .docx files); set up cadcraft-cli mcp for commandcode in this folder
- Enter it, run
commandcode --yoloinside - Give commandcode a similar prompt:
You have a few folders, one file and mcp (cadcraft) to do your work.
1. Folder 'examples' contains some examples of tasks: some .pdf files, some .docx files. Those files contain rules in Russian,
and they explain how to do the work. DO NOT READ THEM ON YOUR OWN. Use `docs/examples.md` instead. The folder itself is too big and has too many files - this file has a summary.
2. File 'EXAMPLE.dwg' is an example of CADCraft (AutoCAD) .dwg
schema. This is your main task, you will complete the similar one based on the task.
3. Folder 'task' contains the exact task. Analyze it through the subagent precisely first, summarize the content to single .md
file, and then process it with creating a schema, with mcp.
4. Folder 'docs' will contain your .md files through the work - create .md files through subagents to contain summarized content
from .pdf, .docx files and your new knowledge about the work, then read it when necessary.
5. Folder 'result' will contain your final result of your work.
You can use Python scripts, you can use TypeScript (Bun) scripts. Ask questions if you have such.
- During the execution, it may spawn up to 5 subagents, which will be ratelimited and will cause heavy lags to the CLI.
Command Code Version
1.84.0
Operating System
Linux
Terminal/IDE
Unknown
Shell
bash
Session file (optional)
No response
Fix prompt (optional)
No response
Additional context
The lags started only after some time after subagents were started.
opencode2 didn't have such issues - subagents were ratelimited first, I asked it to use only up to two subagents, and the task was done in two hours, so I guess there is some kind of memory leak / inefficiency inside the commandcode itself.
I lost some tokens during the lags, so I hope they weren't wasted for nothing and we will make CommandCode better together!
Activity