Skip to content

Commit f6cb93e

Browse files
authored
Merge ab56763 into 6a5a135
2 parents 6a5a135 + ab56763 commit f6cb93e

739 files changed

Lines changed: 3220 additions & 3210 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.oxlintrc.json

Lines changed: 1 addition & 214 deletions
Original file line numberDiff line numberDiff line change
@@ -8,220 +8,7 @@
88
},
99
"rules": {
1010
"curly": "error",
11-
"eslint/no-underscore-dangle": [
12-
"error",
13-
{
14-
"allow": [
15-
"__agentId",
16-
"__bundledOverrideRuntime",
17-
"__bundledPluginFailureLoads",
18-
"__bundledPluginUndefinedLoads",
19-
"__bundledRootRuntime",
20-
"__bundledSecretsFailureLoads",
21-
"__bundledSetupFailureLoads",
22-
"__bundledSetupOnlyMainLoaded",
23-
"__bundledSetupOnlyPluginLoaded",
24-
"__bundledSetupOnlySetupLoaded",
25-
"__bundledSetupSecretsFailureLoads",
26-
"__esModule",
27-
"__dirname",
28-
"__filename",
29-
"__testing",
30-
"__test__",
31-
"__test",
32-
"__testing_resetResolvedSkillsCache",
33-
"__openclaw",
34-
"__openclawBundledChannelReenter",
35-
"__openclawBundledOverrideRuntime",
36-
"__openclawBundledPluginFailureLoads",
37-
"__openclawBundledPluginUndefinedLoads",
38-
"__openclawBundledRootRuntime",
39-
"__openclawBundledSecretsFailureLoads",
40-
"__openclawBundledSetupFailureLoads",
41-
"__openclawBundledSetupOnlyMainLoaded",
42-
"__openclawBundledSetupOnlyPluginLoaded",
43-
"__openclawBundledSetupOnlySetupLoaded",
44-
"__openclawBundledSetupSecretsFailureLoads",
45-
"__openclawDiagnosticStabilityState",
46-
"__openclawLastA2UIAction",
47-
"__openclawPreauthBudgetClaimed",
48-
"__openclawPreauthBudgetKey",
49-
"__openclawSessionEventWriteLockInstalled",
50-
"__openclawSessionLockPromptReleaseInstalled",
51-
"__openclawSessionWriteLockInstalled",
52-
"__OPENCLAW_TEST_REFRESH_OPENAI_CODEX_TOKEN__",
53-
"__countTrackedSessionBrowserTabsForTests",
54-
"__emit",
55-
"__gatewayStartupSecretsRuntimeMock",
56-
"__image",
57-
"__matrixQaProfileTesting",
58-
"__OPENCLAW_VERSION__",
59-
"__OPENCLAW_CONTROL_UI_BUILD_ID__",
60-
"__OPENCLAW_NATIVE_CONTROL_AUTH__",
61-
"__OPENCLAW_CONTROL_UI_BASE_PATH__",
62-
"__testDivider",
63-
"__proofAttachmentApi",
64-
"__proofAttachmentLog",
65-
"__QA_IMAGE_UNDERSTANDING_LARGE_PNG_BASE64",
66-
"__QA_IMAGE_UNDERSTANDING_PNG_BASE64",
67-
"__resetContainerEnvironmentCacheForTest",
68-
"__resetDiscordChannelInfoCacheForTest",
69-
"__resetDiscordDirectoryCacheForTest",
70-
"__resetDiscordThreadStarterCacheForTest",
71-
"__resetGatewayModelPricingCacheForTest",
72-
"__resetLmstudioPreloadCooldownForTest",
73-
"__resetModelCatalogCacheForTest",
74-
"__resetSlackChannelTypeCacheForTest",
75-
"__resetTrackedSessionBrowserTabsForTests",
76-
"__resetUsageFormatCachesForTest",
77-
"__sessionKey",
78-
"__sessionUpdateMock",
79-
"__setGatewayModelPricingForTest",
80-
"__setMaxChatHistoryMessagesBytesForTest",
81-
"__setMembers",
82-
"__setModelCatalogImportForTest",
83-
"__setRealtimeVoiceAgentConsultDepsForTest",
84-
"__slackClient",
85-
"__slackHandlers",
86-
"__testOnlyOpenAiHttp",
87-
"__truncated",
88-
"__unhandledDestroyError",
89-
"_accountRegistry",
90-
"_adapter",
91-
"_adapterFactory",
92-
"_agentEventQueue",
93-
"_ambiguousThreadReply",
94-
"_approveRuntimeGetter",
95-
"_audioPort",
96-
"_baseSystemPrompt",
97-
"_body",
98-
"_boundaryPrefix",
99-
"_cache",
100-
"_cachedCapability",
101-
"_callbackChain",
102-
"_capturedPayload",
103-
"_clearForTest",
104-
"_client",
105-
"_advancedWaitingSort",
106-
"_diaryEntryCount",
107-
"_diaryPage",
108-
"_diarySubTab",
109-
"_dreamIndex",
110-
"_dreamLastSwap",
111-
"_expandedInsightCards",
112-
"_expandedPalaceCards",
113-
"_indices",
114-
"_keys",
115-
"_pendingUpdate",
116-
"_refreshSeq",
117-
"_subTab",
118-
"_wikiPreviewContent",
119-
"_wikiPreviewError",
120-
"_wikiPreviewLoading",
121-
"_wikiPreviewOpen",
122-
"_wikiPreviewPath",
123-
"_wikiPreviewTitle",
124-
"_wikiPreviewTotalLines",
125-
"_wikiPreviewTruncated",
126-
"_wikiPreviewUpdatedAt",
127-
"_config",
128-
"_createdAt",
129-
"_createGraphCollectionResponse",
130-
"_createHostedImageContents",
131-
"_createMemoryConfig",
132-
"_createMemorySyncControlConfigForTests",
133-
"_createPdfResponse",
134-
"_createUnboundConfiguredRoute",
135-
"_data",
136-
"_default",
137-
"_def",
138-
"_distance",
139-
"_doIdle",
140-
"_doPartialReply",
141-
"_embeddedMode",
142-
"_event",
143-
"_exhaustive",
144-
"_extensionRunner",
145-
"_fallbackLogger",
146-
"_findChatGuidForTest",
147-
"_flow",
148-
"_formatImagePlaceholder",
149-
"_getActiveHandles",
150-
"_getActiveRequests",
151-
"_getData",
152-
"_getStatusCode",
153-
"_getTrustedDirs",
154-
"_globalUndiciStreamTimeoutMs",
155-
"_GRAPH_HOST",
156-
"_handlers",
157-
"_host",
158-
"_id",
159-
"_instruction",
160-
"_isMockFunction",
161-
"_item",
162-
"_logger",
163-
"_maxPayload",
164-
"_meta",
165-
"_mode",
166-
"_normalizeDirectChatIdentifierForTest",
167-
"_openclawVersion",
168-
"_openRouterMusicTestInternals",
169-
"_parsed",
170-
"_pendingSessionText",
171-
"_pendingUploadId",
172-
"_pluginVersion",
173-
"_private",
174-
"_probeThrottleInternals",
175-
"_processAgentEvent",
176-
"_rawData",
177-
"_ready",
178-
"_rebuildSystemPrompt",
179-
"_receiver",
180-
"_registerOpenAIPlugin",
181-
"_registerProvider",
182-
"_requestLanguageOverride",
183-
"_requestPromptOverride",
184-
"_resetActiveManagedProxyStateForTests",
185-
"_resetBootstrapWarningCacheForTest",
186-
"_resetIMessageShortIdState",
187-
"_resetMemoryEmbeddingProviders",
188-
"_resetMemoryPluginState",
189-
"_resetResolveSystemBin",
190-
"_resetThreadParentContextCachesForTest",
191-
"_resetWindowsInstallRootsForTests",
192-
"_resolveFilename",
193-
"_resolveVersion",
194-
"_resolveWhatsAppAccountConfig",
195-
"_rewriteFile",
196-
"_setComfyFetchGuardForTesting",
197-
"_setFalFetchGuardForTesting",
198-
"_setFalVideoFetchGuardForTesting",
199-
"_setGitHubCopilotDeviceFlowFetchGuardForTesting",
200-
"_SHAREPOINT_HOST",
201-
"_silkWasmAvailable",
202-
"_silkWasmPromise",
203-
"_socket",
204-
"_status",
205-
"_test",
206-
"_token",
207-
"_truncated",
208-
"_videoGenerationSdkCompat",
209-
"_QA_IMAGE_UNDERSTANDING_LARGE_PNG_BASE64",
210-
"_QA_IMAGE_UNDERSTANDING_PNG_BASE64",
211-
"_TEST_URL_HTML_A",
212-
"_TEST_URL_HTML_B",
213-
"_TEST_URL_IMAGE_1_PNG",
214-
"_TEST_URL_IMAGE_2_JPG",
215-
"_TEST_URL_IMAGE_PNG",
216-
"_TEST_URL_PDF",
217-
"_TEST_URL_PDF_1",
218-
"_TEST_URL_PDF_2",
219-
"isManuallyStopped_",
220-
"resetRestartAttempts_",
221-
"require_"
222-
]
223-
}
224-
],
11+
"eslint/no-underscore-dangle": "error",
22512
"eslint-plugin-unicorn/prefer-array-find": "error",
22613
"eslint/no-array-constructor": "error",
22714
"eslint/no-await-in-loop": "off",

extensions/acpx/src/runtime.test.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
type AcpRuntimeTurn,
1010
} from "../runtime-api.js";
1111
import { OPENCLAW_ACPX_LEASE_ID_ARG, OPENCLAW_GATEWAY_INSTANCE_ID_ARG } from "./process-lease.js";
12-
import { AcpxRuntime, __testing } from "./runtime.js";
12+
import { AcpxRuntime, testing } from "./runtime.js";
1313

1414
type TestSessionStore = {
1515
load(sessionId: string): Promise<Record<string, unknown> | undefined>;
@@ -179,9 +179,9 @@ describe("AcpxRuntime fresh reset wrapper", () => {
179179
});
180180

181181
it("exposes assertSupportedRuntimeSessionMode as a typed guard", () => {
182-
expect(__testing.assertSupportedRuntimeSessionMode("persistent")).toBeUndefined();
183-
expect(__testing.assertSupportedRuntimeSessionMode("oneshot")).toBeUndefined();
184-
expect(() => __testing.assertSupportedRuntimeSessionMode("run" as never)).toThrow(
182+
expect(testing.assertSupportedRuntimeSessionMode("persistent")).toBeUndefined();
183+
expect(testing.assertSupportedRuntimeSessionMode("oneshot")).toBeUndefined();
184+
expect(() => testing.assertSupportedRuntimeSessionMode("run" as never)).toThrow(
185185
AcpRuntimeError,
186186
);
187187
});
@@ -335,7 +335,7 @@ describe("AcpxRuntime fresh reset wrapper", () => {
335335
});
336336

337337
await expect(async () => {
338-
for await (const _event of runtime.runTurn({
338+
for await (const eventValue of runtime.runTurn({
339339
handle: {
340340
sessionKey: "agent:codex:acp:test",
341341
backend: "acpx",
@@ -568,7 +568,7 @@ describe("AcpxRuntime fresh reset wrapper", () => {
568568
}),
569569
);
570570

571-
for await (const _event of runtime.runTurn({
571+
for await (const eventValue of runtime.runTurn({
572572
handle: {
573573
sessionKey: "agent:codex:acp:test",
574574
backend: "acpx",
@@ -599,7 +599,7 @@ describe("AcpxRuntime fresh reset wrapper", () => {
599599
mode: "prompt",
600600
requestId: "turn-2",
601601
});
602-
for await (const _event of turn.events) {
602+
for await (const eventValue of turn.events) {
603603
// no-op
604604
}
605605
await turn.result;
@@ -644,17 +644,17 @@ describe("AcpxRuntime fresh reset wrapper", () => {
644644
});
645645

646646
it("injects Codex ACP startup config into the scoped registry", () => {
647-
expect(__testing.isCodexAcpCommand(CODEX_ACP_COMMAND)).toBe(true);
648-
expect(__testing.isCodexAcpCommand(CODEX_ACP_WRAPPER_COMMAND)).toBe(true);
647+
expect(testing.isCodexAcpCommand(CODEX_ACP_COMMAND)).toBe(true);
648+
expect(testing.isCodexAcpCommand(CODEX_ACP_WRAPPER_COMMAND)).toBe(true);
649649
expect(
650-
__testing.appendCodexAcpConfigOverrides(CODEX_ACP_COMMAND, {
650+
testing.appendCodexAcpConfigOverrides(CODEX_ACP_COMMAND, {
651651
model: "gpt-5.4",
652652
reasoningEffort: "medium",
653653
}),
654654
).toBe(
655655
"npx @zed-industries/codex-acp@0.13.0 -c model=gpt-5.4 -c model_reasoning_effort=medium",
656656
);
657-
expect(__testing.isCodexAcpCommand("openclaw acp")).toBe(false);
657+
expect(testing.isCodexAcpCommand("openclaw acp")).toBe(false);
658658
});
659659

660660
it("passes gpt-5.5 Codex ACP startup through instead of blocking it", async () => {
@@ -913,27 +913,27 @@ describe("AcpxRuntime fresh reset wrapper", () => {
913913
});
914914

915915
it("recognizes claude-agent-acp commands", () => {
916-
expect(__testing.isClaudeAcpCommand("npx @agentclientprotocol/claude-agent-acp")).toBe(true);
917-
expect(
918-
__testing.isClaudeAcpCommand("npx -y @agentclientprotocol/claude-agent-acp@0.33.1"),
919-
).toBe(true);
920-
expect(__testing.isClaudeAcpCommand("claude-agent-acp")).toBe(true);
921-
expect(__testing.isClaudeAcpCommand("claude-agent-acp.exe")).toBe(true);
916+
expect(testing.isClaudeAcpCommand("npx @agentclientprotocol/claude-agent-acp")).toBe(true);
917+
expect(testing.isClaudeAcpCommand("npx -y @agentclientprotocol/claude-agent-acp@0.33.1")).toBe(
918+
true,
919+
);
920+
expect(testing.isClaudeAcpCommand("claude-agent-acp")).toBe(true);
921+
expect(testing.isClaudeAcpCommand("claude-agent-acp.exe")).toBe(true);
922922
expect(
923-
__testing.isClaudeAcpCommand(`node "/tmp/openclaw/acpx/claude-agent-acp-wrapper.mjs"`),
923+
testing.isClaudeAcpCommand(`node "/tmp/openclaw/acpx/claude-agent-acp-wrapper.mjs"`),
924924
).toBe(true);
925925
expect(
926-
__testing.isClaudeAcpCommand(
926+
testing.isClaudeAcpCommand(
927927
`node.exe "C:/Users/runner/AppData/Local/Temp/openclaw/acpx/claude-agent-acp-wrapper.mjs"`,
928928
),
929929
).toBe(true);
930930
expect(
931-
__testing.isClaudeAcpCommand(
931+
testing.isClaudeAcpCommand(
932932
`Node.EXE "C:/Users/runner/AppData/Local/Temp/openclaw/acpx/claude-agent-acp-wrapper.mjs"`,
933933
),
934934
).toBe(true);
935-
expect(__testing.isClaudeAcpCommand("openclaw acp")).toBe(false);
936-
expect(__testing.isClaudeAcpCommand("npx @zed-industries/codex-acp")).toBe(false);
935+
expect(testing.isClaudeAcpCommand("openclaw acp")).toBe(false);
936+
expect(testing.isClaudeAcpCommand("npx @zed-industries/codex-acp")).toBe(false);
937937
});
938938

939939
it("keeps stale persistent loads hidden until a fresh record is saved", async () => {

extensions/acpx/src/runtime.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ export {
12481248
encodeAcpxRuntimeHandleState,
12491249
};
12501250

1251-
export const __testing = {
1251+
export const testing = {
12521252
appendCodexAcpConfigOverrides,
12531253
assertSupportedRuntimeSessionMode,
12541254
codexAcpSessionModelId,
@@ -1258,3 +1258,4 @@ export const __testing = {
12581258
};
12591259

12601260
export type { AcpAgentRegistry, AcpRuntimeOptions, AcpSessionRecord, AcpSessionStore };
1261+
export { testing as __testing };

0 commit comments

Comments
 (0)