-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[Theia AI] Coder and ChangeSet Epic #14768
Comments
This is true of diff editors opened by e.g. the Git extension for changes to the working tree, as well. We likely need to implement the relevant commands for all diff editors, and we'll get them on AI diff editors for free. |
The basic problem here is that the resources we create for changes don't have a mechanism to inform holders of the resource of changes, so the editor never learns that anything has changed. We can:
But there is a subsidiary problem: since we treat the editor as dirty, firing a change on the resource doesn't actually cause the changes to be reflected in the editor, because Monaco believes that its state is fresher than the state 'on disk.' That means that we can:
|
Fundamentally, what's the UX we want to get to re: the pending changes. The flow chart I see looks like something like:
In any case, it seems clear that autosaving in this context shouldn't count as 'normal' saving: we shouldn't count that as the user having actually accepted the changes, however acceptance is handled in our case. This is one argument against our current dirty default. |
|
@colin-grant-work Thanks for looking into this!
Please note that I haven't explored the implementation details of these approaches in depth, so please consider my comments as unconfirmed thoughts. :-) I second your statement that the cleanest approach would be to pipe the change set's change events through the corresponding resource. I think we can return a It is true that we currently replace the change set elements instead of updating them. However, I think we should use the stability of the URIs (chat-session-id/uri). To Theia and the user, this is what counts, not particularly the objects representing them. So if the agent or tool function replaces the change set elements with new elements that have the same URI, internally we actually may want to rather represent that as an update instead of a replace, to ensure a consistent life cycle of a change suggestion for a file, identified by chat-session-id/uri. This leaves us with three states of a resource:
The suggestion-diff-editor shows a diff between 1 and 3. The AI only may see 1 and 2. So the tricky situation is how to handle a scenario where AI suggests a new version of 2, not being aware of 3. (Alternatively, we may think about considering 3 the actual new state of 1, when the AI requests the current (in-memory) state of 1 -- because this is also somewhat how we represent it to the user. But let's leave this aspect what the AI sees out of the picture for now.) With the
I think in the first step 1 might be good enough, as long as we do it in the command stack, so users can undo. What do you think?
Related to what I wrote above, my feeling is that this should reset the state of the editor to the AI suggestion within the command stack. Users can still undo if they like, but if they go to the chat and then click the button there, I'd expect it to reset the state to its suggestion as is (to be symmetric to the discard action). But this is tricky indeed :-) |
Sorry for the late reply, I had thought you had invoked @planger, not me. Anyway a couple of thoughts:
|
Prioritized List:
The text was updated successfully, but these errors were encountered: