惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
Vercel News
Vercel News
Last Week in AI
Last Week in AI
H
Help Net Security
The Cloudflare Blog
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
I
InfoQ
U
Unit 42
美团技术团队
人人都是产品经理
人人都是产品经理
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog
A
About on SuperTechFans
宝玉的分享
宝玉的分享
量子位
博客园_首页

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: existing doctor-contract Windows loader test still e...
clawsweeper · 2026-04-30 · via Recent Commits to openclaw:main

@@ -2,7 +2,6 @@ import fs from "node:fs";

22

import path from "node:path";

33

import { pathToFileURL } from "node:url";

44

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

5-

import { shouldExpectNativeJitiForJavaScriptTestRuntime } from "../test-utils/jiti-runtime.js";

65

import { cleanupTrackedTempDirs, makeTrackedTempDir } from "./test-helpers/fs-fixtures.js";

76

import {

87

getRegistryJitiMocks,

@@ -36,32 +35,83 @@ describe("doctor-contract-registry getJiti", () => {

3635

clearPluginDoctorContractRegistryCache();

3736

});

383739-

it("uses the runtime-supported Jiti boundary on Windows for contract-api modules", () => {

38+

it("uses native require on Windows for compatible JavaScript contract-api modules", () => {

4039

const pluginRoot = makeTempDir();

41-

fs.writeFileSync(path.join(pluginRoot, "contract-api.js"), "export default {};\n", "utf-8");

40+

fs.writeFileSync(

41+

path.join(pluginRoot, "contract-api.js"),

42+

"module.exports = { legacyConfigRules: [{ path: ['plugins', 'entries', 'demo', 'legacy'], message: 'legacy demo key' }] };\n",

43+

"utf-8",

44+

);

4245

mocks.loadPluginManifestRegistry.mockReturnValue({

4346

plugins: [{ id: "test-plugin", rootDir: pluginRoot }],

4447

diagnostics: [],

4548

});

4649

const platformSpy = vi.spyOn(process, "platform", "get").mockReturnValue("win32");

47-

const expectedTryNative = shouldExpectNativeJitiForJavaScriptTestRuntime();

48504951

try {

50-

listPluginDoctorLegacyConfigRules({

51-

workspaceDir: pluginRoot,

52-

env: {},

53-

});

52+

expect(

53+

listPluginDoctorLegacyConfigRules({

54+

workspaceDir: pluginRoot,

55+

env: {},

56+

}),

57+

).toEqual([

58+

{

59+

path: ["plugins", "entries", "demo", "legacy"],

60+

message: "legacy demo key",

61+

},

62+

]);

63+

} finally {

64+

platformSpy.mockRestore();

65+

}

66+67+

expect(mocks.createJiti).not.toHaveBeenCalled();

68+

});

69+70+

it("falls back to the Jiti boundary on Windows for TypeScript contract-api modules", () => {

71+

const pluginRoot = makeTempDir();

72+

const contractApiPath = path.join(pluginRoot, "contract-api.ts");

73+

fs.writeFileSync(

74+

contractApiPath,

75+

"export const legacyConfigRules = [{ path: ['plugins', 'entries', 'demo', 'ts'], message: 'typescript contract' }];\n",

76+

"utf-8",

77+

);

78+

mocks.createJiti.mockImplementation(() => () => ({

79+

legacyConfigRules: [

80+

{

81+

path: ["plugins", "entries", "demo", "ts"],

82+

message: "typescript contract",

83+

},

84+

],

85+

}));

86+

mocks.loadPluginManifestRegistry.mockReturnValue({

87+

plugins: [{ id: "test-plugin", rootDir: pluginRoot }],

88+

diagnostics: [],

89+

});

90+

const platformSpy = vi.spyOn(process, "platform", "get").mockReturnValue("win32");

91+92+

try {

93+

expect(

94+

listPluginDoctorLegacyConfigRules({

95+

workspaceDir: pluginRoot,

96+

env: {},

97+

}),

98+

).toEqual([

99+

{

100+

path: ["plugins", "entries", "demo", "ts"],

101+

message: "typescript contract",

102+

},

103+

]);

54104

} finally {

55105

platformSpy.mockRestore();

56106

}

5710758108

expect(mocks.createJiti).toHaveBeenCalledTimes(1);

59109

expect(mocks.createJiti.mock.calls[0]?.[0]).toBe(

60-

pathToFileURL(path.join(pluginRoot, "contract-api.js"), { windows: true }).href,

110+

pathToFileURL(contractApiPath, { windows: true }).href,

61111

);

62112

expect(mocks.createJiti.mock.calls[0]?.[1]).toEqual(

63113

expect.objectContaining({

64-

tryNative: expectedTryNative,

114+

tryNative: false,

65115

}),

66116

);

67117

});