mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-06 19:58:43 +02:00
fix: use live copilot model availability
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,12 @@ import {
|
||||
type LucideIcon,
|
||||
} from 'lucide-react';
|
||||
|
||||
import {
|
||||
findModel,
|
||||
getSupportedReasoningEfforts,
|
||||
resolveReasoningEffort,
|
||||
type ModelDefinition,
|
||||
} from '@shared/domain/models';
|
||||
import {
|
||||
validatePatternDefinition,
|
||||
type OrchestrationMode,
|
||||
@@ -25,6 +31,7 @@ import {
|
||||
import { ModelSelect, ReasoningEffortSelect } from './AgentConfigFields';
|
||||
|
||||
interface PatternEditorProps {
|
||||
availableModels: ReadonlyArray<ModelDefinition>;
|
||||
pattern: PatternDefinition;
|
||||
isBuiltin: boolean;
|
||||
onChange: (pattern: PatternDefinition) => void;
|
||||
@@ -189,7 +196,15 @@ function InputField({
|
||||
);
|
||||
}
|
||||
|
||||
export function PatternEditor({ pattern, isBuiltin, onChange, onDelete, onSave, onBack }: PatternEditorProps) {
|
||||
export function PatternEditor({
|
||||
availableModels,
|
||||
pattern,
|
||||
isBuiltin,
|
||||
onChange,
|
||||
onDelete,
|
||||
onSave,
|
||||
onBack,
|
||||
}: PatternEditorProps) {
|
||||
const issues = validatePatternDefinition(pattern);
|
||||
|
||||
function updateAgent(agentId: string, patch: Partial<PatternAgentDefinition>) {
|
||||
@@ -199,6 +214,14 @@ export function PatternEditor({ pattern, isBuiltin, onChange, onDelete, onSave,
|
||||
});
|
||||
}
|
||||
|
||||
function updateAgentModel(agent: PatternAgentDefinition, modelId: string) {
|
||||
const model = findModel(modelId, availableModels);
|
||||
updateAgent(agent.id, {
|
||||
model: modelId,
|
||||
reasoningEffort: resolveReasoningEffort(model, agent.reasoningEffort),
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-full flex-col">
|
||||
{/* Header — top padding clears the title bar overlay zone */}
|
||||
@@ -408,13 +431,15 @@ export function PatternEditor({ pattern, isBuiltin, onChange, onDelete, onSave,
|
||||
value={agent.name}
|
||||
/>
|
||||
<ModelSelect
|
||||
onChange={(v) => updateAgent(agent.id, { model: v })}
|
||||
models={availableModels}
|
||||
onChange={(value) => updateAgentModel(agent, value)}
|
||||
value={agent.model}
|
||||
/>
|
||||
<ReasoningEffortSelect
|
||||
label="Reasoning"
|
||||
onChange={(value) => updateAgent(agent.id, { reasoningEffort: value })}
|
||||
value={agent.reasoningEffort ?? 'high'}
|
||||
supportedEfforts={getSupportedReasoningEfforts(findModel(agent.model, availableModels))}
|
||||
value={resolveReasoningEffort(findModel(agent.model, availableModels), agent.reasoningEffort)}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-3">
|
||||
|
||||
Reference in New Issue
Block a user