fix(agent): allow CherryIN OpenAI-protocol models in Agent model picker#14811
Conversation
CherryIN is a first-party aggregator that serves both Anthropic and OpenAI models. The previous getProviderAnthropicModelChecker grouped 'cherryin' with 'new-api', restricting it to endpoint_type === 'anthropic'. This caused all openai/gpt-* models from CherryIN to be silently excluded from the Agent model picker while working fine in the regular Chat picker. CherryIN is equivalent to aihubmix in this regard (first-party aggregator with both protocol types), so it now returns () => true, matching aihubmix behavior. 'new-api' retains its strict anthropic-only filter. Fixes CherryHQ#14717 Signed-off-by: lytton <azure12355@gmail.com>
|
Note This comment was translated by Claude. Have you tested it? Original Content测试过吗 |
Note This comment was translated by Claude. Yes, I have tested it. Original Content
测试过了 |
There was a problem hiding this comment.
Review summary
Thanks for the focused fix. I think this needs one change before merge: the current CherryIN branch is too broad for an Anthropic-only Agent model picker.
Requested changes
Please replace the unconditional CherryIN allow-list with a shared Anthropic endpoint capability check for both cherryin and new-api, using supported_endpoint_types?.includes('anthropic') plus endpoint_type === 'anthropic' as a compatibility fallback for manually added or older models.
Address review feedback from zhibisora: - Replace unconditional CherryIN allow-list with shared Anthropic endpoint capability check. - Both cherryin and new-api now use supportsAnthropicEndpoint, which prefers supported_endpoint_types and falls back to endpoint_type for manually added or older models. - This prevents non-Anthropic models from being exposed in the Agent picker (providerType: 'anthropic'), avoiding ANTHROPIC_BASE_URL startup failures, while still surfacing CherryIN's Anthropic models.
zhibisora
left a comment
There was a problem hiding this comment.
LGTM. Verified the follow-up commit addresses the Anthropic endpoint filtering concern by using supported_endpoint_types with the legacy endpoint_type fallback. CI checks are passing.
What this PR does
Before this PR:
In the Agent model picker, CherryIN's
openai/gpt-*models were silently excluded from search results even though they are enabled in Provider settings and work correctly in the regular Chat picker.After this PR:
CherryIN's OpenAI-protocol models (e.g.
openai/gpt-5.x) now appear in the Agent model picker alongside Anthropic-protocol models, matching Chat picker behavior.Fixes #14717
Why we need it and why it was done in this way
getProviderAnthropicModelCheckerpreviously groupedcherryinwithnew-api, restricting both toendpoint_type === 'anthropic'. However, CherryIN is a first-party aggregator that serves both Anthropic and OpenAI models — the same role asaihubmix, which already usesreturn () => true.The fix separates
cherryininto its own case withreturn () => true, matchingaihubmixbehavior.new-apiretains its strict anthropic-only filter because it is a generic OpenAI-compatible gateway without the same first-party guarantees.The following tradeoffs were made:
cherryinis relaxed;new-apiis intentionally kept strict to avoid unintended side-effects on other deployments.The following alternatives were considered:
new-apias well — rejected, too broad and potentially breaking for other new-api deployments.Breaking changes
None.
Special notes for your reviewer
The change is a single case split in
getProviderAnthropicModelChecker(src/main/apiServer/utils/index.ts). No schema, UI, or IPC changes.Checklist
Release note