8000 fix: do not duplicate task context files in memory by xai · Pull Request #15776 · eclipse-theia/theia · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: do not duplicate task context files in memory #15776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xai
Copy link
Contributor
@xai xai commented Jun 6, 2025

Fixes eclipsesource#257

What it does

Removes a redundant store() of new task summary files to the in-memory storage.

How to test

  1. Start Theia with existing task contexts and verify if they are shown correctly in the task context quick pick list
  2. Trigger creation of a task
  3. Open the task context selector via the "+" button in the AI chat
  4. Verify that the newly created task summary appears only once in the quick pick list.

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Jun 6, 2025
@ndoschek
Copy link
Contributor
ndoschek commented Jun 6, 2025

@AlexandraBuzila could you please have a look, TIA

@AlexandraBuzila
Copy link
Contributor

@xai LGTM and works as expected, thanks! 🎉
There's a conflict with the main branch, though.

@colin-grant-work
Copy link
Contributor
colin-grant-work commented Jun 9, 2025

The idea behind using the in-memory store even when the file store was active was to avoid having to reread the disk every time a summary is activated. Would it be possible to identify the mechanism that is causing the apparent duplication - presumably use of different ID's for the same summary? - and ensure that that doesn't occur, but we still get the advantages of keeping the summaries in memory? The code in lines 128-131 is intended to prevent duplication.

Or @JonasHelming, are we ok with reading the disk for every request, in which case, we likely just want to remove the in-memory store completely when the disk-based store is active? The main downside there is that we won't have on hand a list of things for which we know summaries - we'd have to check before populating the quick pick, etc.

@@ -142,7 +142,6 @@ export class TaskContextFileStorageService implements TaskContextStorageService
summary.uri = uri;
await this.fileService.writeFile(uri, BinaryBuffer.fromString(content));
}
this.inMemoryStorage.store(summary);
this.onDidChangeEmitter.fire();
Copy link
Contributor

Choose a reason for hiding this comment

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

If we do remove this store call, then we should remove the emitter firing - it will fire when the file watchers pick up this summary.

@ndoschek ndoschek mentioned this pull request Jun 11, 2025
66 tasks
@xai
Copy link
Contributor Author
xai commented Jun 12, 2025

The idea behind using the in-memory store even when the file store was active was to avoid having to reread the disk every time a summary is activated. Would it be possible to identify the mechanism that is causing the apparent duplication - presumably use of different ID's for the same summary? - and ensure that that doesn't occur, but we still get the advantages of keeping the summaries in memory? The code in lines 128-131 is intended to prevent duplication.

ACK, this requires some debugging then!

Fixes eclipsesource/theia/257

Signed-off-by: Olaf Lessenich <olessenich@eclipsesource.com>
@xai
Copy link
Contributor Author
xai commented Jun 12, 2025

@colin-grant-work Just pushed another try by extending the existing deduplication logic instead of removing the store().
Edit: doesn't work yet, please ignore the retriggered review-request :(

@xai xai marked this pull request as draft June 16, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting on reviewers
Development

Successfully merging this pull request may close these issues.

Duplicate task contexts shown in quick pick
4 participants
0