Skip to content

fix(agent): allow CherryIN OpenAI-protocol models in Agent model picker#14811

Merged
zhibisora merged 4 commits into
CherryHQ:mainfrom
Azure12355:hotfix/agent-model-picker-cherryIN-filter
May 8, 2026
Merged

fix(agent): allow CherryIN OpenAI-protocol models in Agent model picker#14811
zhibisora merged 4 commits into
CherryHQ:mainfrom
Azure12355:hotfix/agent-model-picker-cherryIN-filter

Conversation

@Azure12355
Copy link
Copy Markdown
Contributor

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

getProviderAnthropicModelChecker previously grouped cherryin with new-api, restricting both to endpoint_type === 'anthropic'. However, CherryIN is a first-party aggregator that serves both Anthropic and OpenAI models — the same role as aihubmix, which already uses return () => true.

The fix separates cherryin into its own case with return () => true, matching aihubmix behavior. new-api retains its strict anthropic-only filter because it is a generic OpenAI-compatible gateway without the same first-party guarantees.

The following tradeoffs were made:

  • Only cherryin is relaxed; new-api is intentionally kept strict to avoid unintended side-effects on other deployments.

The following alternatives were considered:

  • Relaxing new-api as 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

Fixed: CherryIN's OpenAI-protocol models (openai/gpt-*) now appear in the Agent model picker, matching their visibility in the regular Chat picker.

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>
@DeJeune DeJeune self-assigned this May 7, 2026
@DeJeune DeJeune added this to the v1.9.5 milestone May 7, 2026
@DeJeune
Copy link
Copy Markdown
Collaborator

DeJeune commented May 7, 2026

Note

This comment was translated by Claude.

Have you tested it?


Original Content

测试过吗

@Azure12355
Copy link
Copy Markdown
Contributor Author

Azure12355 commented May 8, 2026

Have you tested it?

Note

This comment was translated by Claude.

Yes, I have tested it.


Original Content

Have you tested it?

测试过了

@DeJeune DeJeune requested a review from defi-failure May 8, 2026 04:54
@defi-failure defi-failure requested a review from zhibisora May 8, 2026 05:15
Copy link
Copy Markdown
Collaborator

@zhibisora zhibisora left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/main/apiServer/utils/index.ts Outdated
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.
Copy link
Copy Markdown
Collaborator

@zhibisora zhibisora left a comment

Choose a reason for hiding this comment

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

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.

@zhibisora zhibisora merged commit a4fd5a8 into CherryHQ:main May 8, 2026
6 checks passed
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.

[Bug]: Agent model picker hides CherryIN provider's GPT models while AiHubMix GPT models show

4 participants