@openclaw/codex 2026.8.1-beta.2 → 2026.9.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +147 -0
- package/dist/{attempt-client-cleanup-DMLXUfa8.js → attempt-client-cleanup-bfsmcQ6m.js} +21 -2
- package/dist/{binding-connection-I5Bo-AsX.js → binding-connection-BMvPX73o.js} +15 -3
- package/dist/{bounded-turn-qgZmzy_4.js → bounded-turn-B7iBUcuP.js} +22 -16
- package/dist/{capabilities-CybGI1oz.js → capabilities-BRMh0aIq.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-B1AEz8ZA.js → command-formatters-DEsIufkt.js} +2 -2
- package/dist/{command-handlers-Db8pu_ds.js → command-handlers-D_-1_qRp.js} +65 -37
- package/dist/command-rpc-CCeCkf_v.js +90 -0
- package/dist/{compact-LspQaGfl.js → compact-BglNFZrQ.js} +35 -29
- package/dist/{session-binding-DPxIvMgE.js → config-giW8X0QA.js} +108 -914
- package/dist/context-compaction-activity-BOeJf7yo.js +58 -0
- package/dist/doctor-contract-api.js +23 -21
- package/dist/{dynamic-tools-BVdyWkUD.js → dynamic-tools-Dnlfa--w.js} +1345 -1424
- package/dist/{effective-mcp-catalog-DIIhAtOZ.js → effective-mcp-catalog-CTeGrnfO.js} +2 -2
- package/dist/elicitation-input-DMkeki8d.js +71 -0
- package/dist/{event-projector-assistant-message-BwxV4d6N.js → event-projector-assistant-message-C5-Ds8mA.js} +18 -1
- package/dist/{event-projector-usage-e5huIQWu.js → event-projector-usage-Bk1I90Bg.js} +18 -18
- package/dist/harness-Csz0F-DK.js +258 -0
- package/dist/harness.js +2 -226
- package/dist/index.js +262 -181
- package/dist/{isolated-completion-C58NbL40.js → isolated-completion-Cv6FqygM.js} +4 -4
- package/dist/managed-binary-DFYK4DWq.js +248 -0
- package/dist/media-understanding-provider.js +2 -2
- package/dist/model-catalog-i9rNBthX.js +48 -0
- package/dist/{models-BFlpn1Ex.js → models-TS3HBU-q.js} +4 -3
- package/dist/{native-subagent-monitor-DyTGmTUx.js → native-subagent-monitor-4Mfq2HDs.js} +354 -83
- package/dist/node-exec-server.runtime-BpWqJO1V.js +192 -0
- package/dist/{plugin-app-cache-key-C3H2CVp6.js → plugin-app-cache-key-C1CAdfcP.js} +19 -4
- package/dist/plugin-approval-roundtrip-bUm777tR.js +95 -0
- package/dist/{plugin-marketplace-discovery-CzrGJdCR.js → plugin-marketplace-discovery-B9DvaAG-.js} +59 -54
- package/dist/{plugin-metadata-cache-CNJPj4_b.js → plugin-metadata-cache-CTCT3w5L.js} +164 -134
- package/dist/{protocol-validators-B4F7L8Rf.js → protocol-validators-VeJxxJ0U.js} +80 -5
- package/dist/{rate-limits-DZXmOL8-.js → rate-limits-C5_D8Gmb.js} +1 -1
- package/dist/{request-BRl5_UfX.js → request-DXXGHko0.js} +2 -2
- package/dist/{run-attempt-P8BdxC1I.js → run-attempt-DYc0QCBF.js} +1276 -765
- package/dist/{runtime-artifact-BVSPdd6g.js → runtime-artifact-BvyT1uyd.js} +4 -7
- package/dist/{sandbox-guard-Cmwc9eIk.js → sandbox-guard-kuWTn9C5.js} +25 -19
- package/dist/session-binding-Bcynfd-_.js +874 -0
- package/dist/{session-catalog-xwNi_SDM.js → session-catalog-DaLKVtpH.js} +1534 -1288
- package/dist/session-catalog-home-id-BNwAJ9D7.js +18 -0
- package/dist/{session-cli-7hgXZDV7.js → session-cli-DMc4oS2w.js} +20 -7
- package/dist/session-permission-policy-BrNH1bjy.js +160 -0
- package/dist/{session-retirement-DoMMJFKm.js → session-retirement-CcNC3YSY.js} +3 -3
- package/dist/{session-upstream-marker-CrIFX06J.js → session-upstream-marker-BIkusb95.js} +1 -1
- package/dist/{settled-turn-finalizer-BRWBO4MO.js → settled-turn-finalizer-Dc3ApjU4.js} +24 -20
- package/dist/{shared-client-kIBbGjk4.js → shared-client-DKz23hHY.js} +1632 -372
- package/dist/{side-question-9HAL26l9.js → side-question-DjA_jsNe.js} +105 -54
- package/dist/{thread-lifecycle-Bu1BTDXr.js → thread-lifecycle-L7oEkTlq.js} +1147 -114
- package/dist/{thread-ownership-6kOQHlyC.js → thread-ownership-DZeuKH1j.js} +2 -2
- package/dist/{thread-resume-CPrJNQVM.js → thread-resume-BE9qNEW0.js} +3 -3
- package/dist/{transcript-mirror-B9gGgnJS.js → transcript-mirror-DsCMWBca.js} +137 -38
- package/dist/{transport-stdio-DIImwDVS.js → transport-stdio-DhoGy33Z.js} +2 -2
- package/dist/{upstream-prompt-provenance-ClRBije0.js → upstream-prompt-provenance-CFmsKwr9.js} +12 -14
- package/dist/{upstream-session-fork-CE-_LdnP.js → upstream-session-fork-DlaHxSLC.js} +12 -6
- package/dist/{usage-CHlV0e-o.js → usage-ROIaW3wo.js} +3 -3
- package/dist/{web-search-provider.runtime-DRw2Vl42.js → web-search-provider.runtime-ClaNPV7N.js} +3 -3
- package/openclaw.plugin.json +49 -2
- package/package.json +9 -8
- package/dist/app-server-policy-zcBDc1JU.js +0 -49
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as
|
|
1
|
+
import { h as retainSharedCodexAppServerClientByInstanceId } from "./shared-client-DKz23hHY.js";
|
|
2
|
+
import { d as sessionBindingIdentity } from "./session-binding-Bcynfd-_.js";
|
|
3
3
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { assignMcpCatalogSafeServerNames } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
5
5
|
//#region extensions/codex/src/app-server/effective-mcp-catalog.ts
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { agentHarnessStructuredInput } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
2
|
+
//#region extensions/codex/src/app-server/elicitation-input.ts
|
|
3
|
+
/** Snapshots and compiles ordinary Codex input before it enters the per-turn queue. */
|
|
4
|
+
function compileCodexOrdinaryElicitation(params) {
|
|
5
|
+
if (readRawOwnString(params.value, "threadId") !== params.threadId) return { kind: "ignored" };
|
|
6
|
+
const snapshot = agentHarnessStructuredInput.snapshot(params.value);
|
|
7
|
+
if (!agentHarnessStructuredInput.isRecord(snapshot)) return {
|
|
8
|
+
kind: "compiled",
|
|
9
|
+
input: {
|
|
10
|
+
kind: "unsupported",
|
|
11
|
+
message: "OpenClaw declined a malformed or over-limit MCP elicitation request."
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const requestTurnId = readValue(snapshot, "turnId");
|
|
15
|
+
if (typeof requestTurnId === "string" && requestTurnId !== params.turnId) return { kind: "ignored" };
|
|
16
|
+
if (requestTurnId !== null && typeof requestTurnId !== "string") return {
|
|
17
|
+
kind: "compiled",
|
|
18
|
+
input: {
|
|
19
|
+
kind: "unsupported",
|
|
20
|
+
message: "OpenClaw declined an MCP elicitation with invalid turn correlation."
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const mode = readCodexElicitationString(snapshot, "mode");
|
|
24
|
+
if (mode === "url") return {
|
|
25
|
+
kind: "compiled",
|
|
26
|
+
input: agentHarnessStructuredInput.compileUrl({
|
|
27
|
+
url: readValue(snapshot, "url"),
|
|
28
|
+
elicitationId: readValue(snapshot, "elicitationId"),
|
|
29
|
+
message: readValue(snapshot, "message"),
|
|
30
|
+
fallbackMessage: "Codex provided a URL",
|
|
31
|
+
protocolName: "MCP"
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
if (mode !== "form" && mode !== "openai/form") return {
|
|
35
|
+
kind: "compiled",
|
|
36
|
+
input: {
|
|
37
|
+
kind: "unsupported",
|
|
38
|
+
message: `OpenClaw does not support MCP elicitation mode ${JSON.stringify(mode ?? "unknown")}.`
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
kind: "compiled",
|
|
43
|
+
input: agentHarnessStructuredInput.compileForm({
|
|
44
|
+
schema: readValue(snapshot, "requestedSchema"),
|
|
45
|
+
message: readCodexElicitationString(snapshot, "message"),
|
|
46
|
+
fallbackMessage: "Codex needs input",
|
|
47
|
+
options: {
|
|
48
|
+
protocolName: mode === "openai/form" ? "OpenAI" : "MCP",
|
|
49
|
+
allowEmptyForm: true,
|
|
50
|
+
minimumChoiceCount: 1,
|
|
51
|
+
allowEnumNames: true,
|
|
52
|
+
allowImagePicker: mode === "openai/form",
|
|
53
|
+
metadata: { secretPath: ["isSecret"] }
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function readValue(record, key) {
|
|
59
|
+
return Object.hasOwn(record, key) ? record[key] : void 0;
|
|
60
|
+
}
|
|
61
|
+
function readCodexElicitationString(record, key) {
|
|
62
|
+
const value = readValue(record, key);
|
|
63
|
+
return typeof value === "string" ? value : void 0;
|
|
64
|
+
}
|
|
65
|
+
function readRawOwnString(value, key) {
|
|
66
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
67
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
68
|
+
return descriptor && "value" in descriptor && typeof descriptor.value === "string" ? descriptor.value : void 0;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { compileCodexOrdinaryElicitation };
|
|
@@ -69,6 +69,23 @@ function createAssistantCommentaryMessage(params, text, itemId, timestamp) {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
+
function createAssistantAsyncMessage(params, text, itemId, timestamp) {
|
|
73
|
+
const attribution = resolveCodexLocalRuntimeAttribution(params);
|
|
74
|
+
return {
|
|
75
|
+
role: "assistant",
|
|
76
|
+
content: [{
|
|
77
|
+
type: "text",
|
|
78
|
+
text
|
|
79
|
+
}],
|
|
80
|
+
api: attribution.api ?? "openai-chatgpt-responses",
|
|
81
|
+
provider: attribution.provider,
|
|
82
|
+
model: params.modelId,
|
|
83
|
+
usage: ZERO_USAGE,
|
|
84
|
+
stopReason: "stop",
|
|
85
|
+
timestamp,
|
|
86
|
+
openclawAsyncDelivery: { itemId }
|
|
87
|
+
};
|
|
88
|
+
}
|
|
72
89
|
function createAssistantMirrorMessage(params, title, text) {
|
|
73
90
|
const attribution = resolveCodexLocalRuntimeAttribution(params);
|
|
74
91
|
return {
|
|
@@ -86,4 +103,4 @@ function createAssistantMirrorMessage(params, title, text) {
|
|
|
86
103
|
};
|
|
87
104
|
}
|
|
88
105
|
//#endregion
|
|
89
|
-
export { createAttributedCodexAssistantMessage as i,
|
|
106
|
+
export { createAttributedCodexAssistantMessage as a, createAssistantMirrorMessage as i, createAssistantCommentaryMessage as n, createAssistantMessage as r, createAssistantAsyncMessage as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { vt as isJsonObject } from "./shared-client-DKz23hHY.js";
|
|
2
|
+
import { asSafeIntegerInRange, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { normalizeUsage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
4
4
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
5
5
|
//#region extensions/codex/src/app-server/attempt-notifications.ts
|
|
@@ -61,7 +61,7 @@ function isCompletedAssistantNotification(notification) {
|
|
|
61
61
|
if (!isJsonObject(notification.params)) return false;
|
|
62
62
|
if (notification.method !== "item/completed") return false;
|
|
63
63
|
const item = isJsonObject(notification.params.item) ? notification.params.item : void 0;
|
|
64
|
-
return Boolean(item && readStringField(item, "type") === "agentMessage" && readStringField(item, "phase") !== "commentary");
|
|
64
|
+
return Boolean(item && readStringField(item, "type") === "agentMessage" && readStringField(item, "phase") !== "commentary" && readStringField(item, "delivery") !== "async");
|
|
65
65
|
}
|
|
66
66
|
/** Returns true for completed app-server reasoning items. */
|
|
67
67
|
function isReasoningItemCompletionNotification(notification) {
|
|
@@ -73,7 +73,7 @@ function isReasoningItemCompletionNotification(notification) {
|
|
|
73
73
|
function isAssistantCommentaryCompletionNotification(notification) {
|
|
74
74
|
if (!isJsonObject(notification.params) || notification.method !== "item/completed") return false;
|
|
75
75
|
const item = isJsonObject(notification.params.item) ? notification.params.item : void 0;
|
|
76
|
-
return Boolean(item && readStringField(item, "type") === "agentMessage" && readStringField(item, "phase") === "commentary");
|
|
76
|
+
return Boolean(item && readStringField(item, "type") === "agentMessage" && (readStringField(item, "phase") === "commentary" || readStringField(item, "delivery") === "async"));
|
|
77
77
|
}
|
|
78
78
|
/** Returns true for completed raw response reasoning items. */
|
|
79
79
|
function isRawReasoningCompletionNotification(notification) {
|
|
@@ -275,22 +275,22 @@ function projectCodexThreadUsageUpdate(params, currentUsage, applyUsage, emitCon
|
|
|
275
275
|
if (Object.keys(context).length > 0) emitContext(context);
|
|
276
276
|
}
|
|
277
277
|
function normalizeCodexThreadTokenUsage(record) {
|
|
278
|
-
return normalizeCodexTokenUsageBreakdown(record
|
|
278
|
+
return normalizeCodexTokenUsageBreakdown(record);
|
|
279
279
|
}
|
|
280
280
|
function normalizeCodexResponseTokenUsage(record) {
|
|
281
|
-
return normalizeCodexTokenUsageBreakdown(record
|
|
282
|
-
}
|
|
283
|
-
function normalizeCodexTokenUsageBreakdown(record
|
|
284
|
-
const
|
|
285
|
-
const
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
const
|
|
289
|
-
const
|
|
290
|
-
const
|
|
291
|
-
|
|
281
|
+
return normalizeCodexTokenUsageBreakdown(record);
|
|
282
|
+
}
|
|
283
|
+
function normalizeCodexTokenUsageBreakdown(record) {
|
|
284
|
+
const totalTokens = readTokenCount(record, "totalTokens");
|
|
285
|
+
const inputTokens = readTokenCount(record, "inputTokens");
|
|
286
|
+
const cacheRead = readTokenCount(record, "cachedInputTokens");
|
|
287
|
+
const output = readTokenCount(record, "outputTokens");
|
|
288
|
+
const reasoningTokens = readTokenCount(record, "reasoningOutputTokens");
|
|
289
|
+
const cacheWrite = record.cacheWriteInputTokens === void 0 ? 0 : readTokenCount(record, "cacheWriteInputTokens");
|
|
290
|
+
const hasCoherentInput = inputTokens !== void 0 && cacheRead !== void 0 && cacheWrite !== void 0 && cacheRead + cacheWrite <= inputTokens;
|
|
291
|
+
const hasCoherentContext = hasCoherentInput && totalTokens !== void 0 && output !== void 0 && totalTokens === inputTokens + output;
|
|
292
292
|
const usage = normalizeUsage({
|
|
293
|
-
input:
|
|
293
|
+
input: hasCoherentInput ? inputTokens - cacheRead - cacheWrite : void 0,
|
|
294
294
|
output,
|
|
295
295
|
cacheRead,
|
|
296
296
|
cacheWrite,
|
|
@@ -300,7 +300,7 @@ function normalizeCodexTokenUsageBreakdown(record, source) {
|
|
|
300
300
|
if (!usage) return;
|
|
301
301
|
return {
|
|
302
302
|
...usage,
|
|
303
|
-
contextUsage:
|
|
303
|
+
contextUsage: hasCoherentContext ? {
|
|
304
304
|
state: "available",
|
|
305
305
|
promptTokens: inputTokens,
|
|
306
306
|
totalTokens
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
2
|
+
import { completeWithPreparedSimpleCompletionModel } from "openclaw/plugin-sdk/simple-completion-runtime";
|
|
3
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
+
//#region extensions/codex/src/app-server/model-runtime.ts
|
|
5
|
+
const CODEX_APP_SERVER_RUNTIME_MODEL_PARAM = "codexAppServerRuntimeModel";
|
|
6
|
+
function buildCodexRuntimeModelParams(catalogId, runtimeModelId) {
|
|
7
|
+
return catalogId === runtimeModelId ? void 0 : { [CODEX_APP_SERVER_RUNTIME_MODEL_PARAM]: runtimeModelId };
|
|
8
|
+
}
|
|
9
|
+
function readCodexRuntimeModelId(model, fallbackId) {
|
|
10
|
+
return normalizeOptionalString(model?.params?.[CODEX_APP_SERVER_RUNTIME_MODEL_PARAM]) ?? model?.id ?? fallbackId;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region extensions/codex/harness.ts
|
|
14
|
+
const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = /* @__PURE__ */ new Set(["codex", "openai"]);
|
|
15
|
+
const SHARED_CODEX_APP_SERVER_CLIENT_DISPOSER = Symbol.for("openclaw.codexAppServerClientDisposer");
|
|
16
|
+
const CODEX_TOOL_POLICY_SAFE_DENY_NAMES = [
|
|
17
|
+
"web_fetch",
|
|
18
|
+
"x_search",
|
|
19
|
+
"memory_search",
|
|
20
|
+
"memory_get",
|
|
21
|
+
"dashboard",
|
|
22
|
+
"canvas",
|
|
23
|
+
"show_widget",
|
|
24
|
+
"message",
|
|
25
|
+
"heartbeat_respond",
|
|
26
|
+
"automations",
|
|
27
|
+
"gateway",
|
|
28
|
+
"skill_workshop",
|
|
29
|
+
"image_generate",
|
|
30
|
+
"music_generate",
|
|
31
|
+
"video_generate",
|
|
32
|
+
"tts"
|
|
33
|
+
];
|
|
34
|
+
const CODEX_APP_SERVER_CONTEXT_ENGINE_HOST_CAPABILITIES = [
|
|
35
|
+
"bootstrap",
|
|
36
|
+
"assemble-before-prompt",
|
|
37
|
+
"after-turn",
|
|
38
|
+
"maintain",
|
|
39
|
+
"compact",
|
|
40
|
+
"runtime-llm-complete",
|
|
41
|
+
"thread-bootstrap-projection"
|
|
42
|
+
];
|
|
43
|
+
async function runCodexHostPreparedIsolatedCompletion(params) {
|
|
44
|
+
const timeoutSignal = AbortSignal.timeout(params.timeoutMs);
|
|
45
|
+
const signal = params.abortSignal ? AbortSignal.any([params.abortSignal, timeoutSignal]) : timeoutSignal;
|
|
46
|
+
return { assistant: await completeWithPreparedSimpleCompletionModel({
|
|
47
|
+
model: params.model,
|
|
48
|
+
auth: params.auth,
|
|
49
|
+
cfg: params.config,
|
|
50
|
+
context: {
|
|
51
|
+
systemPrompt: params.systemPrompt,
|
|
52
|
+
messages: [{
|
|
53
|
+
role: "user",
|
|
54
|
+
content: params.prompt,
|
|
55
|
+
timestamp: Date.now()
|
|
56
|
+
}],
|
|
57
|
+
tools: []
|
|
58
|
+
},
|
|
59
|
+
options: {
|
|
60
|
+
maxTokens: params.streamParams?.maxTokens,
|
|
61
|
+
temperature: params.streamParams?.temperature,
|
|
62
|
+
reasoning: params.thinkLevel,
|
|
63
|
+
signal
|
|
64
|
+
}
|
|
65
|
+
}) };
|
|
66
|
+
}
|
|
67
|
+
async function disposeSharedCodexAppServerClients() {
|
|
68
|
+
const dispose = globalThis[SHARED_CODEX_APP_SERVER_CLIENT_DISPOSER];
|
|
69
|
+
await dispose?.();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Creates the Codex app-server harness used for attempts, side questions,
|
|
73
|
+
* compaction, reset, and disposal.
|
|
74
|
+
*/
|
|
75
|
+
function createCodexAppServerAgentHarness(options) {
|
|
76
|
+
const harnessRuntimeId = options?.id ?? "codex";
|
|
77
|
+
const normalizedHarnessRuntimeId = harnessRuntimeId.trim().toLowerCase();
|
|
78
|
+
const providerIds = new Set([...options?.providerIds ?? DEFAULT_CODEX_HARNESS_PROVIDER_IDS].map((id) => id.trim().toLowerCase()));
|
|
79
|
+
const sessionCatalogControlFactory = options.sessionCatalogControlFactory;
|
|
80
|
+
const sessionRuntime = options.runtime;
|
|
81
|
+
const resolveAttemptPluginConfig = (config) => resolvePluginConfigObject(config, "codex") ?? options.resolvePluginConfig?.() ?? options.pluginConfig;
|
|
82
|
+
return {
|
|
83
|
+
id: harnessRuntimeId,
|
|
84
|
+
label: options?.label ?? "Codex agent harness",
|
|
85
|
+
autoSelection: { providerIds: [...providerIds] },
|
|
86
|
+
cloudPlacement: {
|
|
87
|
+
mode: "remote-exec",
|
|
88
|
+
devicePlacement: {
|
|
89
|
+
requiredNodeCommands: ["codex.exec-server.stdio.v1"],
|
|
90
|
+
consumesWorkerSlot: false
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
delegatedExecutionPluginIds: ["voice-call"],
|
|
94
|
+
contextEngineHostCapabilities: CODEX_APP_SERVER_CONTEXT_ENGINE_HOST_CAPABILITIES,
|
|
95
|
+
conversationToolPolicySupport: "exact",
|
|
96
|
+
conversationToolPolicySafeDenyTools: CODEX_TOOL_POLICY_SAFE_DENY_NAMES,
|
|
97
|
+
deliveryDefaults: { visibleReplies: "message_tool" },
|
|
98
|
+
authBootstrap: "harness",
|
|
99
|
+
...sessionCatalogControlFactory && sessionRuntime ? { sessionFork: {
|
|
100
|
+
upstreamKinds: ["codex-app-server"],
|
|
101
|
+
fork: async (params) => {
|
|
102
|
+
const { forkCodexUpstreamSession } = await import("./upstream-session-fork-DlaHxSLC.js");
|
|
103
|
+
return await forkCodexUpstreamSession(params, {
|
|
104
|
+
bindingStore: options.bindingStore,
|
|
105
|
+
controlFactory: sessionCatalogControlFactory,
|
|
106
|
+
harnessRuntimeId,
|
|
107
|
+
resolveConfig: options.resolveConfig,
|
|
108
|
+
runtime: sessionRuntime
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
} } : {},
|
|
112
|
+
authBinding: { fingerprint: async (params) => {
|
|
113
|
+
const { fingerprintCodexAppServerAuthBinding } = await import("./auth-binding-B4FfbcCg.js").then((n) => n.t);
|
|
114
|
+
return fingerprintCodexAppServerAuthBinding(params);
|
|
115
|
+
} },
|
|
116
|
+
runtimeArtifact: { validate: async (binding) => {
|
|
117
|
+
const { validateCodexAppServerRuntimeArtifact } = await import("./runtime-artifact-BvyT1uyd.js");
|
|
118
|
+
return validateCodexAppServerRuntimeArtifact(binding);
|
|
119
|
+
} },
|
|
120
|
+
fetchUsageSnapshot: async (ctx) => {
|
|
121
|
+
const { fetchCodexAppServerUsageSnapshot } = await import("./usage-ROIaW3wo.js");
|
|
122
|
+
return await fetchCodexAppServerUsageSnapshot(ctx, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
|
|
123
|
+
},
|
|
124
|
+
loadModelCatalog: async (params) => {
|
|
125
|
+
const { loadCodexAppServerModelCatalog } = await import("./model-catalog-i9rNBthX.js");
|
|
126
|
+
return await loadCodexAppServerModelCatalog(params, resolveAttemptPluginConfig(params.config));
|
|
127
|
+
},
|
|
128
|
+
loadMcpToolCatalog: async (params) => {
|
|
129
|
+
const { loadCodexEffectiveMcpCatalog } = await import("./effective-mcp-catalog-CTeGrnfO.js");
|
|
130
|
+
return await loadCodexEffectiveMcpCatalog(params, { bindingStore: options.bindingStore });
|
|
131
|
+
},
|
|
132
|
+
supports: (ctx) => {
|
|
133
|
+
const provider = ctx.provider.trim().toLowerCase();
|
|
134
|
+
if (!providerIds.has(provider)) return {
|
|
135
|
+
supported: false,
|
|
136
|
+
reason: `provider is not one of: ${[...providerIds].toSorted().join(", ")}`
|
|
137
|
+
};
|
|
138
|
+
if (ctx.modelProvider?.requestTransportOverrides === "present") return {
|
|
139
|
+
supported: false,
|
|
140
|
+
reason: "Codex cannot reproduce authored request transport overrides",
|
|
141
|
+
fallbackRuntime: "openclaw"
|
|
142
|
+
};
|
|
143
|
+
const preparedAuth = ctx.modelProvider?.preparedAuth;
|
|
144
|
+
const runtimePolicy = ctx.modelProvider?.runtimePolicy;
|
|
145
|
+
const nativeAccountOwnsUnobservedModel = provider === "openai" && ctx.requestedRuntime === "codex" && Boolean(ctx.modelId?.trim()) && (preparedAuth === void 0 || preparedAuth.source === "harness") && preparedAuth?.mode === void 0 && preparedAuth?.requirement === void 0 && ctx.modelProvider?.api === void 0 && ctx.modelProvider?.baseUrl === void 0 && ctx.modelProvider?.azureApiVersion === void 0 && ctx.modelProvider?.request === void 0;
|
|
146
|
+
if (runtimePolicy) {
|
|
147
|
+
if (!runtimePolicy.compatibleIds.some((id) => id.trim().toLowerCase() === normalizedHarnessRuntimeId)) return {
|
|
148
|
+
supported: false,
|
|
149
|
+
reason: "Codex cannot reproduce the prepared provider route"
|
|
150
|
+
};
|
|
151
|
+
} else if (ctx.modelProvider && provider !== "codex" && !nativeAccountOwnsUnobservedModel) return {
|
|
152
|
+
supported: false,
|
|
153
|
+
reason: "provider route compatibility with Codex is not declared"
|
|
154
|
+
};
|
|
155
|
+
if (preparedAuth?.requirement === "subscription") {
|
|
156
|
+
if (!(preparedAuth.source === "profile" && (preparedAuth.mode === "oauth" || preparedAuth.mode === "token"))) return {
|
|
157
|
+
supported: false,
|
|
158
|
+
reason: "Codex subscription auth requires a prepared OAuth or token profile"
|
|
159
|
+
};
|
|
160
|
+
} else if (preparedAuth?.requirement === "api-key") {
|
|
161
|
+
if (!(preparedAuth.source !== "none" && preparedAuth.source !== "harness" && (preparedAuth.mode === "api-key" || preparedAuth.mode === "api_key"))) return {
|
|
162
|
+
supported: false,
|
|
163
|
+
reason: "Codex Platform auth requires a prepared API key"
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
supported: true,
|
|
168
|
+
priority: 100
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
runAttempt: async (params) => {
|
|
172
|
+
const { runCodexAppServerAttempt } = await import("./run-attempt-DYc0QCBF.js");
|
|
173
|
+
return runCodexAppServerAttempt(params, {
|
|
174
|
+
bindingStore: options.bindingStore,
|
|
175
|
+
pluginConfig: resolveAttemptPluginConfig(params.config),
|
|
176
|
+
runtime: sessionRuntime,
|
|
177
|
+
runtimeModelId: readCodexRuntimeModelId(params.model, params.modelId),
|
|
178
|
+
nativeHookRelay: { enabled: true }
|
|
179
|
+
});
|
|
180
|
+
},
|
|
181
|
+
runIsolatedCompletionV2: async (params) => {
|
|
182
|
+
if (params.authorization.owner === "host") {
|
|
183
|
+
const { authorization, ...commonParams } = params;
|
|
184
|
+
return runCodexHostPreparedIsolatedCompletion({
|
|
185
|
+
...commonParams,
|
|
186
|
+
model: authorization.model,
|
|
187
|
+
auth: authorization.auth,
|
|
188
|
+
...authorization.sourceAuthFingerprint ? { sourceAuthFingerprint: authorization.sourceAuthFingerprint } : {}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
const { runCodexIsolatedCompletion } = await import("./isolated-completion-Cv6FqygM.js");
|
|
192
|
+
return runCodexIsolatedCompletion(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
|
|
193
|
+
},
|
|
194
|
+
runIsolatedCompletion: async (params) => {
|
|
195
|
+
return runCodexHostPreparedIsolatedCompletion(params);
|
|
196
|
+
},
|
|
197
|
+
finalizeSettledTurn: async (params) => {
|
|
198
|
+
const { runCodexSettledTurnFinalization } = await import("./settled-turn-finalizer-Dc3ApjU4.js");
|
|
199
|
+
return runCodexSettledTurnFinalization(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
|
|
200
|
+
},
|
|
201
|
+
runSideQuestion: async (params) => {
|
|
202
|
+
const { runCodexAppServerSideQuestion } = await import("./side-question-DjA_jsNe.js");
|
|
203
|
+
return runCodexAppServerSideQuestion(params, {
|
|
204
|
+
bindingStore: options.bindingStore,
|
|
205
|
+
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
206
|
+
runtime: sessionRuntime,
|
|
207
|
+
runtimeModelId: readCodexRuntimeModelId(params.runtimeModel, params.model),
|
|
208
|
+
nativeHookRelay: { enabled: true }
|
|
209
|
+
});
|
|
210
|
+
},
|
|
211
|
+
compact: async (params) => {
|
|
212
|
+
const { maybeCompactCodexAppServerSession } = await import("./compact-BglNFZrQ.js");
|
|
213
|
+
return maybeCompactCodexAppServerSession(params, {
|
|
214
|
+
bindingStore: options.bindingStore,
|
|
215
|
+
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
reset: async (params) => {
|
|
219
|
+
if (params.sessionId) {
|
|
220
|
+
const [{ reclaimCurrentCodexSessionGeneration, sessionBindingIdentity }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./session-binding-Bcynfd-_.js").then((n) => n.f), import("./session-retirement-CcNC3YSY.js")]);
|
|
221
|
+
const identity = sessionBindingIdentity({
|
|
222
|
+
agentId: params.agentId,
|
|
223
|
+
sessionId: params.sessionId,
|
|
224
|
+
sessionKey: params.sessionKey
|
|
225
|
+
});
|
|
226
|
+
const resetGeneration = () => retireCodexAppServerSessionGeneration({
|
|
227
|
+
bindingStore: options.bindingStore,
|
|
228
|
+
identity,
|
|
229
|
+
mode: params.reason === "deleted" ? "retire" : "reset"
|
|
230
|
+
});
|
|
231
|
+
let reset = await resetGeneration();
|
|
232
|
+
if (reset === "conflict") {
|
|
233
|
+
if (await reclaimCurrentCodexSessionGeneration({
|
|
234
|
+
bindingStore: options.bindingStore,
|
|
235
|
+
identity,
|
|
236
|
+
config: options.resolveConfig?.()
|
|
237
|
+
})) reset = await resetGeneration();
|
|
238
|
+
}
|
|
239
|
+
if (reset === "conflict") throw new Error(`Codex binding generation changed before session ${params.sessionId} could reset`);
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
dispose: disposeSharedCodexAppServerClients
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/** Creates the private native-compaction bridge registered in host-owned capability state. */
|
|
246
|
+
function createCodexAppServerNativeCompaction(options) {
|
|
247
|
+
return async (params) => {
|
|
248
|
+
const { maybeCompactCodexAppServerSession } = await import("./compact-BglNFZrQ.js");
|
|
249
|
+
return maybeCompactCodexAppServerSession(params, {
|
|
250
|
+
bindingStore: options.bindingStore,
|
|
251
|
+
pluginConfig: options.resolvePluginConfig?.() ?? options.pluginConfig,
|
|
252
|
+
allowNonManualNativeRequest: true,
|
|
253
|
+
nativeCompactionRequest: params.nativeCompactionRequest
|
|
254
|
+
});
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
export { createCodexAppServerNativeCompaction as n, buildCodexRuntimeModelParams as r, createCodexAppServerAgentHarness as t };
|
package/dist/harness.js
CHANGED
|
@@ -1,226 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = /* @__PURE__ */ new Set(["codex", "openai"]);
|
|
4
|
-
const SHARED_CODEX_APP_SERVER_CLIENT_DISPOSER = Symbol.for("openclaw.codexAppServerClientDisposer");
|
|
5
|
-
const CODEX_TOOL_POLICY_SAFE_DENY_NAMES = [
|
|
6
|
-
"web_fetch",
|
|
7
|
-
"x_search",
|
|
8
|
-
"memory_search",
|
|
9
|
-
"memory_get",
|
|
10
|
-
"dashboard",
|
|
11
|
-
"canvas",
|
|
12
|
-
"show_widget",
|
|
13
|
-
"message",
|
|
14
|
-
"heartbeat_respond",
|
|
15
|
-
"automations",
|
|
16
|
-
"gateway",
|
|
17
|
-
"skill_workshop",
|
|
18
|
-
"music_generate",
|
|
19
|
-
"video_generate",
|
|
20
|
-
"tts"
|
|
21
|
-
];
|
|
22
|
-
const CODEX_APP_SERVER_CONTEXT_ENGINE_HOST_CAPABILITIES = [
|
|
23
|
-
"bootstrap",
|
|
24
|
-
"assemble-before-prompt",
|
|
25
|
-
"after-turn",
|
|
26
|
-
"maintain",
|
|
27
|
-
"compact",
|
|
28
|
-
"runtime-llm-complete",
|
|
29
|
-
"thread-bootstrap-projection"
|
|
30
|
-
];
|
|
31
|
-
async function runCodexHostPreparedIsolatedCompletion(params) {
|
|
32
|
-
const timeoutSignal = AbortSignal.timeout(params.timeoutMs);
|
|
33
|
-
const signal = params.abortSignal ? AbortSignal.any([params.abortSignal, timeoutSignal]) : timeoutSignal;
|
|
34
|
-
return { assistant: await completeWithPreparedSimpleCompletionModel({
|
|
35
|
-
model: params.model,
|
|
36
|
-
auth: params.auth,
|
|
37
|
-
cfg: params.config,
|
|
38
|
-
context: {
|
|
39
|
-
systemPrompt: params.systemPrompt,
|
|
40
|
-
messages: [{
|
|
41
|
-
role: "user",
|
|
42
|
-
content: params.prompt,
|
|
43
|
-
timestamp: Date.now()
|
|
44
|
-
}],
|
|
45
|
-
tools: []
|
|
46
|
-
},
|
|
47
|
-
options: {
|
|
48
|
-
maxTokens: params.streamParams?.maxTokens,
|
|
49
|
-
temperature: params.streamParams?.temperature,
|
|
50
|
-
reasoning: params.thinkLevel,
|
|
51
|
-
signal
|
|
52
|
-
}
|
|
53
|
-
}) };
|
|
54
|
-
}
|
|
55
|
-
async function disposeSharedCodexAppServerClients() {
|
|
56
|
-
const dispose = globalThis[SHARED_CODEX_APP_SERVER_CLIENT_DISPOSER];
|
|
57
|
-
await dispose?.();
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Creates the Codex app-server harness used for attempts, side questions,
|
|
61
|
-
* compaction, reset, and disposal.
|
|
62
|
-
*/
|
|
63
|
-
function createCodexAppServerAgentHarness(options) {
|
|
64
|
-
const harnessRuntimeId = options?.id ?? "codex";
|
|
65
|
-
const normalizedHarnessRuntimeId = harnessRuntimeId.trim().toLowerCase();
|
|
66
|
-
const providerIds = new Set([...options?.providerIds ?? DEFAULT_CODEX_HARNESS_PROVIDER_IDS].map((id) => id.trim().toLowerCase()));
|
|
67
|
-
const sessionCatalogControl = options.sessionCatalogControl;
|
|
68
|
-
const sessionRuntime = options.runtime;
|
|
69
|
-
return {
|
|
70
|
-
id: harnessRuntimeId,
|
|
71
|
-
label: options?.label ?? "Codex agent harness",
|
|
72
|
-
autoSelection: { providerIds: [...providerIds] },
|
|
73
|
-
cloudPlacement: { mode: "remote-exec" },
|
|
74
|
-
delegatedExecutionPluginIds: ["voice-call"],
|
|
75
|
-
contextEngineHostCapabilities: CODEX_APP_SERVER_CONTEXT_ENGINE_HOST_CAPABILITIES,
|
|
76
|
-
conversationToolPolicySupport: "exact",
|
|
77
|
-
conversationToolPolicySafeDenyTools: CODEX_TOOL_POLICY_SAFE_DENY_NAMES,
|
|
78
|
-
deliveryDefaults: { visibleReplies: "message_tool" },
|
|
79
|
-
authBootstrap: "harness",
|
|
80
|
-
...sessionCatalogControl && sessionRuntime ? { sessionFork: {
|
|
81
|
-
upstreamKinds: ["codex-app-server"],
|
|
82
|
-
fork: async (params) => {
|
|
83
|
-
const { forkCodexUpstreamSession } = await import("./upstream-session-fork-CE-_LdnP.js");
|
|
84
|
-
return await forkCodexUpstreamSession(params, {
|
|
85
|
-
bindingStore: options.bindingStore,
|
|
86
|
-
control: sessionCatalogControl,
|
|
87
|
-
harnessRuntimeId,
|
|
88
|
-
resolveConfig: options.resolveConfig,
|
|
89
|
-
runtime: sessionRuntime
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
} } : {},
|
|
93
|
-
authBinding: { fingerprint: async (params) => {
|
|
94
|
-
const { fingerprintCodexAppServerAuthBinding } = await import("./auth-binding-B4FfbcCg.js").then((n) => n.t);
|
|
95
|
-
return fingerprintCodexAppServerAuthBinding(params);
|
|
96
|
-
} },
|
|
97
|
-
runtimeArtifact: { validate: async (binding) => {
|
|
98
|
-
const { validateCodexAppServerRuntimeArtifact } = await import("./runtime-artifact-BVSPdd6g.js");
|
|
99
|
-
return validateCodexAppServerRuntimeArtifact(binding);
|
|
100
|
-
} },
|
|
101
|
-
fetchUsageSnapshot: async (ctx) => {
|
|
102
|
-
const { fetchCodexAppServerUsageSnapshot } = await import("./usage-CHlV0e-o.js");
|
|
103
|
-
return await fetchCodexAppServerUsageSnapshot(ctx, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
|
|
104
|
-
},
|
|
105
|
-
loadMcpToolCatalog: async (params) => {
|
|
106
|
-
const { loadCodexEffectiveMcpCatalog } = await import("./effective-mcp-catalog-DIIhAtOZ.js");
|
|
107
|
-
return await loadCodexEffectiveMcpCatalog(params, { bindingStore: options.bindingStore });
|
|
108
|
-
},
|
|
109
|
-
supports: (ctx) => {
|
|
110
|
-
const provider = ctx.provider.trim().toLowerCase();
|
|
111
|
-
if (!providerIds.has(provider)) return {
|
|
112
|
-
supported: false,
|
|
113
|
-
reason: `provider is not one of: ${[...providerIds].toSorted().join(", ")}`
|
|
114
|
-
};
|
|
115
|
-
if (ctx.modelProvider?.requestTransportOverrides === "present") return {
|
|
116
|
-
supported: false,
|
|
117
|
-
reason: "Codex cannot reproduce authored request transport overrides",
|
|
118
|
-
fallbackRuntime: "openclaw"
|
|
119
|
-
};
|
|
120
|
-
const preparedAuth = ctx.modelProvider?.preparedAuth;
|
|
121
|
-
const runtimePolicy = ctx.modelProvider?.runtimePolicy;
|
|
122
|
-
if (runtimePolicy) {
|
|
123
|
-
if (!runtimePolicy.compatibleIds.some((id) => id.trim().toLowerCase() === normalizedHarnessRuntimeId)) return {
|
|
124
|
-
supported: false,
|
|
125
|
-
reason: "Codex cannot reproduce the prepared provider route"
|
|
126
|
-
};
|
|
127
|
-
} else if (ctx.modelProvider && provider !== "codex") return {
|
|
128
|
-
supported: false,
|
|
129
|
-
reason: "provider route compatibility with Codex is not declared"
|
|
130
|
-
};
|
|
131
|
-
if (preparedAuth?.requirement === "subscription") {
|
|
132
|
-
if (!(preparedAuth.source === "profile" && (preparedAuth.mode === "oauth" || preparedAuth.mode === "token"))) return {
|
|
133
|
-
supported: false,
|
|
134
|
-
reason: "Codex subscription auth requires a prepared OAuth or token profile"
|
|
135
|
-
};
|
|
136
|
-
} else if (preparedAuth?.requirement === "api-key") {
|
|
137
|
-
if (!(preparedAuth.source !== "none" && preparedAuth.source !== "harness" && (preparedAuth.mode === "api-key" || preparedAuth.mode === "api_key"))) return {
|
|
138
|
-
supported: false,
|
|
139
|
-
reason: "Codex Platform auth requires a prepared API key"
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
return {
|
|
143
|
-
supported: true,
|
|
144
|
-
priority: 100
|
|
145
|
-
};
|
|
146
|
-
},
|
|
147
|
-
runAttempt: async (params) => {
|
|
148
|
-
const { runCodexAppServerAttempt } = await import("./run-attempt-P8BdxC1I.js");
|
|
149
|
-
return runCodexAppServerAttempt(params, {
|
|
150
|
-
bindingStore: options.bindingStore,
|
|
151
|
-
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
152
|
-
nativeHookRelay: { enabled: true }
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
runIsolatedCompletionV2: async (params) => {
|
|
156
|
-
if (params.authorization.owner === "host") {
|
|
157
|
-
const { authorization, ...commonParams } = params;
|
|
158
|
-
return runCodexHostPreparedIsolatedCompletion({
|
|
159
|
-
...commonParams,
|
|
160
|
-
model: authorization.model,
|
|
161
|
-
auth: authorization.auth,
|
|
162
|
-
...authorization.sourceAuthFingerprint ? { sourceAuthFingerprint: authorization.sourceAuthFingerprint } : {}
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
const { runCodexIsolatedCompletion } = await import("./isolated-completion-C58NbL40.js");
|
|
166
|
-
return runCodexIsolatedCompletion(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
|
|
167
|
-
},
|
|
168
|
-
runIsolatedCompletion: async (params) => {
|
|
169
|
-
return runCodexHostPreparedIsolatedCompletion(params);
|
|
170
|
-
},
|
|
171
|
-
finalizeSettledTurn: async (params) => {
|
|
172
|
-
const { runCodexSettledTurnFinalization } = await import("./settled-turn-finalizer-BRWBO4MO.js");
|
|
173
|
-
return runCodexSettledTurnFinalization(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
|
|
174
|
-
},
|
|
175
|
-
runSideQuestion: async (params) => {
|
|
176
|
-
const { runCodexAppServerSideQuestion } = await import("./side-question-9HAL26l9.js");
|
|
177
|
-
return runCodexAppServerSideQuestion(params, {
|
|
178
|
-
bindingStore: options.bindingStore,
|
|
179
|
-
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
180
|
-
nativeHookRelay: { enabled: true }
|
|
181
|
-
});
|
|
182
|
-
},
|
|
183
|
-
compact: async (params) => {
|
|
184
|
-
const { maybeCompactCodexAppServerSession } = await import("./compact-LspQaGfl.js");
|
|
185
|
-
return maybeCompactCodexAppServerSession(params, {
|
|
186
|
-
bindingStore: options.bindingStore,
|
|
187
|
-
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig
|
|
188
|
-
});
|
|
189
|
-
},
|
|
190
|
-
compactAfterContextEngine: async (params) => {
|
|
191
|
-
const { maybeCompactCodexAppServerSession } = await import("./compact-LspQaGfl.js");
|
|
192
|
-
return maybeCompactCodexAppServerSession(params, {
|
|
193
|
-
bindingStore: options.bindingStore,
|
|
194
|
-
pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
|
|
195
|
-
allowNonManualNativeRequest: true
|
|
196
|
-
});
|
|
197
|
-
},
|
|
198
|
-
reset: async (params) => {
|
|
199
|
-
if (params.sessionId) {
|
|
200
|
-
const [{ reclaimCurrentCodexSessionGeneration, sessionBindingIdentity }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./session-binding-DPxIvMgE.js").then((n) => n.f), import("./session-retirement-DoMMJFKm.js")]);
|
|
201
|
-
const identity = sessionBindingIdentity({
|
|
202
|
-
agentId: params.agentId,
|
|
203
|
-
sessionId: params.sessionId,
|
|
204
|
-
sessionKey: params.sessionKey
|
|
205
|
-
});
|
|
206
|
-
const resetGeneration = () => retireCodexAppServerSessionGeneration({
|
|
207
|
-
bindingStore: options.bindingStore,
|
|
208
|
-
identity,
|
|
209
|
-
mode: params.reason === "deleted" ? "retire" : "reset"
|
|
210
|
-
});
|
|
211
|
-
let reset = await resetGeneration();
|
|
212
|
-
if (reset === "conflict") {
|
|
213
|
-
if (await reclaimCurrentCodexSessionGeneration({
|
|
214
|
-
bindingStore: options.bindingStore,
|
|
215
|
-
identity,
|
|
216
|
-
config: options.resolveConfig?.()
|
|
217
|
-
})) reset = await resetGeneration();
|
|
218
|
-
}
|
|
219
|
-
if (reset === "conflict") throw new Error(`Codex binding generation changed before session ${params.sessionId} could reset`);
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
dispose: disposeSharedCodexAppServerClients
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
//#endregion
|
|
226
|
-
export { createCodexAppServerAgentHarness };
|
|
1
|
+
import { n as createCodexAppServerNativeCompaction, t as createCodexAppServerAgentHarness } from "./harness-Csz0F-DK.js";
|
|
2
|
+
export { createCodexAppServerAgentHarness, createCodexAppServerNativeCompaction };
|