fix(tasks): fall back to active provider when task default has no model#89
Open
prime-axiom wants to merge 1 commit into
Open
fix(tasks): fall back to active provider when task default has no model#89prime-axiom wants to merge 1 commit into
prime-axiom wants to merge 1 commit into
Conversation
The task default-provider resolution returned an explicitly configured provider even when it had no enabled models. Since providers can now be created without selecting a model upfront, such a provider would start background tasks (heartbeat, cronjobs, manual defaults) with an empty model. Only honor a configured provider when it can run a model; otherwise fall back to the active provider/model selection. Extract the resolution into a pure, unit-tested helper.
Contributor
Author
|
Self-review (cannot self-approve via GitHub). Verified against the full checklist:
Ready for merge from my side. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
getTaskDefaultProvider()returned an explicitly configured task default provider even when that provider had no enabled models. Since providers can now be created without selecting a model upfront (#87,8824e19), such a provider starts background tasks (heartbeat, cronjobs, manual defaults) with an empty model.The configured-provider branch short-circuited with
if (resolved) return resolved, so the active-provider fallback below was never reached when the configured provider had no usable model.Change
enabledModels). Otherwise fall back to the active provider/model selection — matching the documented behavior ("Defaults to the currently active chat provider").resolveTaskDefaultProvider()so the logic is unit-testable;getTaskDefaultProvider()is now a thin wrapper.No behavior change for the common paths (explicit
provider:model, configured provider with models, active-provider default).Testing
runtime-composition.test.tscover: explicit provider+model pin, configured provider with models (unchanged), configured provider with no enabled models (falls back to active), unresolvable provider, active default, no active model, and no active provider.npm run lint,npm run baseline:unit(1127),npm run baseline:api(198),npm run build— all green.