Skip to content

⚡ Bolt: Remove redundant episodic memory fetch and dead code#57

Open
SuvenSeo wants to merge 1 commit into
masterfrom
bolt/optimize-context-fetch-6993991696615823107
Open

⚡ Bolt: Remove redundant episodic memory fetch and dead code#57
SuvenSeo wants to merge 1 commit into
masterfrom
bolt/optimize-context-fetch-6993991696615823107

Conversation

@SuvenSeo

@SuvenSeo SuvenSeo commented Jun 5, 2026

Copy link
Copy Markdown
Owner

💡 What: Removed the redundant episodic_memory fetch from buildContext in frontend/src/lib/services/context.js. Deleted unused helper functions (selectConversationLines, compressVerboseContent, scoreEpisodeForContext, isContextNoiseEpisode) and related constants.

🎯 Why: The episodic_memory fetch was being executed on every AI turn (including each iteration of the tool loop) despite the conversation history already being managed and passed via the messages array 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

- 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>
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings June 5, 2026 19:41
@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
seo-os-agent Ready Ready Preview, Comment Jun 5, 2026 7:42pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_memory fetch from buildContext() 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.

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.

2 participants