Repository navigation
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the 鈿欙笍 Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch has not been deployed
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.
User impact
CriticAgent(retry_attempts=0)never consults the model:get_option()skips its retry loop entirely and silently returns a random option. Users passingretry_attempts=0get an ungrounded answer with no indication that the LLM was never called.Fixes #4378.
Technical cause
ChatAgent.__init__clamps the value (chat_agent.py:649,self.retry_attempts = max(1, retry_attempts)), butCriticAgent.__init__overwrites it with the raw argument (critic_agent.py:97,self.retry_attempts = retry_attempts). Withretry_attempts=0, thewhile i < self.retry_attempts:loop atcritic_agent.py:138never executes, so control falls through to thewarnings.warn(...)+random.choice(...)fallback at lines 165-170.Fix
Mirror the parent's clamp in the subclass:
This restores the invariant
ChatAgentalready enforces;clone()also propagates the clamped value since it passesself.retry_attemptson.