fix: complete codex app-server turns in docker

This commit is contained in:
Peter Steinberger
2026-04-23 05:34:56 +01:00
parent 20b05f220e
commit d88d6a3c8b
23 changed files with 283 additions and 134 deletions

View File

@@ -1,19 +1,13 @@
import type { AgentHarness } from "openclaw/plugin-sdk/agent-harness";
import { maybeCompactCodexAppServerSession } from "./src/app-server/compact.js";
import { listCodexAppServerModels } from "./src/app-server/models.js";
import type { AgentHarness } from "openclaw/plugin-sdk/agent-harness-runtime";
import type {
CodexAppServerListModelsOptions,
CodexAppServerModel,
CodexAppServerModelListResult,
} from "./src/app-server/models.js";
import { runCodexAppServerAttempt } from "./src/app-server/run-attempt.js";
import { clearCodexAppServerBinding } from "./src/app-server/session-binding.js";
import { clearSharedCodexAppServerClient } from "./src/app-server/shared-client.js";
const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = new Set(["codex"]);
export type { CodexAppServerListModelsOptions, CodexAppServerModel, CodexAppServerModelListResult };
export { listCodexAppServerModels };
export function createCodexAppServerAgentHarness(options?: {
id?: string;
@@ -39,16 +33,22 @@ export function createCodexAppServerAgentHarness(options?: {
reason: `provider is not one of: ${[...providerIds].toSorted().join(", ")}`,
};
},
runAttempt: (params) =>
runCodexAppServerAttempt(params, { pluginConfig: options?.pluginConfig }),
compact: (params) =>
maybeCompactCodexAppServerSession(params, { pluginConfig: options?.pluginConfig }),
runAttempt: async (params) => {
const { runCodexAppServerAttempt } = await import("./src/app-server/run-attempt.js");
return runCodexAppServerAttempt(params, { pluginConfig: options?.pluginConfig });
},
compact: async (params) => {
const { maybeCompactCodexAppServerSession } = await import("./src/app-server/compact.js");
return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.pluginConfig });
},
reset: async (params) => {
if (params.sessionFile) {
const { clearCodexAppServerBinding } = await import("./src/app-server/session-binding.js");
await clearCodexAppServerBinding(params.sessionFile);
}
},
dispose: () => {
dispose: async () => {
const { clearSharedCodexAppServerClient } = await import("./src/app-server/shared-client.js");
clearSharedCodexAppServerClient();
},
};