25 lines
2.2 KiB
JavaScript
25 lines
2.2 KiB
JavaScript
import fs from 'node:fs';
|
|
import assert from 'node:assert/strict';
|
|
import { execFileSync } from 'node:child_process';
|
|
import { publicSnapshot } from '../retained-host-state.mjs';
|
|
import { root, origin, save, client, publicMetadata } from './common.mjs';
|
|
import { inspectorClosed } from './inspector.mjs';
|
|
|
|
assert.equal(fs.existsSync(root), false, 'AD freezes once, never replay.');
|
|
assert.equal(execFileSync('git', ['status', '--porcelain'], { encoding: 'utf8', windowsHide: true }).trim(), '');
|
|
const { api, boot, close } = await client();
|
|
try {
|
|
await inspectorClosed(); const host = await api('/host/status'), center = await api('/model-center');
|
|
assert.equal(boot.version, '1.25.8'); assert.equal(host.activity.active, false); assert.equal(host.desktopWindows.count, 0);
|
|
for (const [key, expected] of Object.entries({ executionMode: 'unrestricted', capacityMode: 'passthrough', approvalMode: 'full', maxSteps: 0, maxRunTokens: 0, maxTaskTokens: 0 })) assert.equal(boot.config[key], expected, key);
|
|
const connections = center.connections.filter(value => value.enabled && value.hasKey);
|
|
assert.equal(connections.length, 5, 'Refreeze a new plan if the current connection set changes.');
|
|
const baseline = await publicSnapshot(origin, host.identity.dataRoot);
|
|
save('current.json', { observedAt: new Date().toISOString(), host, config: boot.config, center, connections, baseline, originalProjects: boot.projects,
|
|
originalPublicMetadata: publicMetadata(host.identity.dataRoot),
|
|
engineeringPriority: ['1a7a55a9-29f2-4b9f-8ea2-5a55afd7eacd', '09b0293b-faad-45c3-832d-7c8b615813aa', '93d0cf6d-4f32-4918-9da8-6f125aa8a6e5', '9ae348a5-d0a6-42ed-8664-0da5f9effe34', '5b4daed9-b2f7-4de0-b949-573eba70c7b3'],
|
|
driverCommit: execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8', windowsHide: true }).trim(), modelRequests: 0 });
|
|
console.log(JSON.stringify({ frozen: true, version: boot.version, pid: host.identity.pid, projects: baseline.projects, sessions: baseline.database.sessionIds.length,
|
|
selected: center.selected, connections: connections.map(value => ({ id: value.id, name: value.name, protocol: value.protocol, model: value.model, revision: value.revision })), modelRequests: 0 }));
|
|
} finally { await close(); }
|