⚡ Bolt: Remove redundant episodic_memory fetch and dead context logic#44
⚡ Bolt: Remove redundant episodic_memory fetch and dead context logic#44SuvenSeo wants to merge 2 commits into
Conversation
This optimization removes a redundant database query in the `buildContext` function that was fetching conversation history on every tool loop iteration. Since the history is already managed by the caller and passed as the `messages` array, this extra fetch was unnecessary and added latency. Additionally, several unused constants and helper functions related to an older context selection logic were removed to clean up the codebase. Changes: - Removed `EPISODE_FETCH_LIMIT`, `BACKGROUND_EPISODE_LIMIT`, `SESSION_BREAK_MS`, `CONTEXT_NOISE_PATTERNS`, and `MEANINGFUL_HINTS` constants. - Removed `selectConversationLines`, `compressVerboseContent`, `scoreEpisodeForContext`, and `isContextNoiseEpisode` functions. - Removed the `episodic_memory` fetch and related logic from `buildContext`. - Updated `.jules/bolt.md` with the performance learning. Co-authored-by: SuvenSeo <263689617+SuvenSeo@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This optimization removes a redundant database query in the `buildContext` function that was fetching conversation history on every tool loop iteration. Since the history is already managed by the caller and passed as the `messages` array, this extra fetch was unnecessary and added latency. Additionally, several unused constants and helper functions related to an older context selection logic were removed to clean up the codebase. Changes: - Removed `EPISODE_FETCH_LIMIT`, `BACKGROUND_EPISODE_LIMIT`, `SESSION_BREAK_MS`, `CONTEXT_NOISE_PATTERNS`, and `MEANINGFUL_HINTS` constants. - Removed `selectConversationLines`, `compressVerboseContent`, `scoreEpisodeForContext`, and `isContextNoiseEpisode` functions. - Removed the `episodic_memory` fetch and related logic from `buildContext`. - Updated `.jules/bolt.md` with the performance learning. Co-authored-by: SuvenSeo <263689617+SuvenSeo@users.noreply.github.com>
💡 What: The optimization removes a redundant
episodic_memorydatabase fetch from thebuildContextfunction infrontend/src/lib/services/context.js. It also removes several unused constants and helper functions.🎯 Why: The conversation history is already available in the
messagesarray passed to the chat completion API. Fetching it again from the database in every iteration of the tool loop is redundant and increases latency.📊 Impact: Reduces database load by 1 query per tool loop iteration (potentially 5+ queries per user message) and simplifies the context generation logic.
🔬 Measurement: Verified that the
episodic_memoryfetch is no longer present in thebuildContextimplementation and that the application tests pass.PR created automatically by Jules for task 14608404303998954201 started by @SuvenSeo