fix: 支持 AgentRun render-only REST 入口 (#170)

Co-authored-by: AgentRun Codex <agentrun-codex@users.noreply.github.com>
This commit is contained in:
Lyon
2026-06-11 15:39:52 +08:00
committed by GitHub
parent 83a303959e
commit 8cf6534bec
12 changed files with 338 additions and 12 deletions
+8
View File
@@ -33,6 +33,10 @@ type SelfTestRunContext = Pick<SelfTestContext, "workspace" | "codexHome"> & Par
export async function createSelfTestContext(root: string): Promise<SelfTestContext> {
const tmp = await mkdtemp(path.join(os.tmpdir(), "agentrun-selftest-"));
const previousSelftestWorkReadyBinPath = process.env.AGENTRUN_SELFTEST_WORK_READY_BIN_PATH;
const previousAgentRunApiKey = process.env.AGENTRUN_API_KEY;
const previousAgentRunApiKeyFile = process.env.AGENTRUN_API_KEY_FILE;
delete process.env.AGENTRUN_API_KEY;
delete process.env.AGENTRUN_API_KEY_FILE;
const codexHome = path.join(tmp, "codex-home");
const deepseekHome = path.join(tmp, "deepseek-home");
const minimaxM3Home = path.join(tmp, "minimax-m3-home");
@@ -67,6 +71,10 @@ export async function createSelfTestContext(root: string): Promise<SelfTestConte
cleanup: async () => {
if (previousSelftestWorkReadyBinPath === undefined) delete process.env.AGENTRUN_SELFTEST_WORK_READY_BIN_PATH;
else process.env.AGENTRUN_SELFTEST_WORK_READY_BIN_PATH = previousSelftestWorkReadyBinPath;
if (previousAgentRunApiKey === undefined) delete process.env.AGENTRUN_API_KEY;
else process.env.AGENTRUN_API_KEY = previousAgentRunApiKey;
if (previousAgentRunApiKeyFile === undefined) delete process.env.AGENTRUN_API_KEY_FILE;
else process.env.AGENTRUN_API_KEY_FILE = previousAgentRunApiKeyFile;
await rm(tmp, { recursive: true, force: true });
},
};