Skip to content
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

Add support for change sets via tool functions #14715

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

Conversation

JonasHelming
Copy link
Contributor

@JonasHelming JonasHelming commented Jan 12, 2025

fixed #14678

What it does

Introduce a set of tool functions, which allow agents to create file based change sets. Change sets collect changes, an agent wants to conduct, the user can review them and then decide to apply them.
ChangeSets are managed in a service that supports generic operations to apply the changes. This allows to implement various strategies, e.g. replace content or to work with diffs. To support a new strategy, you need to:

  • Provide a new ChangeOperation type
  • Provide a corresponding ContentChangeApplier (can apply ChangeOperations on content (strings)). ContentChangeApplier can be registered via a contribution point
  • Provide a set of tool functions to create the new operation type

The current PR contains a simple strategy to replace files completely.
The PR introduces also a new agent 'coder' that uses the new tool functions.
The PR renames the workspace functions and template to 'workspace-'

How to test

Ask something like this in the chat:

@Coder I want to add a property "autostart" to the mcp server preferences (packages/ai-mcp/src/browser/mcp-preferences.ts).
Then ask to apply the changes.

Follow-ups

  • Provide a UI to review and apply the changesets
  • The replace content change applier should have a strategy to correct the file ending break (or we improve the corresponding prompt)
  • When attaching a UI, we need to clarify how to pass the UUID of the current changeset.
  • Extend the replace operation approach with a second function to only replace specific parts of a file (to make it more efficient)
  • Add more strategies, e.g. diff-based
  • We should rename 'ai-workspace' to 'ai-ide' or something similar.

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

fixed #14678

Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>
@JonasHelming JonasHelming requested a review from planger January 12, 2025 23:42
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.

[Theia AI] Support for change sets
1 participant