Skip to content

Hardcoded maxSteps: 60 for dreamer-docs and dreamer-memory-mapper #813

Open

Description

@izhangzhihao

Short description

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`:

```javascript
var AGENT_STEPS = {
  [HIDDEN_CURATE_AGENT]: 150,
  [DREAMER_MEMORY_MAPPER_AGENT]: 60,
  [DREAMER_DOCS_AGENT]: 60,
  [DREAMER_PRIMER_INVESTIGATOR_AGENT]: 40,
  [DREAMER_RETROSPECTIVE_AGENT]: 40
};

and in agent declarations:

{
  id: "dreamer-docs",
  // ...
  allowedTools: ["read", "grep", "glob", "aft_outline", "aft_zoom", "aft_search"],
  maxSteps: 60,
  // ...
}

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`.

Plugin version

0.49.28

OpenCode version

No response

Platform

No response

Client

Pi

Log output (optional)

Activity

  1. magic-alfonso commented on Oct 29, 2026

    @magic-alfonso

    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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions