fix(provider): preserve local agent model compatibility

This commit is contained in:
fdc310
2026-08-01 20:36:16 +08:00
parent d40348add3
commit f83a163b15
3 changed files with 12 additions and 12 deletions
@@ -279,12 +279,9 @@ class LocalAgentRunner(runner.RequestRunner):
else 'provider_default'
)
reasoning_config = modelmgr_reasoning.normalize_reasoning_config({'level': level})
return modelmgr_requester.RuntimeLLMModel(
execution_context=model.execution_context,
model_entity=model.model_entity,
provider=model.provider,
reasoning_config_override=reasoning_config,
)
configured_model = copy.copy(model)
configured_model.reasoning_config_override = reasoning_config
return configured_model
async def _invoke_with_fallback(
self,
@@ -377,6 +377,10 @@ async def test_local_agent_applies_reasoning_per_fallback_model():
{'level': 'low'},
{'level': 'high'},
]
assert candidates[0] is not primary
assert candidates[1] is not fallback
assert primary.reasoning_config_override is None
assert fallback.reasoning_config_override is None
def test_local_agent_rejects_invalid_pipeline_reasoning_level():
@@ -915,9 +915,7 @@ export default function DynamicFormItemComponent({
).filter(
(entry): entry is [string, ReasoningLevel] =>
typeof entry[1] === 'string' &&
REASONING_LEVELS.includes(
entry[1] as ReasoningLevel,
),
REASONING_LEVELS.includes(entry[1] as ReasoningLevel),
),
) as Record<string, ReasoningLevel>)
: {},
@@ -1108,15 +1106,16 @@ export default function DynamicFormItemComponent({
const renderReasoningPicker = (modelUuid: string) => {
if (!modelUuid) return null;
const model = llmModels.find((candidate) => candidate.uuid === modelUuid);
const model = llmModels.find(
(candidate) => candidate.uuid === modelUuid,
);
const currentLevel =
modelValue.reasoning[modelUuid] || 'provider_default';
const availableLevels = model?.reasoning_capabilities?.levels || [
'provider_default',
];
const levels = REASONING_LEVELS.filter(
(level) =>
availableLevels.includes(level) || level === currentLevel,
(level) => availableLevels.includes(level) || level === currentLevel,
);
return (