fix(opencode): prefer catalog for summary model lists

This commit is contained in:
777genius 2026-05-20 17:25:00 +03:00
parent 9289afd01e
commit 3b120e74c7
3 changed files with 5 additions and 5 deletions

View file

@ -526,7 +526,7 @@ export function getVisibleTeamProviderModels(
providerStatus?: RuntimeAwareProviderStatus | null providerStatus?: RuntimeAwareProviderStatus | null
): string[] { ): string[] {
const sourceModels = const sourceModels =
providerId === 'opencode' && models.length === 0 providerId === 'opencode'
? (getRuntimeCatalogLaunchModels(providerId, providerStatus) ?? models) ? (getRuntimeCatalogLaunchModels(providerId, providerStatus) ?? models)
: models; : models;

View file

@ -245,8 +245,8 @@ describe('teamModelAvailability', () => {
).toBe('openrouter/moonshotai/kimi-k2'); ).toBe('openrouter/moonshotai/kimi-k2');
}); });
it('uses the OpenCode model catalog when runtime models are missing', () => { it('uses the OpenCode model catalog when runtime models are summary-only', () => {
const providerStatus = createOpenCodeProviderStatus([], { const providerStatus = createOpenCodeProviderStatus(['opencode/big-pickle'], {
modelCatalog: { modelCatalog: {
schemaVersion: 1, schemaVersion: 1,
providerId: 'opencode', providerId: 'opencode',

View file

@ -221,9 +221,9 @@ describe('teamModelCatalog', () => {
]); ]);
}); });
it('uses the OpenCode model catalog when the runtime model list is empty', () => { it('uses the OpenCode model catalog when the runtime model list is summary-only', () => {
expect( expect(
getVisibleTeamProviderModels('opencode', [], { getVisibleTeamProviderModels('opencode', ['opencode/big-pickle'], {
providerId: 'opencode', providerId: 'opencode',
authMethod: 'opencode_managed', authMethod: 'opencode_managed',
backend: { kind: 'opencode-cli', label: 'OpenCode CLI' }, backend: { kind: 'opencode-cli', label: 'OpenCode CLI' },