⚡ Bolt: Remove redundant episodic memory fetch and dead code#57
⚡ Bolt: Remove redundant episodic memory fetch and dead code#57SuvenSeo wants to merge 1 commit into
Conversation
- Remove redundant 'episodic_memory' fetch from 'buildContext' in 'frontend/src/lib/services/context.js'. - Delete unused functions: 'selectConversationLines', 'compressVerboseContent', 'scoreEpisodeForContext', and 'isContextNoiseEpisode'. - Delete unused constants: 'EPISODE_FETCH_LIMIT', 'BACKGROUND_EPISODE_LIMIT', 'SESSION_BREAK_MS', 'CONTEXT_NOISE_PATTERNS', and 'MEANINGFUL_HINTS'. - Conversation history is now exclusively handled by the 'messages' array passed to the AI runtime to avoid redundancy. 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.
|
There was a problem hiding this comment.
Pull request overview
This PR removes a redundant episodic_memory query and deletes dead/unused context-selection helpers from the frontend context builder, relying on the existing conversation messages array (passed to chat completions) for history instead of duplicating it in the system prompt context. This reduces per-turn DB load and simplifies buildContext.
Changes:
- Removed the
episodic_memoryfetch frombuildContext()and adjusted the parallel query destructuring accordingly. - Deleted unused constants and helper functions related to episodic-history selection/compression/scoring.
- Added a Bolt/Jules learning note documenting the removal and rationale.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/src/lib/services/context.js | Removes unused episodic-memory fetch and deletes dead helper code; keeps context focused on tasks/memory/patterns/ideas + knowledge rerank. |
| .jules/bolt.md | Documents the rationale and action taken for redundant fetch/dead code removal. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
💡 What: Removed the redundant
episodic_memoryfetch frombuildContextinfrontend/src/lib/services/context.js. Deleted unused helper functions (selectConversationLines,compressVerboseContent,scoreEpisodeForContext,isContextNoiseEpisode) and related constants.🎯 Why: The
episodic_memoryfetch was being executed on every AI turn (including each iteration of the tool loop) despite the conversation history already being managed and passed via themessagesarray in the chat completion call. This resulted in unnecessary database load and latency.📊 Impact: Reduces database queries by 1 per AI turn/iteration. For a typical 5-iteration tool loop, this saves 5 database queries.
🔬 Measurement: Verified by running
npm test(34/34 passing) and manual code inspection confirming no usage of the removed code.PR created automatically by Jules for task 6993991696615823107 started by @SuvenSeo