Skip to content

Allow workspace specific custom agents #15457

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

Merged
merged 1 commit into from
Apr 25, 2025
Merged

Allow workspace specific custom agents #15457

merged 1 commit into from
Apr 25, 2025

Conversation

JonasHelming
Copy link
Contributor

fixed #15456

What it does

Allows workspace specific agents.
If workspace specific prompt locations are configured, the user can choose now whether to use the global prompt directory or a workspace directory for adding a custom agent. Workspace specific custom agents win. Within workspace locations, the first one loaded wins.

How to test

Add a project specific prompt directory (settings prompt templates)
Click on "Add custom agent" in the AI configuration view
Choose where you want to add the agent, it should show two locations now
Check that workspace specific custom agents "win"
Check updates when modifying, deleting and adding files.

Follow-ups

@sgraband Do you consider custom agents in your new view already?

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

@JonasHelming JonasHelming requested a review from eneufeld April 12, 2025 22:27
@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Apr 12, 2025
@JonasHelming
Copy link
Contributor Author

@eneufeld Ping!

Copy link
Contributor

@eneufeld eneufeld left a comment

Choose a reason for hiding this comment

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

Code looks fine. The feature is nice.
But I observe this behavior:

  • I added customAgents.yml to my workspace .prompts folder and pressed Add Custom Agent button
  • I don't get the quickpick but just my global file opens
  • Only after restarting this was consumed
  • Same in reverse, I deleted the customAgents.yml from the workspace and I still get the quickpick

@JonasHelming
Copy link
Contributor Author

Code looks fine. The feature is nice. But I observe this behavior:

  • I added customAgents.yml to my workspace .prompts folder and pressed Add Custom Agent button
  • I don't get the quickpick but just my global file opens
  • Only after restarting this was consumed
  • Same in reverse, I deleted the customAgents.yml from the workspace and I still get the quickpick

I cannot reproduce this.
Please note: You do not have to create customAgents.yml manually. the quick pick menu will show all possible locations. If a customAgents.yml is existing at that location it will open it. If there is no customAgents.yml, it will create one. This explains the "Same in reverse" issue you describe, this is actually expected. The first issue I cannot reproduce. I also tested this with manually creating a customAgents.yml in a new location, it worked for me.

@eneufeld
Copy link
Contributor

In the first case I don't get a quickpick. Did you modify any of the other settings, eg WorkSpace Template Directories? Do I have to manually add the .prompts folder there?

@JonasHelming
Copy link
Contributor Author

In the first case I don't get a quickpick. Did you modify any of the other settings, eg WorkSpace Template Directories? Do I have to manually add the .prompts folder there?

It is not added by default, so yes, the very first time you have to add it.

@eneufeld
Copy link
Contributor

ok that helped.
PR works great, thanks for that.
One last question and maybe something for a followup:
What happens if the ids conflict? so if you have the same agent id in two customAgent.yml files which one is used in the prompt?

@github-project-automation github-project-automation bot moved this from Waiting on reviewers to Needs merge in PR Backlog Apr 24, 2025
@JonasHelming JonasHelming merged commit a830ffa into master Apr 25, 2025
10 of 11 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Apr 25, 2025
@github-actions github-actions bot added this to the 1.61.0 milestone Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Theia AI] Allow workspace specific custom agents
2 participants