remove manual string when displaying manual model in the footer (#15967)

This commit is contained in:
Sehoon Shon
2026-01-05 23:07:44 -05:00
committed by GitHub
parent 384fb6a465
commit cbd2eee9c4
3 changed files with 47 additions and 11 deletions

View File

@@ -1,8 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`<Footer /> > footer configuration filtering (golden snapshots) > renders complete footer in narrow terminal (baseline narrow) > complete-footer-narrow 1`] = `" ...s/to/make/it/long no sandbox Manual (gemini-pro) /model (100%)"`;
exports[`<Footer /> > footer configuration filtering (golden snapshots) > renders complete footer in narrow terminal (baseline narrow) > complete-footer-narrow 1`] = `" ...s/to/make/it/long no sandbox gemini-pro /model (100%)"`;
exports[`<Footer /> > footer configuration filtering (golden snapshots) > renders complete footer with all sections visible (baseline) > complete-footer-wide 1`] = `" ...irectories/to/make/it/long no sandbox (see /docs) Manual (gemini-pro) /model (100% context left)"`;
exports[`<Footer /> > footer configuration filtering (golden snapshots) > renders complete footer with all sections visible (baseline) > complete-footer-wide 1`] = `" ...irectories/to/make/it/long no sandbox (see /docs) gemini-pro /model (100% context left)"`;
exports[`<Footer /> > footer configuration filtering (golden snapshots) > renders footer with CWD and model info hidden to test alignment (only sandbox visible) > footer-only-sandbox 1`] = `" no sandbox (see /docs)"`;

View File

@@ -9,6 +9,7 @@ import {
resolveModel,
resolveClassifierModel,
isGemini2Model,
getDisplayString,
DEFAULT_GEMINI_MODEL,
PREVIEW_GEMINI_MODEL,
DEFAULT_GEMINI_FLASH_MODEL,
@@ -22,6 +23,43 @@ import {
DEFAULT_GEMINI_MODEL_AUTO,
} from './models.js';
describe('getDisplayString', () => {
it('should return Auto (Gemini 3) for preview auto model', () => {
expect(getDisplayString(PREVIEW_GEMINI_MODEL_AUTO)).toBe('Auto (Gemini 3)');
});
it('should return Auto (Gemini 2.5) for default auto model', () => {
expect(getDisplayString(DEFAULT_GEMINI_MODEL_AUTO)).toBe(
'Auto (Gemini 2.5)',
);
});
it('should return concrete model name for pro alias', () => {
expect(getDisplayString(GEMINI_MODEL_ALIAS_PRO, false)).toBe(
DEFAULT_GEMINI_MODEL,
);
expect(getDisplayString(GEMINI_MODEL_ALIAS_PRO, true)).toBe(
PREVIEW_GEMINI_MODEL,
);
});
it('should return concrete model name for flash alias', () => {
expect(getDisplayString(GEMINI_MODEL_ALIAS_FLASH, false)).toBe(
DEFAULT_GEMINI_FLASH_MODEL,
);
expect(getDisplayString(GEMINI_MODEL_ALIAS_FLASH, true)).toBe(
PREVIEW_GEMINI_FLASH_MODEL,
);
});
it('should return the model name as is for other models', () => {
expect(getDisplayString('custom-model')).toBe('custom-model');
expect(getDisplayString(DEFAULT_GEMINI_FLASH_LITE_MODEL)).toBe(
DEFAULT_GEMINI_FLASH_LITE_MODEL,
);
});
});
describe('supportsMultimodalFunctionResponse', () => {
it('should return true for gemini-3 model', () => {
expect(supportsMultimodalFunctionResponse('gemini-3-pro')).toBe(true);

View File

@@ -110,17 +110,15 @@ export function getDisplayString(
case DEFAULT_GEMINI_MODEL_AUTO:
return 'Auto (Gemini 2.5)';
case GEMINI_MODEL_ALIAS_PRO:
return `Manual (${
previewFeaturesEnabled ? PREVIEW_GEMINI_MODEL : DEFAULT_GEMINI_MODEL
})`;
return previewFeaturesEnabled
? PREVIEW_GEMINI_MODEL
: DEFAULT_GEMINI_MODEL;
case GEMINI_MODEL_ALIAS_FLASH:
return `Manual (${
previewFeaturesEnabled
? PREVIEW_GEMINI_FLASH_MODEL
: DEFAULT_GEMINI_FLASH_MODEL
})`;
return previewFeaturesEnabled
? PREVIEW_GEMINI_FLASH_MODEL
: DEFAULT_GEMINI_FLASH_MODEL;
default:
return `Manual (${model})`;
return model;
}
}