feat(mcp): resume queued calculation jobs

This commit is contained in:
2026-10-29 18:25:22 +08:00
parent 52681a8451
commit 799b99f310
20 changed files with 348 additions and 42 deletions
@@ -1,13 +1,22 @@
import { afterAll, beforeAll, describe, expect, it } from "bun:test";
import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import plugin from "../../.opencode/plugins/tjwater-tools.js";
const originalConnectionPath = process.env.TJWATER_AGENT_MCP_CONNECTION_PATH;
const connectionRoot = mkdtempSync(join(tmpdir(), "call-id-plugin-"));
const originalInternalToken = process.env.AGENT_INTERNAL_TOKEN;
beforeAll(() => {
process.env.TJWATER_AGENT_MCP_CONNECTION_PATH = join(connectionRoot, "absent.json");
process.env.AGENT_INTERNAL_TOKEN = "test-internal-token";
});
afterAll(() => {
if (originalConnectionPath === undefined) delete process.env.TJWATER_AGENT_MCP_CONNECTION_PATH;
else process.env.TJWATER_AGENT_MCP_CONNECTION_PATH = originalConnectionPath;
rmSync(connectionRoot, { recursive: true, force: true });
if (originalInternalToken === undefined) delete process.env.AGENT_INTERNAL_TOKEN;
else process.env.AGENT_INTERNAL_TOKEN = originalInternalToken;
});