feat: default compaction (256k) and max_depth=1 - #150
Merged
Conversation
- summarize_at_tokens defaults to 256_000 (was None/off): long trajectories compact instead of dying at the context limit; disable with RLM_SUMMARIZE_AT_TOKENS="" or "0". - max_depth defaults to 1 (was 0): one level of `await rlm(...)` sub-agents available out of the box; RLM_MAX_DEPTH=0 restores the old behavior. - test_model_call_idempotency pins max_depth=0 explicitly (it tests retry idempotency, not recursion; sync close() inside a loop is unsupported for supervisor-owning engines).
hallerite
previously approved these changes
Aug 26, 2026
samsja
marked this pull request as ready for review
August 26, 2026 23:54
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bc59190. Configure here.
hallerite
self-requested a review
August 27, 2026 00:10
With max_depth defaulting to 1, engines own a SessionTreeSupervisor, and the sync close() correctly refuses inside a running event loop. The async ACP tests now use `await engine.aclose()` (the API-correct call); the one sync test keeps close(), which runs the async cleanup itself outside a loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Two default changes:
summarize_at_tokensNone(compaction off)RLM_SUMMARIZE_AT_TOKENS=""or"0"max_depthRLM_MAX_DEPTH=0Why
max_depth=1by default: one level ofawait rlm('sub-task')is available out of the box, matching how the harness is deployed in practice.Notes
0env values forRLM_SUMMARIZE_AT_TOKENSnow mean "disabled" (previously "" meant unset->off; unset now means the 256k default).max_depth>=1the engine owns aSessionTreeSupervisor; embedders using the syncclose()inside an event loop must switch toawait engine.aclose()(the idempotency test now pinsmax_depth=0for that reason — it tests retries, not recursion).test_acp.pyfailures are pre-existing on clean main in this environment.Note
Medium Risk
Behavior changes for all deployments that relied on implicit defaults (compaction off, no sub-agents); long runs may compact unexpectedly and recursive
rlm()is enabled unless env overrides are set.Overview
Default execution policy now turns on context compaction at 256,000 tokens and allows one level of sub-agent recursion (
max_depth=1), including matching env defaults forRLM_MAX_DEPTH.RLM_SUMMARIZE_AT_TOKENSparsing changes semantics: omitting the variable applies the 256k threshold;""or"0"explicitly disables compaction (replacing the old “unset/empty means off” behavior)._summarize_at_tokensencodes that logic and invalid positives still raise.Tests assert the new defaults, cover disable-via-empty/zero, switch async engine teardown from
close()toawait aclose()(needed when recursion/supervisor is on), and pinmax_depth=0on the compaction/idempotency test so it stays focused on retries rather than sub-agents.Reviewed by Cursor Bugbot for commit c37848a. Bugbot is set up for automated code reviews on this repo. Configure here.