Conversation
Implements automatic weekly digest generation showing summary of past 7 days of captures, grouped by category with counts. Changes: - Add get_weekly_summary() to PostgresStorage (queries past 7 days, groups by category) - Add generate_weekly_digest() method to ReflexBot - Schedule weekly digest with APScheduler (default: Sunday 4pm UTC) - Add REFLEX_DIGEST_WEEKLY_DAY and REFLEX_DIGEST_WEEKLY_HOUR env vars - Show top 5 entries per category with count totals - No pattern detection yet (deferred for future iteration) The weekly digest provides a high-level overview without individual action buttons, complementing the daily actionable digest. Resolves: cortex-vkv1 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Summary of ChangesHello @devonjones, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new feature to automatically generate and send a weekly digest of captured entries. The digest provides users with a high-level summary of their activity over the last seven days, organized by category, and is designed to be informational rather than actionable. The scheduling of this digest is configurable through environment variables. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable weekly digest feature. The implementation is well-structured, with configurable scheduling and clear logic for generating the summary. My review focuses on improving maintainability and adhering to Python best practices. I've suggested using constants for magic numbers and configuration defaults, refactoring duplicated code into helper methods, and using more idiomatic Python for data manipulation. These changes will make the code cleaner and easier to manage in the long run.
- Add class constants: DAY_MAP, DEFAULT_WEEKLY_DIGEST_HOUR, WEEKLY_DIGEST_MAX_ENTRIES_PER_CATEGORY - Extract title truncation logic into _truncate_title() helper method - Use defaultdict(list) in postgres.py for cleaner grouping logic 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a weekly digest generation feature, which is a great addition. The implementation is solid, with configurable scheduling via environment variables and a new storage method to fetch weekly data. My review includes a few suggestions to improve maintainability and consistency, such as using constants for default schedule values, avoiding code duplication by extracting helper methods, and using collections.defaultdict for more concise code. I also noticed a minor inconsistency in channel type handling between the daily and weekly digests.
Match the behavior of daily digest by allowing discord.Thread in addition to discord.TextChannel 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a weekly digest generation feature, which is a valuable addition. The implementation is solid, with configurable scheduling and clear separation of concerns between the bot service and storage layer. I've included a few suggestions to improve code maintainability and database query efficiency. Overall, great work on this feature.
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable weekly digest feature. The implementation is well-structured, adding scheduling and generation logic to ReflexBot and a corresponding data retrieval method in PostgresStorage. My review focuses on improving code quality and maintainability by addressing some code duplication, suggesting better placement for constants, and clarifying the handling of unused variables. These changes will help keep the codebase clean and easy to manage as it grows.
Replace unused variables (entry_id, tags, captured_at) with underscore for clarity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
/gemini review |
Extract day names array to DAY_NAMES class constant for better organization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a weekly digest feature, which is a great addition for summarizing weekly activity. The implementation correctly handles scheduling, configuration through environment variables, and fetching/formatting the digest content. The code is well-structured, and the new database query is efficient for its purpose. My review comments focus on improving maintainability by addressing a few instances of code duplication and suggesting ways to make constants more robust. These changes will help keep the codebase clean and easier to manage as it grows.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable feature for generating weekly digests. The implementation is well-executed, featuring configurable scheduling through environment variables and a new database query for weekly data aggregation. The code is generally well-structured, and the refactoring to extract title truncation logic is a good improvement. I have provided a few suggestions to further enhance maintainability by reducing code duplication and replacing hardcoded values with constants. Addressing these points will make the codebase more robust and easier to manage.
There was a problem hiding this comment.
Code Review
This pull request introduces a new weekly digest generation feature, which is a valuable addition. The implementation is clean, well-structured, and includes appropriate error handling for environment variable parsing. The refactoring of the title truncation logic into a dedicated helper method (_truncate_title) improves code maintainability. The scheduling of the weekly digest using CronTrigger is correctly set up, and the get_weekly_summary method in PostgresStorage efficiently retrieves and groups data. Overall, the changes are well-executed and align with good coding practices.
Summary
Implements automatic weekly digest generation at configurable time (default: Sunday 4pm UTC). Shows summary of past 7 days of captures, grouped by category with entry counts.
Changes
PostgresStorage (
src/reflex/storage/postgres.py):get_weekly_summary()method - queries entries from past 7 days, groups by categoryReflexBot (
src/reflex/services/bot.py):generate_weekly_digest()methodCronTrigger(default: Sunday 4pm)REFLEX_DIGEST_WEEKLY_DAYenv var (default: "sunday")REFLEX_DIGEST_WEEKLY_HOURenv var (default: 16)Design Decisions
Test Plan
mypy)pytest)Future Enhancements
Resolves
Closes cortex-vkv1
🤖 Generated with Claude Code