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

+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" }),