Skip to content

feat(coding-agent): default RLM max depth to 2 - #1493

Open
sethkarten wants to merge 3 commits into
mainfrom
fix/rlm-default-max-depth-2
Open

feat(coding-agent): default RLM max depth to 2#1493
sethkarten wants to merge 3 commits into
mainfrom
fix/rlm-default-max-depth-2

Conversation

@sethkarten

@sethkarten sethkarten commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Change the fallback RLM maximum depth from 1 to 2, allowing root agents to delegate through grandchildren by default.
  • Preserve all existing environment, global, inherited, and per-chat overrides.
  • Update the focused recursion assertions and runtime documentation.

This change is intended for a later release and is not part of v0.7.3 (#1492).

Validation

  • npx tsx ../../node_modules/vitest/dist/cli.js --run test/agent-session-recursion.test.ts (96 passed)
  • npm run check
  • git diff --check

Linear


Note

Medium Risk
Default nested-agent depth now allows an extra generation of child sessions, which can increase spawn volume, cost, and runtime. Overrides via env, global settings, inheritance, and per-chat config are unchanged.

Overview
Changes the fallback RLM max recursion depth for new sessions from 1 to 2. Root agents can now spawn children and grandchildren by default; deeper nesting still requires an explicit higher limit.

Chat, global, env, and inherited overrides are unchanged. Docs and recursion tests now expect the new default; one mid-run prompt test pins rlmMaxDepth: 1 so it still exercises the old cap.

Reviewed by Cursor Bugbot for commit 6177e0f. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Default AgentSession.getRlmMaxDepthStatus RLM max depth to 2

Changes the fallback RLM max recursion depth for new sessions from 1 to 2, applying when no per-chat value, global setting, or RLM_MAX_DEPTH env var is present. Updates docs, comments, and tests to reflect the new default.

  • Behavioral Change: AgentSession.getRlmMaxDepthStatus in agent-session.ts now returns { maxDepth: 2, source: "default" } instead of { maxDepth: 1, source: "default" }; new sessions may create children and grandchildren by default.

Macroscope summarized 6177e0f.

@sethkarten
sethkarten requested a review from samsja August 17, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants