AI Agent History view: sort the list by agent name and remove disabled agents#16997
AI Agent History view: sort the list by agent name and remove disabled agents#16997safisa wants to merge 4 commits intoeclipse-theia:masterfrom
Conversation
ndoschek
left a comment
There was a problem hiding this comment.
Thanks @safisa for this improvement! LGTM 👍
One minor thing: on line 86, this.selectAgent(this.agentService.getAllAgents()[0]) still picks the first agent from the unsorted list, so the initially selected agent won't match the first entry in the now-sorted dropdown.
Also worth noting: agent-configuration-widget.tsx:134 already does the same sort call. It might make sense to sort directly in getAllAgents() so all consumers benefit and the duplication is avoided.
But we can also do that in a follow up, wdyt?
…nd update handling
|
Hi @ndoschek I have moved the agents' sorting to the AgentServiceImp class, directly to the method that fills in the agents: registerAgent. I have also added two improvements to this PR:
|
There was a problem hiding this comment.
I would prefer to keep showing all agents in the AI history view:
If you disable an agent in the current application session, you lose the history for this agent (if there were requests before disabling), and you cannot access it anymore.
Second, if you send requests, view them in the history view, then disable the agent and it is removed from the dropdown list, the history details are not updated and still show the details from the previous selection. However, this is technically a separate issue, since the same thing also happens if you remove an agent entirely (for example a custom agent definition). So it can also be handled in a follow-up IMO.
There was a problem hiding this comment.
Hi @ndoschek,
First, thank you for the thorough review. :)
I believe most users, including ourselves, prefer to view only active or enabled agents in the history, as our setup typically disables some agents by default.
However, I agree with you that disabling an agent in use and having some history data will result in the loss of that history.
To address both issues you mentioned, I’ve made some changes to the PR. It now includes a new method that retrieves all agents that are either enabled or have some history in the session. This modification should resolve both issues you raised.
Thanks.
What it does
In the AI Agent History view:
How to test
Follow-ups
Breaking changes
Attribution
Review checklist
nlsservice (for details, please see the Internationalization/Localization section in the Coding Guidelines)Reminder for reviewers