You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hardcoded maxSteps: 60 for dreamer-docs and dreamer-memory-mapper #813
Hardcoded maxSteps: 60 for dreamer-docs and dreamer-memory-mapper causes early termination on mid-to-large codebases
What happened?
### Describe the Bug
In `@cortexkit/pi-magic-context`, the hidden subagents `dreamer-docs` (used by `maintain-docs`) and `dreamer-memory-mapper` (used by `map-project-memories`) have their step limits hardcoded to `60`:
```javascriptvarAGENT_STEPS= {
[HIDDEN_CURATE_AGENT]:150,
[DREAMER_MEMORY_MAPPER_AGENT]:60,
[DREAMER_DOCS_AGENT]:60,
[DREAMER_PRIMER_INVESTIGATOR_AGENT]:40,
[DREAMER_RETROSPECTIVE_AGENT]:40
};
Unlike curation tasks which operate primarily within the context store, dreamer-docs and dreamer-memory-mapper rely heavily on iterative tool calling (read, grep, glob, etc.) to traverse directory hierarchies, read files, and verify documentation state across the workspace.
Diagnostics
On medium-to-large repositories (or any project with non-trivial documentation structures), 60 tool calls are quickly exhausted before the dreamer can finish inspecting relevant files and synthesizing updates. The task fails with a step limit breach:
HiddenAgentStepLimit: dreamer-docs step limit exceeded (cap: 60)
or subagents stop prematurely without completing document maintenance or memory mapping.
### Suggested Fix
Either:
1. Increase default `maxSteps` for `dreamer-docs` and `dreamer-memory-mapper` (e.g., to 200–400).
2. Or allow configuring `max_steps` under `dreamer.pi.tasks.<task>.max_steps` in the configuration schema, similar to `timeout_minutes` and `token_budget`.
The error in the report doesn't match what Magic Context prints on Pi. There, a step limit is logged as Hidden agent pi-dreamer exceeded its 60-step limit, with failure class step_limit. Could you paste:
the actual log lines from ~/.local/share/cortexkit/magic-context/logs/ (search for step-limit or step_limit);
which task hit it (map-memories or maintain-docs);
roughly how many memories the project has, or how many files its docs tree has.
If maintain-docs genuinely runs out on a real docs tree, we'd fix that by splitting the docs work into smaller units, the way memory mapping is split, rather than by raising the cap.
Activity
magic-alfonso commentedon Oct 29, 2026
Thanks for the report. Some context on how these caps apply, and what would help us check whether they're too low.
The error in the report doesn't match what Magic Context prints on Pi. There, a step limit is logged as
Hidden agent pi-dreamer exceeded its 60-step limit, with failure classstep_limit. Could you paste:~/.local/share/cortexkit/magic-context/logs/(search forstep-limitorstep_limit);If maintain-docs genuinely runs out on a real docs tree, we'd fix that by splitting the docs work into smaller units, the way memory mapping is split, rather than by raising the cap.