feat: make the per-dialog-turn round limit configurable (0 = unlimited) - #2198
Open
ArrogHie wants to merge 1 commit into
Open
feat: make the per-dialog-turn round limit configurable (0 = unlimited)#2198ArrogHie wants to merge 1 commit into
ArrogHie wants to merge 1 commit into
Conversation
The CodeAgent execution loop was hard-coded to ExecutionEngineConfig::default() (DEFAULT_MAX_ROUNDS=200) at agentic system assembly; AIConfig.max_rounds existed but was never wired, so config changes had no effect. - core: resolve the AI config when assembling the engine and build the engine config from ai.max_rounds (min 1); accept 'max_turns' as a serde alias so both names configure the same limit. Add init_agentic_system_with_options(session_config, max_rounds_override) where Some(0) means unlimited (usize::MAX) and Some(n) pins the limit. - cli: add a global --max-rounds flag threaded through initialize_core_services into exec / interactive / session-resume startup; 0 = unlimited. - tests: resolve_max_rounds unit tests + clap parsing tests (before/after subcommand, zero, absent).
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 CodeAgent execution loop currently enforces a hard-coded round limit: at agentic system assembly the execution engine is always built from
ExecutionEngineConfig::default()(DEFAULT_MAX_ROUNDS = 200).AIConfig.max_roundsalready existed in the config schema but was never wired, so changing config had no effect.This PR makes the per-dialog-turn round limit configurable, and adds an explicit "unlimited" mode:
ai.max_rounds(new aliasai.max_turns) is now honored when the engine is assembled (clamped to min 1).--max-rounds Noverrides the configured limit forexec, interactive, and session-resume startup.--max-rounds 0means unlimited.init_agentic_system_with_options(session_config, max_rounds_override); existing entry points keep their signatures.Usage
Tests
resolve_max_roundsunit tests (override pins value, 0 => unlimited, configured fallback).cargo test -p bitfun-cliandcargo test -p bitfun-core --lib agentic::systempass.