refactor(core): migrate to Bun and converge acquisition policies and Agent boundaries

This commit is contained in:
root committed 2026-10-13 14:37:03 +08:00
1 parent 3f1c6d02f6
commit 27c0f27434
268 files changed
+7468 -7852

No files matched your search

+4 -8
View File
@@ -354,14 +354,10 @@ describe("PiAgentRuntime + FakeModelProvider", () => {
it("JSONL 恢复:子进程在 download.submit 执行中被 SIGKILL,新进程 resume 得到“结果未知”且不重复提交", async () => {
const sessionDir = await tempDir();
const child = spawn(
process.execPath,
["run", "-A", join(import.meta.dirname!, "fixtures/crash-run.ts"), sessionDir],
{
cwd: join(import.meta.dirname!, ".."),
stdio: ["ignore", "pipe", "pipe"],
},
);
const child = spawn(process.execPath, [join(import.meta.dirname!, "fixtures/crash-run.ts"), sessionDir], {
cwd: join(import.meta.dirname!, ".."),
stdio: ["ignore", "pipe", "pipe"],
});
let stderr = "";
child.stderr.on("data", (d) => {
stderr += String(d);
+3 -3
View File
@@ -150,14 +150,14 @@ describe("按上游装配", () => {
it("测试补全带 sessionId:OpenCode Go 请求头有 x-opencode-session", async () => {
const seen: { url: string; headers: Headers }[] = [];
const orig = globalThis.fetch;
globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
const req = new Request(input, init);
globalThis.fetch = (async (input: string | Request | URL, init?: RequestInit) => {
const req = new Request(input instanceof Request ? input : String(input), init);
seen.push({ url: req.url, headers: req.headers });
return new Response(JSON.stringify({ error: { message: "stubbed" } }), {
status: 500,
headers: { "content-type": "application/json" },
});
}) as typeof fetch;
}) as typeof globalThis.fetch;
try {
const c = new PiUpstreamClient(
spec({ provider: "opencode-go", authKind: "api_key" }),