Skip to content

feat: add alias display for Agent nodes in web UI (#135) - #144

Open
a-yeyang wants to merge 1 commit into
jd-opensource:mainfrom
a-yeyang:feature/agent-alias-display
Open

feat: add alias display for Agent nodes in web UI (#135)#144
a-yeyang wants to merge 1 commit into
jd-opensource:mainfrom
a-yeyang:feature/agent-alias-display

Conversation

@a-yeyang

@a-yeyang a-yeyang commented Jul 7, 2026

Copy link
Copy Markdown

Summary

Closes #135

The MAS visualization currently displays each node's name (e.g. master_agent,
file_agent), which is a code-level identifier and not very user-friendly,
especially for non-English business users.

This PR introduces an optional alias field — a display-only human-friendly
name rendered in the web UI organization tree, while name remains the sole
functional identifier throughout the system.

Usage

oxy.ReActAgent(
    name="calc_agent",      # functional identifier (unchanged)
    alias="计算专家",        # display name shown in the web UI
    ...
)

Changes

File | Change -- | -- oxygent/oxy/base_oxy.py | Add optional alias field on the Oxy base class, inherited by all agents/tools/LLMs oxygent/mas.py | Include alias in the organization tree nodes (init_agent_organization), falling back to name when unset oxygent/web/index.html | Org-tree template renders alias \|\| name; the real name is kept as a hover tooltip for debugging

7 insertions, 2 deletions — no new dependencies.

Design notes

alias is deliberately presentation-layer only. The following keep using
name, so behavior is fully backward compatible:

  • LLM-facing tool descriptions and tool-call routing (oxy_request.call)
  • Permission lists (sub_agents / permitted_tool_name_list)
  • ES trace records (caller / callee) and session names
  • The chat "@agent" mention list (functional: clicking invokes by name)

Nodes without an alias fall back to name, so existing projects render
exactly as before.

Testing

  • Verified /get_organization returns alias for configured nodes and
    falls back to name for others.
  • Smoke-tested end-to-end with a 3-agent / 4-tool MAS: org tree shows
    aliases (see screenshot), hover shows the real name, and a multi-step
    query (master → text_agent, master → calc_agent) completes correctly —
    call chains and traces are unaffected.

Possible follow-ups (out of scope)

  • Show alias (name) in the node inspector / playground panels (debug views,
    arguably better with real names — open to discussion)
  • Alias mapping for MCP-discovered tools (names come from the MCP server)

- Add optional 'alias' field to Oxy base class as display-only name
- Include alias in agent organization tree (fallback to name)
- Web UI org tree renders alias with real name as hover tooltip
- LLM routing, permission lists and ES traces still use 'name'

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add alias display for Agent

1 participant