fix: Remove duplicate OpenAI models from listmodels output

Fixed issue where OpenAI models appeared twice in listmodels output by:
- Removing self-referencing aliases from OpenAI model definitions (e.g., "gpt-5" no longer includes "gpt-5" in its aliases)
- Adding filter in listmodels.py to skip aliases that match the model name
- Cleaned up inconsistent alias naming (o3-pro -> o3pro)

This ensures each model appears only once in the listing while preserving all useful aliases.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Devon Hillard
2025-09-09 19:00:43 -06:00
parent 12090646ee
commit c29e7623ac
2 changed files with 8 additions and 6 deletions

View File

@@ -138,7 +138,9 @@ class ListModelsTool(BaseTool):
for model_name, capabilities in provider.get_model_configurations().items():
if capabilities.aliases:
for alias in capabilities.aliases:
aliases.append(f"- `{alias}` → `{model_name}`")
# Skip aliases that are the same as the model name to avoid duplicates
if alias != model_name:
aliases.append(f"- `{alias}` → `{model_name}`")
if aliases:
output_lines.append("\n**Aliases**:")