feat(ui): add and show displayName for agents#798
Merged
PetrBulanek merged 4 commits intomainfrom Jun 25, 2025
Merged
Conversation
Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com>
penge
previously requested changes
Jun 17, 2025
Contributor
penge
left a comment
There was a problem hiding this comment.
I'd suggest removing getAgentDisplayName and enriching the Agent object directly in the React Query hook — for example, by adding a label field.
| metadata: { annotations }, | ||
| } = agent; | ||
|
|
||
| return annotations?.display_name ?? name; |
Contributor
There was a problem hiding this comment.
Issues
- Hidden fallback: At first glance,
getAgentDisplayName(agent)suggests it always returnsdisplay_name. The fallback tonameisn't immediately obvious. - Excessive indirection: A simple one-liner is extracted into a utility function used across many files, adding mental overhead and development friction.
- Import bloat: Importing
getAgentDisplayNamein multiple files clutters the codebase and reduces component readability. - Risk of inconsistent usage: Developers might forget to use the function, leading to inconsistent display logic across the app.
Suggestion
The cleanest and most efficient approach is to augment the React Query hook directly.
For a field that prefers display_name but falls back to name, introduce a new field called label.
Benefits of augmenting the hook
- Centralized logic: The fallback is handled once inside the React Query hook. All consumers receive extended Agent objects automatically.
- Improved readability: Components simply use
agent.label, with no need to understand or call a helper function. - No redundant imports: No need to import a utility function in every file — the data comes ready to use.
- Scales cleanly: Additional fields can be added later without affecting consuming code.
- Type-safe and declarative: With a type like
ExtendedAgent, it's immediately clear which fields are available — and why.
Example
In the hook:
.map((agent) => ({
...agent,
label: agent.metadata?.annotations?.display_name ?? agent.name,
}))In components:
{agent.label}
Collaborator
|
This has to be reworked with the new Annotations metadata concept. |
Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com> # Conflicts: # agents/community/aider/src/aider_agent/agent.py # agents/community/gpt-researcher/gpt_researcher_agent/agent.py # agents/community/literature-review/src/literature_review/agent.py # agents/community/marketing-strategy/src/marketing_strategy/agent.py # agents/community/ollama-deep-researcher/src/ollama_deep_researcher/agent.py # agents/official/beeai-framework/agent-docs-creator/src/agent_docs_creator/agent.py # agents/official/beeai-framework/chat/src/chat/agent.py # agents/official/beeai-framework/podcast-creator/src/podcast_creator/agent.py # agents/official/sequential-workflow/src/sequential_workflow/agent.py # apps/beeai-ui/src/modules/agents/api/types.ts # apps/beeai-ui/src/modules/agents/components/AgentDetail.tsx # apps/beeai-ui/src/modules/agents/components/ImportAgentsModal.tsx # apps/beeai-ui/src/modules/providers/hooks/useMonitorProviderStatus.ts # apps/beeai-ui/src/modules/runs/chat/Message.tsx # apps/beeai-ui/src/modules/runs/components/AgentRun.tsx
Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com>
Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com> # Conflicts: # apps/beeai-ui/src/components/AgentsNav/AgentsNav.tsx
jezekra1
approved these changes
Jun 25, 2025
It's no longer valid after the changes.
JanPokorny
pushed a commit
to markstur/agentstack
that referenced
this pull request
Jun 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #675