feat: add global worker agent templates and improve agent config ui
Related Issue
Closes #1345 Context: Worker agents are already user-scoped (stored per user in the app and shared across all projects). This PR adds file-based global templates so you can keep a reusable library of agent configs that survives cleared app data and can be backed up or moved between machines, plus UI improvements for managing and reusing them.
Description
Feature 1: Global Worker Agent templates
- Store global templates in ~/.eigent/
/agent-templates.json (Electron). - New Agents → Global Agents tab: list templates, import from JSON, export, duplicate, delete.
- When adding a Worker: Create from template dropdown and Save as global template checkbox so templates are reusable across projects.
Feature 2: Agent configuration UI
- Export / Import agent config (JSON) from the Add Worker dialog.
- Duplicate for global templates (in Global Agents) and for workers (workflow node menu).
- Larger, resizable description (system prompt) field.
- Tools overview: summary of selected tools under the tool selector.
What is the purpose of this pull request?
- [ ] Bug fix
- [x] New Feature
- [ ] Documentation update
- [ ] Other
Contribution Guidelines Acknowledgement
- [x] I have read and agree to the Eigent Contribution Guideline
@Wendong-Fan @a7m-1st @Pakchoioioi Please review this PR when you have a chance.
@4pmtong Would you please review this?
Anyone can review this PR? Thanks.
Thanks for the PR @claytonlin1110 , it seems a medium size PR. Do you mind attaching some videos or screenshots of your exact changes so that we can have an easy time to assess beforehand?
Depending on that if it's a core user flow feature, we might need to update the docs too.
Thanks for that !
Global Agents tab
https://github.com/user-attachments/assets/1e6fc9f4-b8ff-44d5-a95b-e046e8459584
Create from template and save as global template
https://github.com/user-attachments/assets/5143d4cb-c729-4da7-8855-a6257a894cb5
Export / Import agent config (Add Worker)
https://github.com/user-attachments/assets/bf53acc5-f46c-459f-8a7c-efa9d09376c8
@a7m-1st Uploaded video.
Awesome thanks @claytonlin1110 , I have forwarded the PR to @Pakchoioioi and @Douglasymlai to align the features and UI/UX
Hi @claytonlin1110 thanks for this PR. I will have a meeting with @Pakchoioioi this week go through this feature, since it's a big update to the project structure. We will get back to you ASAP.
@Douglasymlai @Pakchoioioi Any update?
@Douglasymlai Please let me know if you have any update for this. Wanna get this PR reviewed asap. Thanks.
@a7m-1st Please let me know how you can split this into smaller features/PRs
- This modal is barely hanging, now you are proposing even more secondary fields. There should have been a more elegant way I believe.
- For instance export should never be visible before creating an Agent.
- Create from template & import agent config could have been outside this modal. Does that mean users need to copy & paste Agent config to every modal one by one?
- Advanced Model config is not clear at all; perhaps it should have been hidden if using cloud model?
After reviewing I don't think we can salvage anything from this @claytonlin1110 because of those main issues (In addition to the non existent problem):
- The current duplicate-worker action in src/components/WorkFlow/node.tsx. It creates identity collisions and is structurally unsafe.
- The current import/export implementation as shipped. Round-trip
correctness matters more than having the button.
I will be waiting for your justification but for now I will be closing this PR and it's related issue.
Thanks for your utmost attention.
@a7m-1st Would you please reopen this PR? so that i can update ?
okay, But can you tell us what?
@a7m-1st (1) make templates persist selected_tools_snapshot so tool picks round-trip on create-from-template / import / export; (2) duplicate worker uses unique names ((copy), (copy 2), …) so edit/delete by type doesn’t collide; (3) import validates JSON + correct toasts; (4) import button styling / no false "disabled" while loading.
@a7m-1st would you please review again?
@a7m-1st This PR has been a few months.. Would you please review again?
@a7m-1st Had a chance to review again?
Hi there @claytonlin1110 apologies I saw your messages this week. Just that I was quite occupied this week. Let me make room tmrw. Thanks!