Skip to content

Conversation

@youming-ai
Copy link

@youming-ai youming-ai commented Jan 29, 2026

What

Adds a fallback_models config option (string | string[]) so agents/categories can select the first available model at initialization time when the preferred model is unavailable.

Why

Provider connectivity and model availability vary across environments. This reduces brittle startup behavior when a single configured model cannot be used.

Changes

  • Add fallback_models to agent overrides and category config schema.
  • Update model resolution to try fallback_models (via availableModels or connected-providers cache) before built-in fallback chain and system default.
  • Fix Prometheus config merge so resolvedModel is not overwritten by override.model.
  • Apply category defaults (temperature/top_p/maxTokens/thinking/reasoningEffort/textVerbosity) when using override.category.
  • Add/adjust tests for resolver + inheritance; avoid relying on a real connected-providers cache.
  • Update docs (config + RFC).

Notes

Verification

  • bun run typecheck
  • bun test src/shared/model-resolver.test.ts src/agents/utils.test.ts

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b57fa36811

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 570 to 572
const parsedModel = parseModelString(actualModel)
const variantToUse = userCategories?.[args.category]?.variant ?? resolvedVariant
categoryModel = parsedModel
? (variantToUse ? { ...parsedModel, variant: variantToUse } : parsedModel)
: undefined
}
const variantToUse = resolved.config.variant ?? resolvedVariant
categoryModel = parsedModel

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve fallback-chain variant over category defaults

When a category has a default variant (e.g., ultrabrainxhigh) and the fallback chain selects a different model with its own variant (e.g., Claude → max), this line now forces the default variant because resolved.config.variant is always populated from the category defaults. That overrides resolvedVariant and can send an invalid variant to the fallback provider, causing the delegated task to fail whenever the primary model is unavailable. The previous behavior only prioritized an explicit user override; consider reverting to user-only precedence or using resolvedVariant when the model came from the fallback chain.

Useful? React with 👍 / 👎.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 15 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

This was referenced Jan 29, 2026
Allow agents and categories to specify fallback models when the preferred model is unavailable, and surface the option in schema/docs/tests.
@youming-ai youming-ai force-pushed the feat/fallback_models-restored branch from 8d2aff9 to 31107ce Compare January 30, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant