Address PR feedback for OpenCode integration
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
} from "@/components/ui/popover";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { cn } from "../lib/utils";
|
||||
import { extractModelName, extractProviderIdWithFallback } from "../lib/model-utils";
|
||||
import { getUIAdapter } from "../adapters";
|
||||
import { defaultCreateValues } from "./agent-config-defaults";
|
||||
import {
|
||||
@@ -61,19 +62,6 @@ Ensure you have a folder agents/ceo and then download this AGENTS.md as well as
|
||||
|
||||
And after you've finished that, hire yourself a Founding Engineer agent`;
|
||||
|
||||
function extractProviderId(modelId: string): string | null {
|
||||
const trimmed = modelId.trim();
|
||||
if (!trimmed.includes("/")) return null;
|
||||
const provider = trimmed.slice(0, trimmed.indexOf("/")).trim();
|
||||
return provider || null;
|
||||
}
|
||||
|
||||
function extractModelName(modelId: string): string {
|
||||
const trimmed = modelId.trim();
|
||||
if (!trimmed.includes("/")) return trimmed;
|
||||
return trimmed.slice(trimmed.indexOf("/") + 1);
|
||||
}
|
||||
|
||||
export function OnboardingWizard() {
|
||||
const { onboardingOpen, onboardingOptions, closeOnboarding } = useDialog();
|
||||
const { selectedCompanyId, companies, setSelectedCompanyId } = useCompany();
|
||||
@@ -185,7 +173,7 @@ export function OnboardingWizard() {
|
||||
const query = modelSearch.trim().toLowerCase();
|
||||
return (adapterModels ?? []).filter((entry) => {
|
||||
if (!query) return true;
|
||||
const provider = extractProviderId(entry.id) ?? "";
|
||||
const provider = extractProviderIdWithFallback(entry.id, "");
|
||||
return (
|
||||
entry.id.toLowerCase().includes(query) ||
|
||||
entry.label.toLowerCase().includes(query) ||
|
||||
@@ -204,7 +192,7 @@ export function OnboardingWizard() {
|
||||
}
|
||||
const groups = new Map<string, Array<{ id: string; label: string }>>();
|
||||
for (const entry of filteredModels) {
|
||||
const provider = extractProviderId(entry.id) ?? "other";
|
||||
const provider = extractProviderIdWithFallback(entry.id);
|
||||
const bucket = groups.get(provider) ?? [];
|
||||
bucket.push(entry);
|
||||
groups.set(provider, bucket);
|
||||
|
||||
Reference in New Issue
Block a user