fix(llm): key migration cost overrides by targetModelSlug

The override dict should be keyed by the TARGET model slug (where nodes
migrated TO), not the source model slug. This ensures the custom cost
is applied when building costs for the model that nodes are actually using.
This commit is contained in:
Bentlybro
2026-02-13 15:10:09 +00:00
parent cf3390d192
commit a7835056c9

View File

@@ -94,8 +94,10 @@ async def _build_llm_costs_from_registry() -> list[BlockCost]:
"customCreditCost": {"not": None},
}
)
# Key by targetModelSlug since that's the model nodes are now using
# after migration. The custom cost applies to the target model.
migration_overrides = {
migration.sourceModelSlug: migration.customCreditCost
migration.targetModelSlug: migration.customCreditCost
for migration in active_migrations
if migration.customCreditCost is not None
}