mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-14 00:35:02 -05:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user