feat: integrate approved MCP tools and recovery for 1.12

This commit is contained in:
Agent Workbench Dev
2026-10-30 20:34:54 +08:00
parent 601f13c4f8
commit 3f6797b8ee
80 changed files with 5141 additions and 70 deletions
+19 -9
View File
@@ -20,14 +20,26 @@ const inputs = snapshot(), tests = fs.readdirSync('tests').filter(name => name.e
assert.ok(tests.length); fs.writeFileSync(path.join(directory, 'inputs.json'), JSON.stringify(inputs, null, 2) + '\n');
const allowed = /^(path|pathext|systemroot|systemdrive|windir|comspec|temp|tmp|userprofile|homedrive|homepath|home|appdata|localappdata|programfiles(?:\(x86\))?|commonprogramfiles(?:\(x86\))?|lang|lc_all|AGENT_WORKBENCH_TEST_PYTHON)$/i;
const env = Object.fromEntries(Object.entries(process.env).filter(([name]) => allowed.test(name)));
const logPath = path.join(directory, 'tests.tap'), output = fs.createWriteStream(logPath), startedAt = new Date().toISOString(); let result, failure;
const timeoutMs = 30 * 60 * 1000;
const logPath = path.join(directory, 'tests.tap'), output = fs.createWriteStream(logPath), startedAt = new Date().toISOString(); let result, failure, timedOut = false;
try {
await new Promise((resolve, reject) => {
const child = spawn(process.execPath, ['--test', '--test-concurrency=2', '--test-reporter=tap', ...tests], { cwd: root, env, windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'] });
child.stdout.pipe(output, { end: false }); child.stderr.pipe(output, { end: false });
const timer = setTimeout(() => child.kill(), 600000);
const timer = setTimeout(() => {
timedOut = true;
if (process.platform === 'win32' && child.pid) {
const killer = spawn('taskkill.exe', ['/PID', String(child.pid), '/T', '/F'], { windowsHide: true, stdio: 'ignore' });
killer.once('error', () => child.kill());
killer.once('close', code => { if (code !== 0) child.kill(); });
} else child.kill('SIGTERM');
}, timeoutMs);
child.once('error', error => { clearTimeout(timer); reject(error); });
child.once('close', code => { clearTimeout(timer); code === 0 ? resolve() : reject(new Error('Regression process exit: ' + code)); });
child.once('close', code => {
clearTimeout(timer);
if (timedOut) reject(new Error(`Regression timed out after ${timeoutMs}ms; its process tree was terminated.`));
else code === 0 ? resolve() : reject(new Error('Regression process exit: ' + code));
});
});
} catch (error) { failure = error; }
await new Promise(resolve => output.end(resolve));
@@ -36,14 +48,12 @@ try {
if (failure) throw Object.assign(failure, { tail: text.slice(-16000) });
assert.ok(stats.tests > 0); assert.equal(stats.pass, stats.tests); for (const key of ['fail', 'cancelled', 'skipped', 'todo']) assert.equal(stats[key], 0);
assert.deepEqual(snapshot(), inputs, 'Inputs changed during regression; this is not final-source evidence.');
result = { success: true, version, startedAt, finishedAt: new Date().toISOString(), tests: stats, directory, nodeVersion: process.version, inputFiles: inputs.length, inputs,
result = { success: true, version, startedAt, finishedAt: new Date().toISOString(), timeoutMs, tests: stats, directory, nodeVersion: process.version, inputFiles: inputs.length, inputs,
log: { path: logPath, bytes: fs.statSync(logPath).size, sha256: hash(logPath) }, credentialsHandling: 'Only runtime/system paths and the independent QA Python path are inherited; no real model configuration or credentials.' };
} catch (error) {
result = { success: false, version, startedAt, finishedAt: new Date().toISOString(), directory, error: error.stack, tail: error.tail, inputs, log: { path: logPath, sha256: hash(logPath) } }; process.exitCode = 1;
result = { success: false, version, startedAt, finishedAt: new Date().toISOString(), timeoutMs, timedOut, directory, error: error.stack, tail: error.tail, inputs, log: { path: logPath, sha256: hash(logPath) } }; process.exitCode = 1;
}
fs.writeFileSync(path.join(directory, 'result.json'), JSON.stringify(result, null, 2) + '\n'); fs.writeFileSync('.qa/tests-validation.json', JSON.stringify(result, null, 2) + '\n');
if (version === '1.8.0') fs.writeFileSync('docs/rea-engine-tests-validation.json', JSON.stringify(result, null, 2) + '\n');
if (version === '1.9.0') fs.writeFileSync('docs/external-engines-tests-validation.json', JSON.stringify(result, null, 2) + '\n');
if (version === '1.10.0') fs.writeFileSync('docs/browser-engine-tests-validation.json', JSON.stringify(result, null, 2) + '\n');
if (version === '1.11.0') fs.writeFileSync('docs/task-plans-tests-validation.json', JSON.stringify(result, null, 2) + '\n');
// Release evidence is archived explicitly by the release workflow. A development
// regression must not replace a previously published report for the same version.
console.log(JSON.stringify({ success: result.success, version, tests: result.tests, inputFiles: result.inputFiles, directory, error: result.error, tail: result.tail }, null, 2));