Conversation
…sion loading (#318) The --until flag was silently ignored when combined with --group-by in raki cohort because the validation happened after session loading. An empty sessions directory produced exit 1 (no sessions found) instead of exit 2 (usage error), making the error invisible. - Add early mutual exclusivity check for --until + --group-by (using ParameterSource detection, consistent with --since/--group-by check) - Remove the now-redundant late check in the --group-by branch - Add regression test: test_until_and_group_by_are_mutually_exclusive (uses empty sessions dir to prove the check fires before loading) - Add towncrier changelog fragment: changes/318.fix
This was referenced May 26, 2026
5 tasks
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
--untilwas silently ignored when combined with--group-byinraki cohort. The mutual-exclusivity validation only ran after session loading, so:Fix
Moved the
--until+--group-bymutual exclusivity check to the early validation block (before session loading), consistent with the existing--since+--group-bycheck that was already there. Removed the now-redundant late check.Files Changed
src/raki/cli.pyuntil_given/group_by_givencheck; updated comment and--group-byhelp texttests/test_cohort.pytest_until_and_group_by_are_mutually_exclusiveregression testchanges/318.fixAcceptance Criteria
UsageError(exit 2) raised for--until+--group-by, even with empty sessions directory--until+--sincestill works correctly (unaffected code path)test_until_and_group_by_are_mutually_exclusivechanges/318.fixReview Results
Finding 1 — MINOR (python-specialist, rag-specialist)
File:
src/raki/cli.py:1791Issue: Comment said "--since and --group-by cannot be used together" but the block also covers
--until/--group-by. Comment was stale.Resolution: ✅ Updated comment to
# --- Mutual exclusivity: --since/--until and --group-by cannot be used together ---Finding 2 & 3 — MINOR (python-specialist, rag-specialist)
File:
src/raki/cli.py:1730Issue:
--group-byoption help text said "Mutually exclusive with --since." but didn't mention--until.Resolution: ✅ Updated help text to "Mutually exclusive with --since/--until."
Refs #318
Assisted-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
Assigned-by: decko