Skip to content

fix(files-context)-refresh-on-new-file-and-save #5564

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: main
Choose a base branch
from

Conversation

chezsmithy
Copy link
Contributor

@chezsmithy chezsmithy commented May 7, 2025

Description

Resolves: #5361

  • Traced the refreshes happening when new files are created and saved in the vscode UI. Noted that based on the parameter being sent to refresh the context certain contexts were being ignored noting they needed to wait for indexing to occur, but indexing was already performed before the call so I believe this was in error.
  • Updated the create file tool to also make a call into refreshing the indexes. (However I'm not sure I love the sideways call into a now no longer private core function).

TODO (Recommend a separate PR):

  • Could also solve for adding a file watcher to the workspace to detect changes that might be caused by the terminal tool, or made through running scripts and via that hook update the index, and the contexts.

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screenshots

[ For visual changes, include screenshots. Screen recordings are particularly helpful, and appreciated! ]

Testing instructions

New File in VsCode

  1. Create a new file in the VsCode UI, and save it.
  2. Validate the file now shows up in the @files context.

In Agent Mode

  1. Ask for a new file to be created.
  2. Validate the file now shows up the @files context.

@chezsmithy chezsmithy requested a review from a team as a code owner May 7, 2025 21:04
@chezsmithy chezsmithy requested review from Patrick-Erichsen and removed request for a team May 7, 2025 21:04
Copy link

netlify bot commented May 7, 2025

Deploy Preview for continuedev ready!

Name Link
🔨 Latest commit ad84143
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/681bcaeb84798d0008ae8ca8
😎 Deploy Preview https://deploy-preview-5564--continuedev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 8, 2025
@Patrick-Erichsen
Copy link
Collaborator

Hey @chezsmithy , chatted with @sestinj on this. I think we'd like to avoid injecting the entire core obj as a dependency to callTool.

Instead, we're thinking of creating a more scoped class for indexing related logic, eg refreshCodebaseIndexFiles, and then we can just inject that.

I'm planning to do that next week, so once that's merged, I'll push up a commit here to use that new class, and then we can get this merged 👍

@chezsmithy chezsmithy marked this pull request as draft May 9, 2025 22:11
@chezsmithy
Copy link
Contributor Author

chezsmithy commented May 13, 2025

Note to add tests related to On Save events triggering excessive indexing.

Note to review JetBrains impacts.

@Patrick-Erichsen FYI from discord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Create File tool should add to @files context
2 participants