@openclaw/codex 2026.9.2 → 2026.9.3

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.
Files changed (108) hide show
  1. package/README.md +2 -0
  2. package/dist/api.js +14 -19
  3. package/dist/apply-B6el6hdO.js +357 -0
  4. package/dist/{attempt-client-cleanup-Bp1ZOnk2.js → attempt-client-cleanup-D6cR54TV.js} +39 -19
  5. package/dist/{attempt-context-CSazkWns.js → attempt-context-AO4DSjE0.js} +8 -6
  6. package/dist/{event-projector-usage-ZqEVbAEY.js → attempt-notifications--H8zXR5-.js} +3 -106
  7. package/dist/auth-cache-key-Kq6oerr6.js +498 -0
  8. package/dist/auth-profile-CwzO4_RG.js +43 -0
  9. package/dist/auth-profile-selection-DFu9e167.js +45 -0
  10. package/dist/binding-connection-QqgcPCgk.js +60 -0
  11. package/dist/{bounded-turn-DxGJRYbY.js → bounded-turn-lRpmZHFv.js} +25 -122
  12. package/dist/build-state-6RL6qohz.js +19 -0
  13. package/dist/{capabilities-B1mgvpP8.js → capabilities-BeqLPbtM.js} +1 -1
  14. package/dist/cli-metadata.js +1 -1
  15. package/dist/client-BEKu4yDx.js +3983 -0
  16. package/dist/command-dispatch-CisT9Jqq.js +21 -0
  17. package/dist/{command-formatters-DSbGMXA0.js → command-formatters-DeTfrapr.js} +2 -2
  18. package/dist/{command-handlers-DOJvGv6-.js → command-handlers-BfIsJEuA.js} +31 -21
  19. package/dist/command-rpc-BMqRQOFX.js +226 -0
  20. package/dist/{compact-Y_xBqrHN.js → compact-CGJZ2rlb.js} +19 -14
  21. package/dist/config-JDfTI4VI.js +106 -0
  22. package/dist/{config-CyapYSji.js → config-options-jnIFvwxD.js} +204 -592
  23. package/dist/config-runtime-BWf6JLWG.js +11 -0
  24. package/dist/conversation-binding-CxOlHiix.js +889 -0
  25. package/dist/{plugin-marketplace-discovery-B7gHXJ3d.js → conversation-control-CUCrSIQI.js} +10 -142
  26. package/dist/doctor-contract-api.js +5 -5
  27. package/dist/{dynamic-tools-BwpvTxaX.js → dynamic-tools-D-JBoaLt.js} +66 -70
  28. package/dist/{effective-mcp-catalog-CY9Jn4bA.js → effective-mcp-catalog-J_5Ep5Um.js} +3 -3
  29. package/dist/{elicitation-input-DMkeki8d.js → elicitation-input-DPoK8F7w.js} +8 -22
  30. package/dist/ephemeral-turn-DSwzP8YY.js +101 -0
  31. package/dist/{event-projector-assistant-message-B9kp6iGC.js → event-projector-assistant-message-BmBM4qBV.js} +12 -25
  32. package/dist/event-projector-usage-CIyrYYid.js +102 -0
  33. package/dist/{harness-Czh2Sdoc.js → harness-FR6eQgyO.js} +31 -24
  34. package/dist/harness.js +1 -1
  35. package/dist/history-rejection-B4nOXNXF.js +13 -0
  36. package/dist/incognito-session-uhrBF6wJ.js +15 -0
  37. package/dist/index.js +411 -2875
  38. package/dist/{isolated-completion-CRh-51AK.js → isolated-completion-DHBefrzg.js} +7 -4
  39. package/dist/launch-args-RXQwn8zV.js +90 -0
  40. package/dist/{managed-binary-DcpnJF9x.js → managed-binary-DrjjRRUD.js} +4 -103
  41. package/dist/managed-thread-store-D1t5jh3G.js +66 -0
  42. package/dist/media-understanding-provider.js +4 -1
  43. package/dist/{model-catalog-DT5vo6qo.js → model-catalog-B_6M04Wo.js} +6 -5
  44. package/dist/{models-CcrgSMQR.js → models-P9k2qAof.js} +3 -3
  45. package/dist/native-execution-policy-umd0tgh4.js +128 -0
  46. package/dist/{native-subagent-monitor-B3bvQGcg.js → native-subagent-monitor-BbCUKRwC.js} +69 -42
  47. package/dist/node-cli-sessions-rj0ysJwM.js +527 -0
  48. package/dist/{node-exec-server.runtime-nfbUOtUB.js → node-exec-server.runtime-BY_ctYnT.js} +53 -22
  49. package/dist/plan-BMJdMOEF.js +711 -0
  50. package/dist/plugin-activation-BQK-f5sV.js +133 -0
  51. package/dist/{thread-resume-BLgqkUc1.js → plugin-app-cache-key-CdSQzWyX.js} +4 -52
  52. package/dist/{plugin-approval-roundtrip-aQVdyL5g.js → plugin-approval-roundtrip-DeW95wB5.js} +1 -1
  53. package/dist/plugin-inventory-CoRCzWW4.js +325 -0
  54. package/dist/plugin-marketplace-discovery-3akBizzF.js +134 -0
  55. package/dist/{plugin-metadata-cache-BwCLTY_U.js → plugin-metadata-cache-DgNfRAGA.js} +13 -9
  56. package/dist/protocol-CAAcVIKF.js +275 -0
  57. package/dist/{provider-capabilities-BpG9Ltc5.js → provider-capabilities-W4tfK5Y5.js} +2 -2
  58. package/dist/{rate-limits-Fx_l4eNa.js → rate-limits-Bqnx1N4z.js} +1 -1
  59. package/dist/request-CGvGOpeR.js +198 -0
  60. package/dist/{run-attempt-BzthFQSM.js → run-attempt-DwKds3DN.js} +589 -373
  61. package/dist/{runtime-artifact-Bh_gf6-t.js → runtime-artifact-T-NwqeSH.js} +27 -27
  62. package/dist/sandbox-guard-BcT66fWy.js +165 -0
  63. package/dist/{session-binding-4Ki04sW-.js → session-binding-CKSepwIC.js} +29 -47
  64. package/dist/{session-binding-record-CyaXZvTe.js → session-binding-record-CaZjYwNS.js} +11 -25
  65. package/dist/session-catalog-HaDcp7Sv.js +1533 -0
  66. package/dist/session-catalog-adoption-BKLtSrwi.js +251 -0
  67. package/dist/session-catalog-archive-D0i2pGj2.js +56 -0
  68. package/dist/session-catalog-home-id-D7-aLiNt.js +190 -0
  69. package/dist/session-catalog-node-adoption-BUuDYY8R.js +182 -0
  70. package/dist/session-catalog-node-continue-CBtc4wkI.js +238 -0
  71. package/dist/session-catalog-parsing-CdD3JhdM.js +280 -0
  72. package/dist/session-catalog-provenance-DkJHo735.js +124 -0
  73. package/dist/{session-cli-BjLhpmS1.js → session-cli-CbgaHh0f.js} +3 -2
  74. package/dist/{session-history-DWmMqiqW.js → session-history-Cz-tOOYj.js} +6 -3
  75. package/dist/{session-upstream-marker-DReTpGz6.js → session-history-import-DFN7sWRU.js} +5 -50
  76. package/dist/{session-history-read-LHldwvyh.js → session-history-read-cxPUxyVV.js} +21 -7
  77. package/dist/session-history-worker-runtime.js +18 -6
  78. package/dist/{session-history.worker-zZVcx0ME.js → session-history.worker-CNEvGaU5.js} +58 -51
  79. package/dist/session-history.worker.js +1 -1
  80. package/dist/{session-initialization-BCFVnLL4.js → session-initialization-Jo86C60I.js} +2 -2
  81. package/dist/{session-permission-policy-BaueHmSj.js → session-permission-policy-B22InTp_.js} +4 -7
  82. package/dist/{session-retirement-DNdmYdFc.js → session-retirement-BSNG_mhf.js} +6 -5
  83. package/dist/session-upstream-marker-D15C9NHp.js +46 -0
  84. package/dist/{settled-turn-context-BOM3Y1pl.js → settled-turn-context-Du6gdUDd.js} +9 -9
  85. package/dist/{settled-turn-finalizer-BI-b1sry.js → settled-turn-finalizer-BuLUrZl2.js} +7 -6
  86. package/dist/shared-client-CVhez2Uo.js +2911 -0
  87. package/dist/{side-question-B6DWAw1A.js → side-question-DLbr2vUU.js} +64 -169
  88. package/dist/source-Da-h6f7e.js +518 -0
  89. package/dist/thread-archive-guard-D1bP04Tf.js +53 -0
  90. package/dist/{thread-lifecycle-DPK30jad.js → thread-lifecycle-D1pzRwHB.js} +112 -616
  91. package/dist/{thread-ownership-CbucAmmp.js → thread-ownership-D6oASVRu.js} +13 -15
  92. package/dist/thread-policy-D8kI7yAO.js +54 -0
  93. package/dist/thread-resume-T5cveyxA.js +52 -0
  94. package/dist/timeout-BVw8aaM1.js +33 -0
  95. package/dist/{transcript-mirror-attestation-Byl34PC-.js → transcript-mirror-attestation-DibE0krH.js} +17 -4
  96. package/dist/{transcript-mirror-_njEB84z.js → transcript-mirror-t5TOccct.js} +50 -260
  97. package/dist/{transport-stdio-CzTngV0j.js → transport-stdio-BGjHoYLr.js} +73 -43
  98. package/dist/{upstream-session-fork-1fwbNKzQ.js → upstream-session-fork-De-sLJ2r.js} +26 -18
  99. package/dist/{usage-i9fv5-4m.js → usage-CPPTmBvZ.js} +4 -3
  100. package/dist/version-omm6IPI3.js +12 -0
  101. package/dist/{web-search-provider.runtime-DKQn67A7.js → web-search-provider.runtime-CSVgQL0w.js} +3 -3
  102. package/openclaw.plugin.json +22 -1
  103. package/package.json +4 -4
  104. package/dist/request-C8H22rPi.js +0 -475
  105. package/dist/session-catalog-B47uwekb.js +0 -3272
  106. package/dist/shared-client-CKhX2kFt.js +0 -7505
  107. package/dist/thread-policy-CTalhWFy.js +0 -105
  108. package/dist/{auth-binding-Ds_QVm-X.js → auth-binding-Co2Vfcf_.js} +1 -1
@@ -58,19 +58,11 @@ function createAttributedCodexAssistantMessage(attribution, text, options) {
58
58
  };
59
59
  }
60
60
  function createAssistantCommentaryMessage(params, text, itemId, timestamp) {
61
- const attribution = resolveCodexLocalRuntimeAttribution(params);
62
61
  return {
63
- role: "assistant",
64
- content: [{
62
+ ...createNonterminalAssistantMessage(params, [{
65
63
  type: "text",
66
64
  text
67
- }],
68
- api: attribution.api ?? "openai-chatgpt-responses",
69
- provider: attribution.provider,
70
- model: params.modelId,
71
- usage: ZERO_USAGE,
72
- stopReason: "stop",
73
- timestamp,
65
+ }], timestamp),
74
66
  openclawStreamFallback: {
75
67
  replacementText: text,
76
68
  source: "segment",
@@ -79,36 +71,31 @@ function createAssistantCommentaryMessage(params, text, itemId, timestamp) {
79
71
  };
80
72
  }
81
73
  function createAssistantAsyncMessage(params, text, itemId, timestamp) {
82
- const attribution = resolveCodexLocalRuntimeAttribution(params);
83
74
  return {
84
- role: "assistant",
85
- content: [{
75
+ ...createNonterminalAssistantMessage(params, [{
86
76
  type: "text",
87
77
  text
88
- }],
89
- api: attribution.api ?? "openai-chatgpt-responses",
90
- provider: attribution.provider,
91
- model: params.modelId,
92
- usage: ZERO_USAGE,
93
- stopReason: "stop",
94
- timestamp,
78
+ }], timestamp),
95
79
  openclawAsyncDelivery: { itemId }
96
80
  };
97
81
  }
98
82
  function createAssistantReasoningMessage(params, text) {
83
+ return createNonterminalAssistantMessage(params, [{
84
+ type: "thinking",
85
+ thinking: text
86
+ }]);
87
+ }
88
+ function createNonterminalAssistantMessage(params, content, timestamp) {
99
89
  const attribution = resolveCodexLocalRuntimeAttribution(params);
100
90
  return {
101
91
  role: "assistant",
102
- content: [{
103
- type: "thinking",
104
- thinking: text
105
- }],
92
+ content,
106
93
  api: attribution.api ?? "openai-chatgpt-responses",
107
94
  provider: attribution.provider,
108
95
  model: params.modelId,
109
96
  usage: ZERO_USAGE,
110
97
  stopReason: "stop",
111
- timestamp: Date.now()
98
+ timestamp: timestamp ?? Date.now()
112
99
  };
113
100
  }
114
101
  //#endregion
@@ -0,0 +1,102 @@
1
+ import { o as isJsonObject } from "./protocol-CAAcVIKF.js";
2
+ import { asSafeIntegerInRange, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
3
+ import { normalizeUsage } from "openclaw/plugin-sdk/agent-harness-runtime";
4
+ //#region extensions/codex/src/app-server/event-projector-usage.ts
5
+ function readTokenCount(record, key) {
6
+ return asSafeIntegerInRange(record[key], { min: 0 });
7
+ }
8
+ function readCodexThreadTokenUsage(params) {
9
+ const tokenUsage = isJsonObject(params.tokenUsage) ? params.tokenUsage : void 0;
10
+ const last = tokenUsage && isJsonObject(tokenUsage.last) ? tokenUsage.last : void 0;
11
+ return last ? normalizeCodexResponseTokenUsage(last) : void 0;
12
+ }
13
+ function readCodexThreadContextSnapshot(params) {
14
+ const tokenUsage = isJsonObject(params.tokenUsage) ? params.tokenUsage : void 0;
15
+ const last = tokenUsage && isJsonObject(tokenUsage.last) ? tokenUsage.last : void 0;
16
+ const modelContextWindow = tokenUsage ? readTokenCount(tokenUsage, "modelContextWindow") : void 0;
17
+ const activeContextTokens = last ? readTokenCount(last, "totalTokens") : void 0;
18
+ const inputTokens = last ? readTokenCount(last, "inputTokens") : void 0;
19
+ const cachedInputTokens = last ? readTokenCount(last, "cachedInputTokens") : void 0;
20
+ const cacheWriteInputTokens = last ? readTokenCount(last, "cacheWriteInputTokens") : void 0;
21
+ const reasoningOutputTokens = last ? readTokenCount(last, "reasoningOutputTokens") : void 0;
22
+ return {
23
+ ...activeContextTokens !== void 0 ? { activeContextTokens } : {},
24
+ ...cachedInputTokens !== void 0 ? { cachedInputTokens } : {},
25
+ ...cacheWriteInputTokens !== void 0 ? { cacheWriteInputTokens } : {},
26
+ ...inputTokens !== void 0 ? { inputTokens } : {},
27
+ ...modelContextWindow && modelContextWindow > 0 ? { modelContextWindow } : {},
28
+ ...inputTokens !== void 0 ? { promptTokens: inputTokens } : {},
29
+ ...reasoningOutputTokens !== void 0 ? { reasoningOutputTokens } : {}
30
+ };
31
+ }
32
+ function normalizeCodexResponseTokenUsage(record) {
33
+ const totalTokens = readTokenCount(record, "totalTokens");
34
+ const inputTokens = readTokenCount(record, "inputTokens");
35
+ const cacheRead = readTokenCount(record, "cachedInputTokens");
36
+ const output = readTokenCount(record, "outputTokens");
37
+ const reasoningTokens = readTokenCount(record, "reasoningOutputTokens");
38
+ const cacheWrite = record.cacheWriteInputTokens === void 0 ? 0 : readTokenCount(record, "cacheWriteInputTokens");
39
+ const hasCoherentInput = inputTokens !== void 0 && cacheRead !== void 0 && cacheWrite !== void 0 && cacheRead + cacheWrite <= inputTokens;
40
+ const hasCoherentContext = hasCoherentInput && totalTokens !== void 0 && output !== void 0 && totalTokens === inputTokens + output;
41
+ const usage = normalizeUsage({
42
+ input: hasCoherentInput ? inputTokens - cacheRead - cacheWrite : void 0,
43
+ output,
44
+ cacheRead,
45
+ cacheWrite,
46
+ reasoningTokens,
47
+ total: totalTokens
48
+ });
49
+ if (!usage) return;
50
+ return {
51
+ ...usage,
52
+ contextUsage: hasCoherentContext ? {
53
+ state: "available",
54
+ promptTokens: inputTokens,
55
+ totalTokens
56
+ } : { state: "unavailable" }
57
+ };
58
+ }
59
+ var CodexUsageProjection = class {
60
+ constructor() {
61
+ this.responseIds = /* @__PURE__ */ new Set();
62
+ }
63
+ get usage() {
64
+ const usage = this.responseUsage ?? this.threadUsage;
65
+ return usage ? {
66
+ ...usage,
67
+ contextUsage: this.contextUsage
68
+ } : void 0;
69
+ }
70
+ get modelIterations() {
71
+ return this.responseIds.size;
72
+ }
73
+ invalidateContext() {
74
+ this.contextUsage = { state: "unavailable" };
75
+ }
76
+ recordThread(params) {
77
+ const usage = readCodexThreadTokenUsage(params);
78
+ this.threadUsage = usage ?? this.threadUsage;
79
+ if (!this.responseUsage && usage) this.contextUsage = usage.contextUsage;
80
+ return readCodexThreadContextSnapshot(params);
81
+ }
82
+ record(params, reportOutputTokens) {
83
+ const responseId = readStringField(params, "responseId");
84
+ if (!responseId || this.responseIds.has(responseId)) return;
85
+ this.responseIds.add(responseId);
86
+ const usage = isJsonObject(params.usage) ? normalizeCodexResponseTokenUsage(params.usage) : void 0;
87
+ this.contextUsage = usage?.contextUsage ?? { state: "unavailable" };
88
+ this.responseUsage ??= {};
89
+ for (const field of [
90
+ "input",
91
+ "output",
92
+ "cacheRead",
93
+ "cacheWrite",
94
+ "reasoningTokens",
95
+ "total"
96
+ ]) if (usage?.[field] !== void 0) this.responseUsage[field] = (this.responseUsage[field] ?? 0) + usage[field];
97
+ const outputTokens = usage?.output;
98
+ if (outputTokens !== void 0) reportOutputTokens?.(outputTokens);
99
+ }
100
+ };
101
+ //#endregion
102
+ export { readCodexThreadContextSnapshot as n, CodexUsageProjection as t };
@@ -1,6 +1,6 @@
1
- import { l as sessionBindingIdentity, o as readCodexSessionOwnershipBinding } from "./session-binding-record-CyaXZvTe.js";
1
+ import { l as sessionBindingIdentity } from "./session-binding-record-CaZjYwNS.js";
2
+ import { t as codexBuildSymbol } from "./build-state-6RL6qohz.js";
2
3
  import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
3
- import { runHostPreparedIsolatedCompletion } from "openclaw/plugin-sdk/simple-completion-runtime";
4
4
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  //#region extensions/codex/src/app-server/model-runtime.ts
6
6
  const CODEX_APP_SERVER_RUNTIME_MODEL_PARAM = "codexAppServerRuntimeModel";
@@ -13,7 +13,7 @@ function readCodexRuntimeModelId(model, fallbackId) {
13
13
  //#endregion
14
14
  //#region extensions/codex/harness.ts
15
15
  const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = /* @__PURE__ */ new Set(["codex", "openai"]);
16
- const SHARED_CODEX_APP_SERVER_CLIENT_DISPOSER = Symbol.for("openclaw.codexAppServerClientDisposer");
16
+ const SHARED_CODEX_APP_SERVER_CLIENT_DISPOSER = codexBuildSymbol("openclaw.codexAppServerClientDisposer");
17
17
  const CODEX_TOOL_POLICY_SAFE_DENY_NAMES = [
18
18
  "web_fetch",
19
19
  "x_search",
@@ -81,12 +81,15 @@ function createCodexAppServerAgentHarness(options) {
81
81
  if (disposed) throw new Error("Codex agent harness is disposed");
82
82
  };
83
83
  assertCurrent();
84
- const binding = readCodexSessionOwnershipBinding({
85
- bindingStore: options.bindingStore,
86
- identity: sessionBindingIdentity(params),
87
- config: params.config,
88
- storePath: params.storePath
89
- });
84
+ const identity = sessionBindingIdentity(params);
85
+ let binding = options.bindingStore.read(identity);
86
+ if (!binding) {
87
+ const previousSessionId = params.readPreviousSessionId?.();
88
+ binding = previousSessionId ? options.bindingStore.read({
89
+ ...identity,
90
+ sessionId: previousSessionId
91
+ }) : void 0;
92
+ }
90
93
  assertCurrent();
91
94
  return binding?.preserveNativeModel === true ? {
92
95
  model: "native",
@@ -100,7 +103,7 @@ function createCodexAppServerAgentHarness(options) {
100
103
  ...sessionCatalogControlFactory && sessionRuntime ? { sessionFork: {
101
104
  upstreamKinds: ["codex-app-server"],
102
105
  fork: async (params) => {
103
- const { forkCodexUpstreamSession } = await import("./upstream-session-fork-1fwbNKzQ.js");
106
+ const { forkCodexUpstreamSession } = await import("./upstream-session-fork-De-sLJ2r.js");
104
107
  return await forkCodexUpstreamSession(params, {
105
108
  bindingStore: options.bindingStore,
106
109
  controlFactory: sessionCatalogControlFactory,
@@ -111,26 +114,26 @@ function createCodexAppServerAgentHarness(options) {
111
114
  }
112
115
  } } : {},
113
116
  authBinding: { fingerprint: async (params) => {
114
- const { fingerprintCodexAppServerAuthBinding } = await import("./auth-binding-Ds_QVm-X.js").then((n) => n.t);
117
+ const { fingerprintCodexAppServerAuthBinding } = await import("./auth-binding-Co2Vfcf_.js").then((n) => n.t);
115
118
  return fingerprintCodexAppServerAuthBinding(params);
116
119
  } },
117
120
  runtimeArtifact: { validate: async (binding) => {
118
- const { validateCodexAppServerRuntimeArtifact } = await import("./runtime-artifact-Bh_gf6-t.js");
121
+ const { validateCodexAppServerRuntimeArtifact } = await import("./runtime-artifact-T-NwqeSH.js");
119
122
  return validateCodexAppServerRuntimeArtifact(binding);
120
123
  } },
121
124
  fetchUsageSnapshot: async (ctx) => {
122
- const { fetchCodexAppServerUsageSnapshot } = await import("./usage-i9fv5-4m.js");
125
+ const { fetchCodexAppServerUsageSnapshot } = await import("./usage-CPPTmBvZ.js");
123
126
  return await fetchCodexAppServerUsageSnapshot(ctx, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
124
127
  },
125
128
  loadModelCatalog: async (params) => {
126
- const { createCodexAppServerModelCatalog } = await import("./model-catalog-DT5vo6qo.js");
129
+ const { createCodexAppServerModelCatalog } = await import("./model-catalog-B_6M04Wo.js");
127
130
  if (disposed) return [];
128
131
  modelCatalog ??= createCodexAppServerModelCatalog(harnessRuntimeId);
129
132
  return await modelCatalog.load(params, resolveAttemptPluginConfig(params.config));
130
133
  },
131
134
  readModelCatalogReadiness: (params) => modelCatalog?.read(params, resolveAttemptPluginConfig(params.config)),
132
135
  loadMcpToolCatalog: async (params) => {
133
- const { loadCodexEffectiveMcpCatalog } = await import("./effective-mcp-catalog-CY9Jn4bA.js");
136
+ const { loadCodexEffectiveMcpCatalog } = await import("./effective-mcp-catalog-J_5Ep5Um.js");
134
137
  return await loadCodexEffectiveMcpCatalog(params, { bindingStore: options.bindingStore });
135
138
  },
136
139
  supports: (ctx) => {
@@ -173,7 +176,7 @@ function createCodexAppServerAgentHarness(options) {
173
176
  };
174
177
  },
175
178
  runAttempt: async (params) => {
176
- const { runCodexAppServerAttempt } = await import("./run-attempt-BzthFQSM.js");
179
+ const { runCodexAppServerAttempt } = await import("./run-attempt-DwKds3DN.js");
177
180
  return runCodexAppServerAttempt(params, {
178
181
  bindingStore: options.bindingStore,
179
182
  pluginConfig: resolveAttemptPluginConfig(params.config),
@@ -183,11 +186,15 @@ function createCodexAppServerAgentHarness(options) {
183
186
  });
184
187
  },
185
188
  runIsolatedCompletionV2: async (params) => {
186
- if (params.authorization.owner === "host") return runHostPreparedIsolatedCompletion(params);
187
- const { runCodexIsolatedCompletion } = await import("./isolated-completion-CRh-51AK.js");
189
+ if (params.authorization.owner === "host") {
190
+ const { runHostPreparedIsolatedCompletion } = await import("openclaw/plugin-sdk/simple-completion-runtime");
191
+ return runHostPreparedIsolatedCompletion(params);
192
+ }
193
+ const { runCodexIsolatedCompletion } = await import("./isolated-completion-DHBefrzg.js");
188
194
  return runCodexIsolatedCompletion(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
189
195
  },
190
196
  runIsolatedCompletion: async (params) => {
197
+ const { runHostPreparedIsolatedCompletion } = await import("openclaw/plugin-sdk/simple-completion-runtime");
191
198
  return runHostPreparedIsolatedCompletion({
192
199
  ...params,
193
200
  authorization: {
@@ -199,11 +206,11 @@ function createCodexAppServerAgentHarness(options) {
199
206
  });
200
207
  },
201
208
  finalizeSettledTurn: async (params) => {
202
- const { runCodexSettledTurnFinalization } = await import("./settled-turn-finalizer-BI-b1sry.js");
209
+ const { runCodexSettledTurnFinalization } = await import("./settled-turn-finalizer-BuLUrZl2.js");
203
210
  return runCodexSettledTurnFinalization(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
204
211
  },
205
212
  runSideQuestion: async (params) => {
206
- const { runCodexAppServerSideQuestion } = await import("./side-question-B6DWAw1A.js");
213
+ const { runCodexAppServerSideQuestion } = await import("./side-question-DLbr2vUU.js");
207
214
  return runCodexAppServerSideQuestion(params, {
208
215
  bindingStore: options.bindingStore,
209
216
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
@@ -213,20 +220,20 @@ function createCodexAppServerAgentHarness(options) {
213
220
  });
214
221
  },
215
222
  compact: async (params) => {
216
- const { maybeCompactCodexAppServerSession } = await import("./compact-Y_xBqrHN.js");
223
+ const { maybeCompactCodexAppServerSession } = await import("./compact-CGJZ2rlb.js");
217
224
  return maybeCompactCodexAppServerSession(params, {
218
225
  bindingStore: options.bindingStore,
219
226
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig
220
227
  });
221
228
  },
222
229
  withSessionDeletion: async (params, run) => {
223
- const { withCodexAppServerSessionDeletion } = await import("./session-retirement-DNdmYdFc.js");
230
+ const { withCodexAppServerSessionDeletion } = await import("./session-retirement-BSNG_mhf.js");
224
231
  params.assertCurrent();
225
232
  return withCodexAppServerSessionDeletion(options.bindingStore, params, run);
226
233
  },
227
234
  reset: async (params) => {
228
235
  if (params.sessionId && params.reason !== "deleted") {
229
- const [{ reclaimCurrentCodexSessionGeneration }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./session-binding-4Ki04sW-.js").then((n) => n.d), import("./session-retirement-DNdmYdFc.js")]);
236
+ const [{ reclaimCurrentCodexSessionGeneration }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./session-binding-CKSepwIC.js").then((n) => n.c), import("./session-retirement-BSNG_mhf.js")]);
230
237
  const identity = sessionBindingIdentity({
231
238
  agentId: params.agentId,
232
239
  sessionId: params.sessionId,
@@ -258,7 +265,7 @@ function createCodexAppServerAgentHarness(options) {
258
265
  /** Creates the private native-compaction bridge registered in host-owned capability state. */
259
266
  function createCodexAppServerNativeCompaction(options) {
260
267
  return async (params) => {
261
- const { maybeCompactCodexAppServerSession } = await import("./compact-Y_xBqrHN.js");
268
+ const { maybeCompactCodexAppServerSession } = await import("./compact-CGJZ2rlb.js");
262
269
  return maybeCompactCodexAppServerSession(params, {
263
270
  bindingStore: options.bindingStore,
264
271
  pluginConfig: options.resolvePluginConfig?.() ?? options.pluginConfig,
package/dist/harness.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as createCodexAppServerNativeCompaction, t as createCodexAppServerAgentHarness } from "./harness-Czh2Sdoc.js";
1
+ import { n as createCodexAppServerNativeCompaction, t as createCodexAppServerAgentHarness } from "./harness-FR6eQgyO.js";
2
2
  export { createCodexAppServerAgentHarness, createCodexAppServerNativeCompaction };
@@ -0,0 +1,13 @@
1
+ //#region extensions/codex/src/app-server/history-rejection.ts
2
+ /** Only an owning rejection site can supply a diagnostic; exception text is never evidence. */
3
+ var CodexHistoryRejection = class extends Error {
4
+ constructor(reason) {
5
+ super(`Codex history rejected: ${reason}`);
6
+ this.reason = reason;
7
+ }
8
+ };
9
+ function codexHistoryRejectionReason(error) {
10
+ return error instanceof CodexHistoryRejection ? error.reason : "history_read_failed";
11
+ }
12
+ //#endregion
13
+ export { codexHistoryRejectionReason as n, CodexHistoryRejection as t };
@@ -0,0 +1,15 @@
1
+ import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
2
+ import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
3
+ import { isIncognitoSessionKey as isIncognitoSessionKey$1 } from "openclaw/plugin-sdk/session-key-runtime";
4
+ //#region extensions/codex/src/app-server/thread-ownership-queue.ts
5
+ const nativeThreadOwners = resolveGlobalSingleton(Symbol.for("openclaw.codexNativeThreadOwners"), () => new KeyedAsyncQueue());
6
+ /** Serialize OpenClaw-owned lifecycle changes, not native-internal thread controllers. */
7
+ async function withCodexAppServerThreadMutation(threadId, run) {
8
+ return await nativeThreadOwners.enqueue(`thread:${threadId}`, run);
9
+ }
10
+ /** Serializes bound turns and retirement so detach cannot unsubscribe an active turn. */
11
+ async function withCodexConversationThreadActivity(bindingId, run) {
12
+ return await nativeThreadOwners.enqueue(`conversation:${bindingId}`, run);
13
+ }
14
+ //#endregion
15
+ export { withCodexAppServerThreadMutation as n, withCodexConversationThreadActivity as r, isIncognitoSessionKey$1 as t };