Skip to content

Conversation

@rdslw
Copy link

@rdslw rdslw commented Nov 22, 2025

On this PR I tested ampcode.com in rush (cheaper faster) mode. I verified the code and tested it afterwards, but beware. Full (beautiful!) ampcode thread link below.

Implements issue #1160: Allow filtering logs by number of unique conversations instead of just number of responses.

  • Add --nc/--conv-count option to show all responses from N unique conversations
  • Use CTE to identify last N conversations by most recent activity
  • Exclude NULL conversation_ids from counting
  • Make --nc mutually exclusive with -n and --conversation
  • Add 3 tests covering all cases and validation

Amp-Thread-ID: https://ampcode.com/threads/T-6c028a10-a5d8-4ed4-98a6-1cbe6b5b14bf
Co-authored-by: Amp [email protected]

Radosław Stachowiak added 2 commits November 22, 2025 19:00
Implements issue simonw#1160: Allow filtering logs by number of unique conversations
instead of just number of responses.

- Add --nc/--conversation-count option to show all responses from N unique conversations
- Use CTE to identify last N conversations by most recent activity
- Exclude NULL conversation_ids from counting
- Make --nc mutually exclusive with -n and --conversation
- Add comprehensive tests covering all cases and validation
- Add -L/--localtime flag to display datetimes in local timezone
- Check logs-localtime file in user config dir to enable by default
- Support for markdown, JSON, and YAML output formats
- Keep datetime_utc unchanged for backward compatibility
- JSON output adds 'datetime' field when -L flag is used
- Refactor with cleaner function names:
  * localtime_enabled_in_userdir() checks config file
  * format_datetime() converts UTC ISO strings to display format
  * Inline datetime field logic in JSON output section
- Add 7 comprehensive tests covering all scenarios
- All 81 tests pass (74 existing + 7 new)

Fixes simonw#1161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant