Skip to content

feat: add quick-complete for capture messages via ✅ reaction#10

Merged
devonjones merged 5 commits intomainfrom
feat/quick-complete
Jan 15, 2026
Merged

feat: add quick-complete for capture messages via ✅ reaction#10
devonjones merged 5 commits intomainfrom
feat/quick-complete

Conversation

@devonjones
Copy link
Copy Markdown
Owner

Summary

Implements quick-complete feature (cortex-g4dq) allowing users to immediately archive captured entries by clicking the ✅ reaction on the bot's confirmation message.

Key changes:

  • Track capture confirmation message_identry_id mapping in capture_message_to_entry dictionary
  • Extend on_reaction_add() to handle both digest messages and capture confirmation messages
  • Verify user is original message author before allowing quick-complete
  • Reuse existing handle_archive_entry() for consistency

Behavior:

  1. User sends a message to be captured
  2. Bot classifies and replies with confirmation (adds ✅ to original message)
  3. User clicks ✅ on bot's confirmation message
  4. Bot verifies user is the original author
  5. Bot archives the entry and sends confirmation

Security:

  • Only the original message author can complete their own captures
  • Other users clicking ✅ are silently ignored with debug log

Test plan

  • Capture a message in #reflex
  • Click ✅ on bot's confirmation message
  • Verify entry is archived with confirmation message
  • Test with different user (should be ignored)
  • Verify digest messages still work correctly

Resolves cortex-g4dq

🤖 Generated with Claude Code

Allows users to immediately archive captured entries by clicking the ✅
reaction on the bot's confirmation message. Only the original message
author can complete their own captures.

- Track capture confirmation message_id -> entry_id mapping
- Extend on_reaction_add to handle both digest and capture messages
- Verify user is original author before allowing quick-complete
- Reuse existing handle_archive_entry for consistency

Resolves cortex-g4dq

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @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 enhances the bot's user experience by introducing a 'quick-complete' mechanism for captured entries. Users can now swiftly archive their captured information directly from the bot's confirmation message using a simple reaction, significantly streamlining the workflow for managing personal data. This change focuses on improving interaction efficiency without altering the core capture or archiving logic.

Highlights

  • Quick-Complete Feature for Captured Entries: Introduced a new feature allowing users to quickly archive captured entries by reacting with a '✅' emoji to the bot's confirmation message.
  • Tracking Capture Confirmation Messages: A new internal dictionary, capture_message_to_entry, has been added to map capture confirmation message IDs to their corresponding entry IDs, enabling reaction-based actions.
  • Extended Reaction Handling Logic: The on_reaction_add() method has been updated to process reactions on both digest messages and the new capture confirmation messages, with distinct logic paths for each.
  • User Verification for Quick-Complete: Security has been implemented to ensure that only the original author of a captured message can use the quick-complete feature to archive their own entries.
  • Reused Archiving Mechanism: The existing handle_archive_entry() function is leveraged for archiving entries via quick-complete, maintaining consistency and reducing code duplication.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@devonjones
Copy link
Copy Markdown
Owner Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a useful quick-complete feature using the ✅ reaction on capture confirmation messages. The implementation is mostly solid, tracking the confirmation message ID and verifying the user's identity before archiving.

I've found two important issues:

  1. A critical bug where reusing handle_archive_entry will cause a crash due to how it handles message tracking.
  2. A high-severity memory leak because the new capture_message_to_entry dictionary is never cleared.

My review includes a detailed explanation and a suggested fix for the critical bug. Please also address the memory leak to ensure the bot's long-term stability. Otherwise, the changes look good and the feature is a great addition to the workflow.

Comment thread src/reflex/services/bot.py Outdated
Comment thread src/reflex/services/bot.py
…acking

- Fixed KeyError: inline archiving logic for capture messages (del from capture_message_to_entry)
- Fixed memory leak: clear capture_message_to_entry in generate_digest()

Addresses review comments from gemini-code-assist:
- Critical: KeyError when reusing handle_archive_entry with capture messages
- High: Memory leak from unbounded capture_message_to_entry dictionary

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a 'quick-complete' feature, allowing users to archive a captured note by reacting with ✅ on the bot's confirmation message. The implementation correctly tracks the confirmation messages and verifies the user's identity before archiving.

My review includes two main points:

  1. A critical issue where reusing handle_archive_entry would cause a crash and a memory leak. I've suggested an inline fix to resolve this within the current changes.
  2. A suggestion to refactor the on_reaction_add method to improve its readability and maintainability, as its complexity has increased.

Comment thread src/reflex/services/bot.py Outdated
Comment thread src/reflex/services/bot.py Outdated
@devonjones
Copy link
Copy Markdown
Owner Author

/gemini review

1 similar comment
@devonjones
Copy link
Copy Markdown
Owner Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable quick-complete feature, allowing users to archive captured entries via a reaction. The implementation is well-structured, correctly tracking confirmation messages and ensuring the tracking dictionary is cleared periodically to prevent memory leaks. However, there is a significant code duplication in the reaction handler which should be refactored to improve long-term maintainability, as detailed in my comment.

Comment thread src/reflex/services/bot.py Outdated
…capture

- Added 'source' parameter to handle_archive_entry (default='digest' for backward compatibility)
- Replaced duplicated archiving code with call to shared handler
- Both digest and capture messages now use the same archiving logic

Addresses DRY concern from review comment 2695581527

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@devonjones
Copy link
Copy Markdown
Owner Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a 'quick-complete' feature, allowing users to archive captured entries by reacting to the bot's confirmation message. The implementation is mostly solid, adding a new tracking dictionary for capture messages and extending on_reaction_add to handle them. My main feedback concerns code duplication and a potential race condition in the new reaction handling logic. I've suggested a refactoring that addresses both issues by making the existing handle_archive_entry function more generic and robust. The changes also correctly handle clearing the new tracking dictionary to prevent memory leaks.

Comment thread src/reflex/services/bot.py
Replace del with pop(key, None) in all tracking dictionary removals to prevent KeyError race conditions if users react multiple times quickly.

Affected methods:
- handle_archive_entry (both digest and capture paths)
- handle_snooze_entry
- handle_snooze_reply (both digest_message_to_entry and snooze_pending)

This makes the reaction handlers more robust against concurrent reactions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a useful 'quick-complete' feature, allowing users to archive captured entries by reacting to the bot's confirmation message. The implementation correctly adds a new dictionary to track these messages and extends the on_reaction_add handler. My review includes two main points: a high-severity fix for a potential race condition that could cause a KeyError when archiving, and a medium-severity suggestion to improve code clarity by using distinct variable names in the reaction handler. Overall, a good addition to the bot's functionality.

Comment thread src/reflex/services/bot.py
Comment thread src/reflex/services/bot.py
@devonjones
Copy link
Copy Markdown
Owner Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces a new "quick-complete" feature, allowing users to archive captured entries by reacting with a checkmark emoji to the bot's confirmation message. Key changes include tracking capture message IDs, extending the on_reaction_add handler to process these reactions, and verifying the original message author for security. The implementation reuses existing archive logic and improves robustness by using dict.pop() for removing tracked messages. Overall, the changes are well-implemented and enhance user interaction.

Comment thread src/reflex/services/bot.py Outdated
Comment thread src/reflex/services/bot.py Outdated
Comment thread src/reflex/services/bot.py Outdated
- Explicitly pass source='digest' to handle_archive_entry in handler_map for clarity
- Combine two comments into one for handle_archive_entry tracking removal
- Update generate_digest comment to mention both digest and capture tracking

No functional changes, only improves code readability.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@devonjones
Copy link
Copy Markdown
Owner Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a 'quick-complete' feature, allowing users to archive captured entries by reacting with ✅ on the bot's confirmation message. This is achieved by adding a new dictionary capture_message_to_entry to track these messages, and extending the on_reaction_add handler. The changes are well-implemented, including important considerations like author verification for security, safe dictionary key removal using pop, and clearing the tracking dictionary to prevent memory leaks. My main feedback is a suggestion to refactor the on_reaction_add method for improved readability and maintainability, as it has grown in complexity.

@devonjones devonjones merged commit d651f08 into main Jan 15, 2026
2 checks passed
@devonjones devonjones deleted the feat/quick-complete branch January 15, 2026 20:39
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