fix(image-analysis): tolerate missing auth init dependency

This commit is contained in:
Tam Nhu Tran committed 2026-04-10 17:21:26 -04:00
1 parent 270810c06e
commit 2f02ddfb74
3 files changed
+23 -1

No files matched your search

@@ -88,6 +88,25 @@ describe('image-analysis-runtime-status', () => {
expect(status.effectiveRuntimeMode).toBe('cliproxy-image-analysis');
});
it('uses getAuthStatus when initializeAccounts is omitted from an override', async () => {
const status = await hydrateImageAnalysisRuntimeStatus(createStatus(), {
getProxyTarget: () => ({ host: '127.0.0.1', port: 8317, protocol: 'http', isRemote: false }),
initializeAccounts: undefined as unknown as () => void,
getAuthStatus: () => ({
provider: 'ghcp',
authenticated: true,
tokenDir: '/tmp/auth',
tokenFiles: ['github-copilot-test.json'],
accounts: [],
defaultAccount: undefined,
}),
isCliproxyRunning: async () => true,
});
expect(status.authReadiness).toBe('ready');
expect(status.effectiveRuntimeMode).toBe('cliproxy-image-analysis');
});
it('treats an unreachable remote proxy as unavailable', async () => {
const status = await hydrateImageAnalysisRuntimeStatus(createStatus(), {
getProxyTarget: () => ({