Repository navigation
feat(cli): add agentplay list --sort before --limit (#64) - #67
Conversation
Allow sorting built sessions by recent, cost, duration, calls, or errors, applying --limit after the sort so top-N queries work. Rows missing the sort field come last. Fixes Entelligence-AI#64 AI assistance: Cursor Cloud Agent helped implement and test this change.
EntelligenceAI PR SummaryAdds flowchart TD
classDef newBehavior fill:#dcfce7,stroke:#16a34a,color:#14532d;
A["List sessions"] --> B["Apply filters"]
B --> C["Sort by selected field"]
C --> D["Apply limit"]
D --> E["Print results"]
class C,D newBehavior;
Review Scorecard
Safe to merge with a low blast radius; code quality rated Excellent (5/5): the review found nothing to flag. Key Findings:
Evaluated against
|
WalkthroughAdds sorting options to the ChangesFiles
Added Files
Documented the |
|
LGTM, thanks @ShahadatTest! |
Summary
agentplay listalways sorted newest-first before applying--limit, so you could not ask for the most expensive / longest / most-error sessions of a window without--json+jq.Adds
--sort recent|cost|duration|calls|errors(defaultrecent). Sorting happens before--limit. Rows missing the chosen field sort last. Works with--json,--agents, and--since. README flag table updated.Fixes #64
Test plan
pytest python/tests/test_cli_output.py— sort keys apply before limit; missing fields lastruff checkon touched filesAI disclosure
Written with help from a Cursor Cloud Agent. I reviewed the diff and ran the tests above.