Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Aug 26, 2025

Summary

This PR enhances the API configuration dropdown to display the model ID alongside each profile name, providing users with better visibility into which AI model is configured for each profile.

Changes

Frontend

  • ApiConfigSelector Component: Updated to display model IDs next to profile names in dropdown list items
  • Smart Truncation: Profile names are never truncated (using flex-shrink-0), only model IDs truncate when space is limited (using Tailwind's truncate class)
  • Visual Hierarchy: Model IDs appear with 70% opacity and are separated with a "·" character for clear distinction

Backend

  • ProviderSettingsManager: Enhanced listConfig() method to include model ID in the metadata
  • Model ID Cleaning: Added cleanModelId() helper that removes prefixes before "/" or "." characters
    • Example: "anthropic/claude-3-opus" → "claude-3-opus"
    • Example: "openai.gpt-4" → "gpt-4"

Types

  • Extended ProviderSettingsEntry type to include optional modelId field

Tests

  • Updated all test cases to include model ID data
  • Fixed test selectors to match new DOM structure
  • All 20 tests passing ✅

Screenshots

[Add screenshots here showing the dropdown with model IDs displayed]

Testing

  • All existing tests pass
  • Tested with various profile configurations
  • Verified truncation behavior with long model names
  • Confirmed profile names never truncate

Implementation Notes

  • Uses pure CSS (Tailwind) for truncation - no JavaScript calculations needed
  • Maintains all existing functionality (pinning, search, selection)
  • Backwards compatible - handles profiles without model IDs gracefully

Important

Enhances API configuration dropdown to display model IDs alongside profile names, with updates to ApiConfigSelector and ProviderSettingsManager, and all tests passing.

  • Frontend:
    • ApiConfigSelector: Displays model IDs next to profile names in dropdown.
    • Profile names are not truncated; model IDs truncate with Tailwind's truncate class.
    • Model IDs have 70% opacity, separated by "·".
  • Backend:
    • ProviderSettingsManager: listConfig() now includes model ID in metadata.
    • Adds cleanModelId() to remove prefixes before "/" or ".".
  • Types:
    • ProviderSettingsEntry type now includes optional modelId field.
  • Tests:
    • Updated tests to include model ID data.
    • Fixed test selectors for new DOM structure.
    • All 20 tests passing.

This description was created by Ellipsis for 6593853. You can customize this summary. It will automatically update as commits are pushed.

Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! This is a well-implemented feature that enhances user visibility by displaying model IDs alongside profile names in the API configuration dropdown. The implementation is clean, properly tested, and follows the project's patterns. I've left some suggestions for minor improvements below.

}

return modelId
}
Copy link

Choose a reason for hiding this comment

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

Is this intentional to duplicate the model ID cleaning logic here? Consider moving the cleanModelId() helper to a shared utility location (perhaps in packages/types/src/provider-settings.ts near the existing getModelId() function) since this logic might be useful elsewhere in the codebase.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not duplicated

<>
<span className="text-vscode-descriptionForeground opacity-70 flex-shrink-0">·</span>
<span className="text-vscode-descriptionForeground opacity-70 truncate min-w-0">
{config.modelId}
Copy link

Choose a reason for hiding this comment

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

Nice implementation of the smart truncation! The visual hierarchy is clear with the opacity and separator. For future consideration: if this pattern of displaying model IDs with profile names is needed elsewhere, this could be extracted into a small reusable component like .

{ id: "config1", name: "Config 1", modelId: "claude-3-opus-20240229" },
{ id: "config2", name: "Config 2", modelId: "gpt-4" },
{ id: "config3", name: "Config 3", modelId: "claude-3-sonnet-20240229" },
],
Copy link

Choose a reason for hiding this comment

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

Great test coverage! Consider adding one more test case specifically for profiles without model IDs to ensure the component handles undefined modelId gracefully (though the code already handles this well with optional chaining).

@daniel-lxs daniel-lxs marked this pull request as ready for review August 26, 2025 20:02
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners August 26, 2025 20:02
@daniel-lxs daniel-lxs moved this from PR [Draft / In Progress] to PR [Needs Prelim Review] in Roo Code Roadmap Aug 26, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Aug 26, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Aug 26, 2025
@brunobergher
Copy link
Collaborator

LGTM!

- Display model ID next to profile name in dropdown list items
- Clean model IDs by removing prefix before '/' or '.'
- Profile names never truncate, only model IDs using Tailwind CSS
- Add visual hierarchy with reduced opacity for model IDs
- Update backend to include model ID in listApiConfigMeta
- Add comprehensive test coverage for new functionality
@daniel-lxs daniel-lxs force-pushed the feat/show-model-id-in-api-config-dropdown branch from 2843250 to 6f74696 Compare August 27, 2025 14:49
if (modelId.includes("/")) {
return modelId.split("/").pop()
}
// Check for "." and take the part after it
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do any model names include periods? Like Opus 4.1? Or are they all dashes?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I see ones like gpt-3.5-turbo in the examples below

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh it should be just the first period but the Bedrock separates the provider and model with a dot

Copy link
Member Author

Choose a reason for hiding this comment

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

image

- Updated cleanModelId() to only remove prefix before '/' (not '.')
- Implemented left-side truncation with ellipsis for model IDs in UI
- Model IDs now show as many characters as possible from the right side
- Uses RTL text direction to achieve left-side ellipsis effect
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 27, 2025
@mrubens mrubens merged commit faf5734 into main Aug 27, 2025
10 checks passed
@mrubens mrubens deleted the feat/show-model-id-in-api-config-dropdown branch August 27, 2025 17:19
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Aug 27, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants