Repository navigation
feat(rlm): default to 20 iterations with REPL_RLM_MAX_ITERATIONS override - #243
Merged
Merged
Conversation
…ride The rlm code-gen → execute loop was hard-capped at 10 iterations with no way to raise it: a model-supplied maxIterations was clamped to the same 10 that served as the default, so the loop could never run more turns. Raise the default to 20 and mirror the existing REPL_RLM_BUDGET knob with REPL_RLM_MAX_ITERATIONS, which sets both the default and the ceiling on a model-supplied maxIterations. - src/rlm.ts: export DEFAULT_RLM_MAX_ITERATIONS (20); runRlm falls back to it - src/model_boundary.ts: defaultRlmMaxIterations() reads REPL_RLM_MAX_ITERATIONS; clampRlmLimits caps maxIterations at that value instead of a hard-coded 10 - extensions/repl-extension.ts + src/mcp_server.ts: the rlm tool and /rlm command pass the overridable default explicitly - tests: update default/ceiling assertions and add env-override coverage
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.
What
The
rlmcode-gen → execute loop was hard-capped at 10 iterations with no way to raise it: a model-suppliedmaxIterationswas clamped to the same10that served as the default, so the loop could never run more turns regardless of the question.This raises the default to 20 and mirrors the existing
REPL_RLM_BUDGETknob with a newREPL_RLM_MAX_ITERATIONSenv var, which sets both the default and the ceiling on a model-suppliedmaxIterations.Changes
src/rlm.ts— exportDEFAULT_RLM_MAX_ITERATIONS(20);runRlmfalls back to it instead of?? 10src/model_boundary.ts—defaultRlmMaxIterations()readsREPL_RLM_MAX_ITERATIONS;clampRlmLimitscapsmaxIterationsat that value instead of a hard-coded 10extensions/repl-extension.ts+src/mcp_server.ts— therlmtool and/rlmcommand pass the overridable default explicitly (matching howbudgetis already handled)REPL_RLM_MAX_ITERATIONSoverride coverageUsage
Note: iterations and budget are independent limits — the result's
status:field shows which one stopped the loop (max_iterationsvsbudget_exhausted).Verification
wf gate→ all four steps pass (lint, typecheck, test, build).Also includes a one-line
chorecommit syncingpackage-lock.json'sbinentry (a byproduct ofnpm installafter the MCPbinwas added upstream).