Skip to content

Fix duplicate hooks and summarization failures#1

Open
nick-titus wants to merge 1 commit intomainfrom
fix/duplicate-hooks-and-summarization
Open

Fix duplicate hooks and summarization failures#1
nick-titus wants to merge 1 commit intomainfrom
fix/duplicate-hooks-and-summarization

Conversation

@nick-titus
Copy link
Owner

Summary

  • Fix duplicate SessionStart hook firing by removing explicit hooks declaration from plugin.json (auto-discovered by convention)
  • Add SessionEnd hook for sync on session close
  • Fix summarization failures: implement graceful fallback when session resume fails for old/expired sessions
  • Add ISSUES-AND-FIXES.md documenting both issues and their fixes

Test plan

  • Verified SessionStart hook fires once (not twice)
  • Tested episodic-memory sync - summaries now generate via fallback instead of failing
  • Build passes (npm run build)

🤖 Generated with Claude Code

- Remove explicit hooks declaration from plugin.json (auto-discovered) - Add SessionEnd hook for sync on session close - Fix summarization: graceful fallback when session resume fails - Try resume first for recent sessions (better context) - Fall back to text-based summarization for old/expired sessions - Add ISSUES-AND-FIXES.md documenting both issues and fixes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello @nick-titus, 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 significantly improves the stability and functionality of the episodic memory plugin by addressing critical issues related to hook execution and conversation summarization. It ensures hooks fire correctly, adds a new hook for better session management, and makes summarization more robust by preventing failures on old sessions.

Highlights

  • Duplicate Hook Fix: The explicit declaration of the hooks.json file in plugin.json has been removed, resolving an issue where the SessionStart hook was firing twice due to auto-discovery loading it again.
  • Session End Hook: A new SessionEnd hook has been added to hooks.json to automatically trigger episodic-memory sync when a session closes, ensuring timely synchronization.
  • Summarization Reliability: The summarizer now includes a graceful fallback mechanism. If attempting to resume an old or expired session for summarization fails, it will now proceed with text-based summarization instead of failing entirely.
  • Documentation: A new ISSUES-AND-FIXES.md file has been added, detailing the duplicate hook and summarization failure issues, their root causes, and the implemented solutions.
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.

Copy link

@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 effectively resolves two key issues: the duplicate firing of the SessionStart hook and summarization failures for older sessions. The solution for summarization, which introduces a graceful fallback to a text-based approach when a session resume fails, is well-implemented and robust. Additionally, adding a SessionEnd hook to sync conversations is a valuable enhancement. The new ISSUES-AND-FIXES.md documentation is a great addition for project maintainability. I have one suggestion to improve error logging for better debuggability in the future.

return extractSummary(result);
} catch (error) {
// Resume failed (session expired/invalid) - fall through to text-based approach
console.log(` Session resume failed, using text-based summarization`);

Choose a reason for hiding this comment

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

medium

While the fallback mechanism is great, the catch block currently swallows the error object without logging it. For better debugging, it would be beneficial to log the actual error that was caught. This can help distinguish between expected session expiration errors and other unexpected issues (e.g., network problems, API changes) in the future.

Suggested change
console.log(` Session resume failed, using text-based summarization`);
console.log(` Session resume failed, using text-based summarization. Error:`, error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant