-
Notifications
You must be signed in to change notification settings - Fork 18
I made an attempt at file monitoring #11
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
base: main
Are you sure you want to change the base?
Conversation
…uld connect to the system
…a single write to a file could cause multiple change events.
…or a working directory
- replace arbitrary waits in tests with waits for change events from FileSystemWatcher
|
This definitely handles a quirk that I hadn't really thought about addressing yet, and you've brought up a couple other points which I hadn't even considered. I think it would be ideal if the file monitoring could re-load single files instead of the whole solution, if at all possible. Some solutions take a few seconds to load each time. If you're doing a lot of collaborative editing, I imagine it would still be quite annoying. The next issue is that after you manually edit a file, the AI would also still need to be instructed to re-read the file or relevant members so that it doesn't overwrite your changes simply based on outdated knowledge. This is still probably better than having to tell it to re-load the whole solution, but I wonder if it would be possible to inject the change somehow... Regardless, this is definitely a direction I would like to go, as long as the UX and efficiency makes sense.
Just going off memory, but yes I believe so.
You mean the opposite, right? I would expect any returned paths to be in the original case, regardless of the underlying case sensitivity.
Fair point, if you leave this running as a service or something. If that's the case, it should probably unload the whole solution after a while.
This must be new in CC. That's quite useful for some tools, but I intentionally targeted a token length of ~10k for the output of LoadProject, so this makes sense. That tool is really the magic that makes this project work. |
My intuition here is that the agent should be responsible for monitoring files and keeping their state in sync with what is the file system. That's what I'd expect an IDE to do, JetBrain's Rider does an excellent job. I can't imagine it working another way but am now curious what capabilities claude or other agents have in terms of monitoring/considering external changes. |
|
Alright I haven't had time to work on this. One issue I have is I'm just not very familiar with how MCP tools work and how my ai agent is interacting with SharpTools. I'm going to start watching this interactions with https://github.com/HillviewCap/clog if I can figure out how to have it show SharpTools output (let me know if there is a better way). I am also curious if there are any tools to interact with an MCP server as a human to do adhoc exploration of its API. |
|
Indeed, I used https://github.com/f/mcptools when I was initially developing SharpTools. It looks like it supports HTTP mode now, so I would suggest using the SSE server with it. Otherwise, if you use the stdio server, you'll need to use the |
This is more an RFC than a pull request. I made an attempt at adding file change monitoring so SharpTools could detect when there were external changes and reload the solution. There's tests for the file monitoring component itself, and I did a comparison while using claude showing the old version would overwrite external changes and this one managed not to.
Open questions:
I also get a warning from Claude when using the MCP server, I don't know if its new or not. I don't always get the warning
I'm going to run with these changes awhile and see if I notice any issues. I would appreciate hearing whatever thoughts/concerns you have.