eigent icon indicating copy to clipboard operation
eigent copied to clipboard

feat: add global worker agent templates and improve agent config ui

Open claytonlin1110 opened this issue 9 months ago • 26 comments

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

claytonlin1110 avatar Feb 23 '26 17:02 claytonlin1110

@Wendong-Fan @a7m-1st @Pakchoioioi Please review this PR when you have a chance.

claytonlin1110 avatar Mar 03 '26 02:03 claytonlin1110

@4pmtong Would you please review this?

claytonlin1110 avatar Mar 03 '26 12:03 claytonlin1110

Anyone can review this PR? Thanks.

claytonlin1110 avatar Mar 03 '26 16:03 claytonlin1110

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 !

a7m-1st avatar Mar 03 '26 23:03 a7m-1st

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

claytonlin1110 avatar Mar 04 '26 04:03 claytonlin1110

@a7m-1st Uploaded video.

claytonlin1110 avatar Mar 04 '26 04:03 claytonlin1110

Awesome thanks @claytonlin1110 , I have forwarded the PR to @Pakchoioioi and @Douglasymlai to align the features and UI/UX

a7m-1st avatar Mar 04 '26 12:03 a7m-1st

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 avatar Mar 05 '26 11:03 Douglasymlai

@Douglasymlai @Pakchoioioi Any update?

claytonlin1110 avatar Mar 10 '26 12:03 claytonlin1110

@Douglasymlai Please let me know if you have any update for this. Wanna get this PR reviewed asap. Thanks.

claytonlin1110 avatar Mar 16 '26 12:03 claytonlin1110

@a7m-1st Please let me know how you can split this into smaller features/PRs

claytonlin1110 avatar Mar 30 '26 07:03 claytonlin1110

  • 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?

image

a7m-1st avatar Apr 02 '26 05:04 a7m-1st

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 avatar Apr 02 '26 05:04 a7m-1st

@a7m-1st Would you please reopen this PR? so that i can update ?

claytonlin1110 avatar Apr 02 '26 05:04 claytonlin1110

okay, But can you tell us what?

a7m-1st avatar Apr 02 '26 05:04 a7m-1st

@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.

claytonlin1110 avatar Apr 02 '26 05:04 claytonlin1110

@a7m-1st would you please review again?

claytonlin1110 avatar Apr 03 '26 08:04 claytonlin1110

@a7m-1st This PR has been a few months.. Would you please review again?

claytonlin1110 avatar Apr 14 '26 05:04 claytonlin1110

@a7m-1st Had a chance to review again?

claytonlin1110 avatar Apr 17 '26 18:04 claytonlin1110

Hi there @claytonlin1110 apologies I saw your messages this week. Just that I was quite occupied this week. Let me make room tmrw. Thanks!

a7m-1st avatar Apr 17 '26 18:04 a7m-1st