mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-23 12:03:07 +00:00
Fix orphaned features when deleting worktrees (#820)
* Changes from fix/orphaned-features * fix: Handle feature migration failures and improve UI accessibility * feat: Add event emission for worktree deletion and feature migration * fix: Handle OpenCode model errors and prevent duplicate model IDs * feat: Add summary dialog and async verify with loading state * fix: Add type attributes to buttons and improve OpenCode model selection * fix: Add null checks for onVerify callback and opencode model selection
This commit is contained in:
@@ -1189,8 +1189,26 @@ export class OpencodeProvider extends CliProvider {
|
||||
* Format a display name for a model
|
||||
*/
|
||||
private formatModelDisplayName(model: OpenCodeModelInfo): string {
|
||||
// Extract the last path segment for nested model IDs
|
||||
// e.g., "arcee-ai/trinity-large-preview:free" → "trinity-large-preview:free"
|
||||
let rawName = model.name;
|
||||
if (rawName.includes('/')) {
|
||||
rawName = rawName.split('/').pop()!;
|
||||
}
|
||||
|
||||
// Strip tier/pricing suffixes like ":free", ":extended"
|
||||
const colonIdx = rawName.indexOf(':');
|
||||
let suffix = '';
|
||||
if (colonIdx !== -1) {
|
||||
const tierPart = rawName.slice(colonIdx + 1);
|
||||
if (/^(free|extended|beta|preview)$/i.test(tierPart)) {
|
||||
suffix = ` (${tierPart.charAt(0).toUpperCase() + tierPart.slice(1)})`;
|
||||
}
|
||||
rawName = rawName.slice(0, colonIdx);
|
||||
}
|
||||
|
||||
// Capitalize and format the model name
|
||||
const formattedName = model.name
|
||||
const formattedName = rawName
|
||||
.split('-')
|
||||
.map((part) => {
|
||||
// Handle version numbers like "4-5" -> "4.5"
|
||||
@@ -1218,7 +1236,7 @@ export class OpencodeProvider extends CliProvider {
|
||||
};
|
||||
|
||||
const providerDisplay = providerNames[model.provider] || model.provider;
|
||||
return `${formattedName} (${providerDisplay})`;
|
||||
return `${formattedName}${suffix} (${providerDisplay})`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user