feat: prepare Zhinian desktop pilot
This commit is contained in:
@@ -4,6 +4,7 @@ import type { IncomingMessage, ServerResponse } from 'http';
|
||||
import { logger } from '../../utils/logger';
|
||||
import { getOpenClawConfigDir } from '../../utils/paths';
|
||||
import { buildGatewayHealthSummary } from '../../utils/gateway-health';
|
||||
import { buildYinianModelConfigDiagnostics, ensureYinianModelRuntimeConfigured } from '../../utils/model-diagnostics';
|
||||
import type { HostApiContext } from '../context';
|
||||
import { sendJson } from '../route-utils';
|
||||
import { buildChannelAccountsView, getChannelStatusDiagnostics } from './channels';
|
||||
@@ -82,5 +83,17 @@ export async function handleDiagnosticsRoutes(
|
||||
return true;
|
||||
}
|
||||
|
||||
if (url.pathname === '/api/diagnostics/model-config' && req.method === 'GET') {
|
||||
try {
|
||||
if (url.searchParams.get('repair') === '1') {
|
||||
await ensureYinianModelRuntimeConfigured();
|
||||
}
|
||||
sendJson(res, 200, await buildYinianModelConfigDiagnostics());
|
||||
} catch (error) {
|
||||
sendJson(res, 500, { success: false, error: String(error) });
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user