fix(cli): show OpenCode Free in Hermes Agent picker (#3240)

Show OpenCode Free in the Hermes Agent model picker via alwaysIncludeProviders.

Integrated into release/v3.8.11. Thanks @wilsonicdev.
This commit is contained in:
Wilson
2026-06-05 13:12:52 -03:00
committed by GitHub
parent 5ec8fa222a
commit c222143071
4 changed files with 187 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ type ModelSelectModalProps = {
addedModelValues?: string[];
multiSelect?: boolean;
showCombos?: boolean;
alwaysIncludeProviders?: string[] | null;
};
export default function ModelSelectModal({
@@ -51,6 +52,7 @@ export default function ModelSelectModal({
addedModelValues = [],
multiSelect = false,
showCombos = true,
alwaysIncludeProviders = [],
}: ModelSelectModalProps) {
const t = useTranslations("common");
const resolvedTitle = title ?? t("selectModel");
@@ -111,6 +113,11 @@ export default function ModelSelectModal({
() => ({ ...OAUTH_PROVIDERS, ...NOAUTH_PROVIDERS, ...APIKEY_PROVIDERS }),
[]
);
const alwaysIncludeProvidersKey = Array.isArray(alwaysIncludeProviders)
? alwaysIncludeProviders
.filter((providerId) => typeof providerId === "string" && providerId)
.join("\0")
: "";
// Group models by provider with priority order
const groupedModels = useMemo(() => {
@@ -118,10 +125,14 @@ export default function ModelSelectModal({
// Get all active provider IDs from connections
const activeConnectionIds = activeProviders.map((p) => p.provider);
const explicitProviderIds = alwaysIncludeProvidersKey
? alwaysIncludeProvidersKey.split("\0")
: [];
// Only show connected providers (including both standard and custom)
const providerIdsToShow = new Set([
...activeConnectionIds, // Only connected providers
...activeConnectionIds, // Connected providers
...explicitProviderIds, // Zero-config providers required by specific clients
]);
// Sort by PROVIDER_ORDER
@@ -262,7 +273,14 @@ export default function ModelSelectModal({
});
return groups;
}, [activeProviders, modelAliases, allProviders, providerNodes, customModels]);
}, [
activeProviders,
alwaysIncludeProvidersKey,
modelAliases,
allProviders,
providerNodes,
customModels,
]);
// Filter combos by search query
const filteredCombos = useMemo(() => {