fix(acp): honor configured max turns - #70592
Draft
lxy271713 wants to merge 1 commit into
Draft
Conversation
Contributor
|
Thanks for isolating the ACP configuration propagation fix. The source change addresses a current-main omission: Problems
Suggested changes
Automated hermes-sweeper review. |
This was referenced Aug 12, 2026
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 does this PR do?
ACP sessions now honor the existing
agent.max_turnssetting when constructingAIAgent. Previously,SessionManager._make_agent()omittedmax_iterations,so ACP always used the agent constructor default even when a profile configured
a smaller turn limit.
The setting is forwarded only when it is a positive integer. Missing or invalid
values remain omitted, preserving the existing
AIAgentdefault and avoiding asecond copy of that default in the ACP adapter.
This is intentionally separate from #64045 and the other open ACP toolset PRs;
it does not change ACP tool selection.
#67696 proposes a shared resolver with additional unlimited/string spellings but
does not currently update ACP. This patch targets
main's positive-integercontract; if #67696 lands first, the ACP read can switch to that resolver during
rebase instead of keeping the local validation.
Related Issue
No linked issue. Related but non-overlapping: #64045 configures the ACP tool
surface, and #67696 proposes broader turn-limit parsing. This PR only propagates
the existing turn limit into ACP agent construction.
Type of Change
Changes Made
agent.max_turnsinacp_adapter/session.py.AIAgentasmax_iterations.negative, or otherwise invalid values.
How to Test
TMPDIR=<non-sensitive-path> uv run --isolated --frozen --extra acp --extra dev pytest tests/acp tests/acp_adapter -q.uv run --isolated --frozen --extra acp --extra dev ruff check acp_adapter/session.py tests/acp/test_session.py.Checklist
Code
pytest tests/ -qacross the entire repository.Documentation & Housekeeping
agent.max_turnssetting.cli-config.yaml.example: N/A; no config key was added or changed.CONTRIBUTING.md/AGENTS.md: N/A; no architecture or workflow changed.Screenshots / Logs
Not applicable. The regression is covered by constructor-argument assertions and
the complete ACP/ACP-adapter test suites.