Skip to content

AI Agent History view: sort the list by agent name and remove disabled agents#16997

Open
safisa wants to merge 4 commits intoeclipse-theia:masterfrom
safisa:safi-sortAiHistory
Open

AI Agent History view: sort the list by agent name and remove disabled agents#16997
safisa wants to merge 4 commits intoeclipse-theia:masterfrom
safisa:safi-sortAiHistory

Conversation

@safisa
Copy link
Contributor

@safisa safisa commented Feb 16, 2026

What it does

In the AI Agent History view:

  • Sorts the agent list alphabetically.
  • Show only enabled agents.
  • Update the agents list on the agents change event.

How to test

  • Validate that the list is sorted.
  • Disable an agent, and then validate that it is removed from the list.
  • Add a new custom agent, and validate that it is added to the list.
  • Delete a custom agent and validate that it is removed from the list.

Follow-ups

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

@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Feb 16, 2026
@ndoschek ndoschek self-requested a review February 16, 2026 10:57
Copy link
Member

@ndoschek ndoschek left a comment

Choose a reason for hiding this comment

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

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?

@safisa safisa changed the title AI Agent History view: sort the list by agnet name AI Agent History view: sort the list by agent name and remove disabled agents Feb 16, 2026
@safisa
Copy link
Contributor Author

safisa commented Feb 16, 2026

Hi @ndoschek

I have moved the agents' sorting to the AgentServiceImp class, directly to the method that fills in the agents: registerAgent.
In this way, the getAgents() and getAllAgents() methods will consistently return the sorted list without performing the sort operation again.

I have also added two improvements to this PR:

  • Show only enabled agents.
  • Update the agents list on the agents change event.

@safisa safisa requested a review from ndoschek February 16, 2026 13:51
Copy link
Member

@ndoschek ndoschek left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the fast update @safisa!
I have one comment about the history view, could you have another look? TIA!

Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

@safisa safisa requested a review from ndoschek February 16, 2026 15:22
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.

2 participants