




















@@ -1,19 +1,13 @@
1-import type { AgentHarness } from "openclaw/plugin-sdk/agent-harness";
2-import { maybeCompactCodexAppServerSession } from "./src/app-server/compact.js";
3-import { listCodexAppServerModels } from "./src/app-server/models.js";
1+import type { AgentHarness } from "openclaw/plugin-sdk/agent-harness-runtime";
42import type {
53CodexAppServerListModelsOptions,
64CodexAppServerModel,
75CodexAppServerModelListResult,
86} from "./src/app-server/models.js";
9-import { runCodexAppServerAttempt } from "./src/app-server/run-attempt.js";
10-import { clearCodexAppServerBinding } from "./src/app-server/session-binding.js";
11-import { clearSharedCodexAppServerClient } from "./src/app-server/shared-client.js";
127138const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = new Set(["codex"]);
1491510export type { CodexAppServerListModelsOptions, CodexAppServerModel, CodexAppServerModelListResult };
16-export { listCodexAppServerModels };
17111812export function createCodexAppServerAgentHarness(options?: {
1913id?: string;
@@ -39,16 +33,22 @@ export function createCodexAppServerAgentHarness(options?: {
3933reason: `provider is not one of: ${[...providerIds].toSorted().join(", ")}`,
4034};
4135},
42-runAttempt: (params) =>
43-runCodexAppServerAttempt(params, { pluginConfig: options?.pluginConfig }),
44-compact: (params) =>
45-maybeCompactCodexAppServerSession(params, { pluginConfig: options?.pluginConfig }),
36+runAttempt: async (params) => {
37+const { runCodexAppServerAttempt } = await import("./src/app-server/run-attempt.js");
38+return runCodexAppServerAttempt(params, { pluginConfig: options?.pluginConfig });
39+},
40+compact: async (params) => {
41+const { maybeCompactCodexAppServerSession } = await import("./src/app-server/compact.js");
42+return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.pluginConfig });
43+},
4644reset: async (params) => {
4745if (params.sessionFile) {
46+const { clearCodexAppServerBinding } = await import("./src/app-server/session-binding.js");
4847await clearCodexAppServerBinding(params.sessionFile);
4948}
5049},
51-dispose: () => {
50+dispose: async () => {
51+const { clearSharedCodexAppServerClient } = await import("./src/app-server/shared-client.js");
5252clearSharedCodexAppServerClient();
5353},
5454};
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。