fix: preserve model state, isolate commands and harden local HTTP in 1.12.1
This commit is contained in:
@@ -4,6 +4,7 @@ import os from 'node:os';
|
||||
import { createHash, randomUUID } from 'node:crypto';
|
||||
import { execFile } from 'node:child_process';
|
||||
import { promisify } from 'node:util';
|
||||
import { projectEnvironment } from './process-environment.mjs';
|
||||
|
||||
const executeFile = promisify(execFile);
|
||||
const digest = bytes => createHash('sha256').update(bytes).digest('hex');
|
||||
@@ -15,9 +16,7 @@ const fileIdentity = file => {
|
||||
return { path: resolved, sha256: digest(fs.readFileSync(resolved)) };
|
||||
};
|
||||
export function pythonEnvironment() {
|
||||
const environment = { ...process.env, NO_COLOR: '1', CI: '1', PYTEST_DISABLE_PLUGIN_AUTOLOAD: '1', PYTHONDONTWRITEBYTECODE: '1' };
|
||||
for (const key of ['AGENT_WORKBENCH_API_KEY', 'NODE_TEST_CONTEXT', 'PYTEST_ADDOPTS', 'PYTEST_PLUGINS', 'PYTHONPATH', 'PYTHONHOME', 'PYTHONSTARTUP', 'FORCE_COLOR']) delete environment[key];
|
||||
return environment;
|
||||
return projectEnvironment({ NO_COLOR: '1', CI: '1', PYTEST_DISABLE_PLUGIN_AUTOLOAD: '1', PYTHONDONTWRITEBYTECODE: '1' });
|
||||
}
|
||||
function configurationFor(executable) {
|
||||
for (const file of [path.join(path.dirname(executable), 'pyvenv.cfg'), path.join(path.dirname(executable), '..', 'pyvenv.cfg')]) {
|
||||
|
||||
Reference in New Issue
Block a user