Security and compliance hardening

This commit is contained in:
Lars Baunwall 2025-10-05 14:19:45 +02:00
parent f27e624ae8
commit d5928a3ec8
No known key found for this signature in database
4 changed files with 59 additions and 3 deletions

View file

@ -7,6 +7,8 @@ import { verbose } from '../../log';
interface HealthResponse {
readonly ok: boolean;
readonly api: string;
readonly notes: string;
readonly status: string;
readonly copilot: string;
readonly reason?: string;
@ -27,7 +29,7 @@ export const handleHealthCheck = async (res: ServerResponse, v: boolean): Promis
// Attempt model resolution if cache is empty and verbose logging is enabled
if (!state.modelCache && v) {
verbose(`Healthz: model=${state.modelCache ? 'present' : 'missing'} lmApi=${hasLM ? 'ok' : 'missing'}`);
verbose(`Health: model=${state.modelCache ? 'present' : 'missing'} lmApi=${hasLM ? 'ok' : 'missing'}`);
try {
await getModel();
} catch (e) {
@ -42,6 +44,8 @@ export const handleHealthCheck = async (res: ServerResponse, v: boolean): Promis
const response: HealthResponse = {
ok: true,
api: hasLM ? 'vscode.lm' : 'missing_language_model_api',
notes: "No direct Copilot endpoints; no token extraction",
status: 'operational',
copilot: state.modelCache ? 'ok' : 'unavailable',
reason: unavailableReason,