Fix #84: enforce 4/6-message conversation depth by fidelity#91
Merged
DeveshParagiri merged 1 commit intomainfrom Feb 17, 2026
Merged
Fix #84: enforce 4/6-message conversation depth by fidelity#91DeveshParagiri merged 1 commit intomainfrom
DeveshParagiri merged 1 commit intomainfrom
Conversation
Collaborator
DeveshParagiri
left a comment
There was a problem hiding this comment.
Code Review
Verdict: ✅ Ready to merge
Summary
This PR correctly fixes the conversation depth bug by iterating over the correct number of messages (4 for medium, 6 for high fidelity) instead of the mislabeled turn count (2/3).
Verification Checklist
| Requirement | Status |
|---|---|
| Medium fidelity = 4 messages | ✅ |
| High fidelity = 6 messages | ✅ |
| Low fidelity = 2 messages | ✅ (defensive fallback) |
Only final message marked is_final=True |
✅ |
| Proper speaker alternation | ✅ |
| Tests validate behavior | ✅ |
Key Fixes
- Changed loop from
range(turns)whereturns=2/3torange(total_messages)wheretotal_messages=4/6/2 - Simplified
is_finallogic to only mark the true final message - Clean helper function
_message_count_for_fidelity()
Tests
Both new tests pass and validate message count, speaker alternation, and final flag behavior.
No changes required.
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
Validation
Closes #84