Fix Windows bundle MCP and Matrix contract seams

This commit is contained in:
Tak Hoffman 2026-03-19 08:14:41 -05:00
parent 52020d3a0c
commit f571f6d534
No known key found for this signature in database
4 changed files with 24 additions and 13 deletions

View File

@ -12,3 +12,8 @@ export {
resolveMatrixLegacyFlatStoreRoot,
sanitizeMatrixPathSegment,
} from "./helper-api.js";
export {
createMatrixThreadBindingManager,
resetMatrixThreadBindingsForTests,
} from "./src/matrix/thread-bindings.js";
export { setMatrixRuntime } from "./src/runtime.js";

View File

@ -10,8 +10,8 @@ import { createFeishuThreadBindingManager } from "../../../../extensions/feishu/
import {
createMatrixThreadBindingManager,
resetMatrixThreadBindingsForTests,
} from "../../../../extensions/matrix/src/matrix/thread-bindings.js";
import { setMatrixRuntime } from "../../../../extensions/matrix/src/runtime.js";
setMatrixRuntime,
} from "../../../../extensions/matrix/runtime-api.js";
import { createTelegramThreadBindingManager } from "../../../../extensions/telegram/runtime-api.js";
import type { OpenClawConfig } from "../../../config/config.js";
import {

View File

@ -1,7 +1,7 @@
import { beforeEach, describe, vi } from "vitest";
import { __testing as discordThreadBindingTesting } from "../../../../extensions/discord/src/monitor/thread-bindings.manager.js";
import { __testing as feishuThreadBindingTesting } from "../../../../extensions/feishu/src/thread-bindings.js";
import { resetMatrixThreadBindingsForTests } from "../../../../extensions/matrix/src/matrix/thread-bindings.js";
import { resetMatrixThreadBindingsForTests } from "../../../../extensions/matrix/runtime-api.js";
import { __testing as telegramThreadBindingTesting } from "../../../../extensions/telegram/src/thread-bindings.js";
import { __testing as sessionBindingTesting } from "../../../infra/outbound/session-binding-service.js";
import { sessionBindingContractRegistry } from "./registry.js";

View File

@ -11,6 +11,10 @@ function getServerArgs(value: unknown): unknown[] | undefined {
return isRecord(value) && Array.isArray(value.args) ? value.args : undefined;
}
function normalizePluginPath(value: string): string {
return path.normalize(value.replaceAll("/", path.sep));
}
const tempHarness = createBundleMcpTempHarness();
afterEach(async () => {
@ -177,16 +181,18 @@ describe("loadEnabledBundleMcpConfig", () => {
},
});
expect(loaded.diagnostics).toEqual([]);
expect(loaded.config.mcpServers.inlineProbe).toEqual({
command: path.join(pluginRoot, "bin", "server.sh"),
args: [
path.join(pluginRoot, "servers", "probe.mjs"),
path.join(pluginRoot, "local-probe.mjs"),
],
cwd: pluginRoot,
env: {
PLUGIN_ROOT: pluginRoot,
},
const inlineProbe = loaded.config.mcpServers.inlineProbe;
expect(isRecord(inlineProbe)).toBe(true);
expect(normalizePluginPath(String(isRecord(inlineProbe) ? inlineProbe.command : ""))).toBe(
normalizePluginPath(path.join(pluginRoot, "bin", "server.sh")),
);
expect(getServerArgs(inlineProbe)?.map((arg) => normalizePluginPath(String(arg)))).toEqual([
normalizePluginPath(path.join(pluginRoot, "servers", "probe.mjs")),
normalizePluginPath(path.join(pluginRoot, "local-probe.mjs")),
]);
expect(isRecord(inlineProbe) ? inlineProbe.cwd : undefined).toBe(pluginRoot);
expect(isRecord(inlineProbe) ? inlineProbe.env : undefined).toEqual({
PLUGIN_ROOT: pluginRoot,
});
} finally {
env.restore();