@openclaw/codex 2026.8.1-beta.2 → 2026.8.1-beta.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 (59) hide show
  1. package/dist/api.js +147 -0
  2. package/dist/app-server-policy-bg5QPSVP.js +25 -0
  3. package/dist/{attempt-client-cleanup-DMLXUfa8.js → attempt-client-cleanup-URjUlCHg.js} +1 -1
  4. package/dist/{binding-connection-I5Bo-AsX.js → binding-connection-DAvZwp96.js} +15 -3
  5. package/dist/{bounded-turn-qgZmzy_4.js → bounded-turn-4BjrZEwW.js} +22 -16
  6. package/dist/{capabilities-CybGI1oz.js → capabilities-CH3K57v4.js} +1 -1
  7. package/dist/cli-metadata.js +1 -1
  8. package/dist/{command-formatters-B1AEz8ZA.js → command-formatters-D0nZ3qtd.js} +2 -2
  9. package/dist/{command-handlers-Db8pu_ds.js → command-handlers-DC86lgT4.js} +39 -22
  10. package/dist/command-rpc-xUIIonsO.js +90 -0
  11. package/dist/{compact-LspQaGfl.js → compact-COqgBRny.js} +35 -29
  12. package/dist/{session-binding-DPxIvMgE.js → config-CpNeo5AE.js} +28 -888
  13. package/dist/context-compaction-activity-BOeJf7yo.js +58 -0
  14. package/dist/doctor-contract-api.js +15 -14
  15. package/dist/{dynamic-tools-BVdyWkUD.js → dynamic-tools-fJZhl4CE.js} +1284 -651
  16. package/dist/{effective-mcp-catalog-DIIhAtOZ.js → effective-mcp-catalog-4YKn51aG.js} +2 -2
  17. package/dist/elicitation-input-DMkeki8d.js +71 -0
  18. package/dist/{event-projector-usage-e5huIQWu.js → event-projector-usage-CLwNEJqW.js} +16 -16
  19. package/dist/harness-DoKQcF8n.js +258 -0
  20. package/dist/harness.js +2 -226
  21. package/dist/index.js +171 -48
  22. package/dist/{isolated-completion-C58NbL40.js → isolated-completion-DPMtlH9r.js} +3 -3
  23. package/dist/managed-binary-By4FZC6i.js +212 -0
  24. package/dist/media-understanding-provider.js +2 -2
  25. package/dist/model-catalog-CmGoqVKB.js +48 -0
  26. package/dist/{models-BFlpn1Ex.js → models-CZw1wClT.js} +2 -2
  27. package/dist/{native-subagent-monitor-DyTGmTUx.js → native-subagent-monitor-GGq3RnOo.js} +185 -71
  28. package/dist/node-exec-server.runtime-Bsu1LdFZ.js +192 -0
  29. package/dist/{plugin-app-cache-key-C3H2CVp6.js → plugin-app-cache-key-DMNQ8Zi8.js} +15 -3
  30. package/dist/plugin-approval-roundtrip-C75Yiiwc.js +95 -0
  31. package/dist/{plugin-marketplace-discovery-CzrGJdCR.js → plugin-marketplace-discovery-CSWDkMrP.js} +40 -26
  32. package/dist/{plugin-metadata-cache-CNJPj4_b.js → plugin-metadata-cache-BXH5NF-4.js} +8 -5
  33. package/dist/{protocol-validators-B4F7L8Rf.js → protocol-validators-VAVyEnDp.js} +55 -2
  34. package/dist/{rate-limits-DZXmOL8-.js → rate-limits-BI1dMHDG.js} +1 -1
  35. package/dist/{request-BRl5_UfX.js → request-DSK0W6YI.js} +2 -2
  36. package/dist/{run-attempt-P8BdxC1I.js → run-attempt-BV3HzuCf.js} +1098 -666
  37. package/dist/{runtime-artifact-BVSPdd6g.js → runtime-artifact-BvyT1uyd.js} +4 -7
  38. package/dist/{sandbox-guard-Cmwc9eIk.js → sandbox-guard-C1qEeZ5C.js} +25 -19
  39. package/dist/session-binding-BTrLf9Qm.js +874 -0
  40. package/dist/{session-catalog-xwNi_SDM.js → session-catalog-ezP_UcRM.js} +1541 -1296
  41. package/dist/session-catalog-home-id-BNwAJ9D7.js +18 -0
  42. package/dist/{session-cli-7hgXZDV7.js → session-cli-B1hKvfkI.js} +20 -7
  43. package/dist/{session-retirement-DoMMJFKm.js → session-retirement-CE4iMiLh.js} +3 -3
  44. package/dist/{session-upstream-marker-CrIFX06J.js → session-upstream-marker-D_2npHlA.js} +1 -1
  45. package/dist/{settled-turn-finalizer-BRWBO4MO.js → settled-turn-finalizer-Dx1onIqg.js} +23 -19
  46. package/dist/{shared-client-kIBbGjk4.js → shared-client-Dw-rzii0.js} +755 -273
  47. package/dist/{side-question-9HAL26l9.js → side-question-DbXkJZzg.js} +52 -30
  48. package/dist/{thread-lifecycle-Bu1BTDXr.js → thread-lifecycle-DKdrnTMX.js} +310 -92
  49. package/dist/{thread-ownership-6kOQHlyC.js → thread-ownership-i2NBwDUL.js} +2 -2
  50. package/dist/{thread-resume-CPrJNQVM.js → thread-resume-CdJk2Ehf.js} +3 -3
  51. package/dist/{transcript-mirror-B9gGgnJS.js → transcript-mirror-BU0_LKAL.js} +46 -28
  52. package/dist/{transport-stdio-DIImwDVS.js → transport-stdio-DhoGy33Z.js} +2 -2
  53. package/dist/{upstream-prompt-provenance-ClRBije0.js → upstream-prompt-provenance-CFmsKwr9.js} +12 -14
  54. package/dist/{upstream-session-fork-CE-_LdnP.js → upstream-session-fork-BDVJCLAD.js} +12 -6
  55. package/dist/{usage-CHlV0e-o.js → usage-9dKJCgcy.js} +3 -3
  56. package/dist/{web-search-provider.runtime-DRw2Vl42.js → web-search-provider.runtime-DCdx4DGu.js} +3 -3
  57. package/openclaw.plugin.json +31 -1
  58. package/package.json +6 -5
  59. package/dist/app-server-policy-zcBDc1JU.js +0 -49
@@ -1,5 +1,5 @@
1
- import { K as releaseCodexAppServerLiveThread, W as isCodexAppServerLiveThreadClaimed, d as retainSharedCodexAppServerClientByInstanceId, q as retainCodexAppServerLiveThread } from "./shared-client-kIBbGjk4.js";
2
- import { a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-DMLXUfa8.js";
1
+ import { J as releaseCodexAppServerLiveThread, K as isCodexAppServerLiveThreadClaimed, Y as retainCodexAppServerLiveThread, d as retainSharedCodexAppServerClientByInstanceId } from "./shared-client-Dw-rzii0.js";
2
+ import { a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-URjUlCHg.js";
3
3
  import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
4
4
  //#region extensions/codex/src/app-server/thread-ownership.ts
5
5
  const nativeThreadOwners = new KeyedAsyncQueue();
@@ -1,6 +1,6 @@
1
- import { F as isCodexAppServerPrewriteRequestCancellationError, s as isCodexAppServerStartSelectionChangedError, z as CodexAppServerRpcError } from "./shared-client-kIBbGjk4.js";
2
- import { i as assertCodexThreadResumeSubscription, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-DMLXUfa8.js";
3
- import { i as assertCodexThreadResumeResponse } from "./protocol-validators-B4F7L8Rf.js";
1
+ import { B as CodexAppServerRpcError, F as isCodexAppServerPrewriteRequestCancellationError, s as isCodexAppServerStartSelectionChangedError } from "./shared-client-Dw-rzii0.js";
2
+ import { i as assertCodexThreadResumeSubscription, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-URjUlCHg.js";
3
+ import { i as assertCodexThreadResumeResponse } from "./protocol-validators-VAVyEnDp.js";
4
4
  //#region extensions/codex/src/app-server/thread-resume.ts
5
5
  /** Owns Codex thread/resume subscription safety. */
6
6
  /** Resumes one thread and retires the physical client when acceptance is indeterminate. */
@@ -1,7 +1,8 @@
1
- import { i as readUpstreamUserText, n as attachUpstreamUserText, r as readMirrorIdentity, t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-ClRBije0.js";
2
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
1
+ import { i as readUpstreamUserText, n as attachUpstreamUserText, r as readMirrorIdentity, t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-CFmsKwr9.js";
2
+ import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { embeddedAgentLog, formatErrorMessage, projectAgentHarnessTranscriptMessageForDisplay, runAgentHarnessBeforeMessageWriteHook } from "openclaw/plugin-sdk/agent-harness-runtime";
4
4
  import { createHash } from "node:crypto";
5
+ import { truncateUtf8Prefix } from "openclaw/plugin-sdk/text-utility-runtime";
5
6
  import { withCodexSessionTranscriptMirrorWriteLock } from "openclaw/plugin-sdk/codex-session-transcript-runtime";
6
7
  import { publishSessionTranscriptUpdateByIdentity } from "openclaw/plugin-sdk/session-transcript-runtime";
7
8
  import { Buffer } from "node:buffer";
@@ -27,16 +28,6 @@ const CODEX_HISTORY_ZERO_USAGE = {
27
28
  total: 0
28
29
  }
29
30
  };
30
- function isUtf8ContinuationByte(byte) {
31
- return byte !== void 0 && (byte & 192) === 128;
32
- }
33
- function truncateUtf8Prefix(value, maxBytes) {
34
- const bytes = Buffer.from(value);
35
- if (bytes.byteLength <= maxBytes) return value;
36
- let end = Math.max(0, maxBytes);
37
- while (end > 0 && isUtf8ContinuationByte(bytes[end])) end -= 1;
38
- return bytes.subarray(0, end).toString("utf8");
39
- }
40
31
  function normalizeImportedHistoryText(value) {
41
32
  if (typeof value !== "string") return;
42
33
  const text = value.trim();
@@ -183,35 +174,46 @@ function projectBoundedCodexVisibleSessionHistory(entries) {
183
174
  const MIRROR_ORIGIN_META_KEY = "mirrorOrigin";
184
175
  const MIRROR_SOURCE_FINGERPRINT_META_KEY = "mirrorSourceFingerprint";
185
176
  const CODEX_APP_SERVER_MIRROR_ORIGIN = "codex-app-server";
177
+ const CODEX_META_KEY = "__openclaw";
186
178
  function attachCodexMirrorAttestation(message, sourceFingerprint) {
187
- const record = message;
188
- const existing = record["__openclaw"];
179
+ const existing = CODEX_META_KEY in message ? message[CODEX_META_KEY] : void 0;
189
180
  const baseMeta = existing && typeof existing === "object" && !Array.isArray(existing) ? existing : {};
190
181
  return {
191
- ...record,
192
- __openclaw: {
182
+ ...message,
183
+ [CODEX_META_KEY]: {
193
184
  ...baseMeta,
194
185
  [MIRROR_ORIGIN_META_KEY]: CODEX_APP_SERVER_MIRROR_ORIGIN,
195
186
  ...sourceFingerprint ? { [MIRROR_SOURCE_FINGERPRINT_META_KEY]: sourceFingerprint } : {}
196
187
  }
197
188
  };
198
189
  }
190
+ function attachCodexMirrorRunId(message, runId, terminal = false) {
191
+ const { runTerminal: _staleTerminal, ...current } = asOptionalRecord(CODEX_META_KEY in message ? message[CODEX_META_KEY] : void 0) ?? {};
192
+ return {
193
+ ...message,
194
+ [CODEX_META_KEY]: {
195
+ ...current,
196
+ runId,
197
+ ...terminal ? { runTerminal: true } : {}
198
+ }
199
+ };
200
+ }
199
201
  function readCodexMirrorSourceFingerprint(message) {
200
- const meta = message["__openclaw"];
202
+ const meta = CODEX_META_KEY in message ? message[CODEX_META_KEY] : void 0;
201
203
  if (!meta || typeof meta !== "object" || Array.isArray(meta)) return;
202
204
  const value = meta[MIRROR_SOURCE_FINGERPRINT_META_KEY];
203
205
  return typeof value === "string" && value ? value : void 0;
204
206
  }
205
207
  function serializeCodexMirrorSourceEvidence(message) {
206
- const record = message;
208
+ const content = "content" in message ? message.content : void 0;
207
209
  return JSON.stringify({
208
210
  role: message.role,
209
- content: record.content,
211
+ content,
210
212
  ...message.role === "user" ? { upstreamUserText: readUpstreamUserText(message) } : {},
211
213
  ...message.role === "toolResult" ? {
212
- toolCallId: record.toolCallId,
213
- toolName: record.toolName,
214
- isError: record.isError === true
214
+ toolCallId: message.toolCallId,
215
+ toolName: message.toolName,
216
+ isError: message.isError
215
217
  } : {}
216
218
  });
217
219
  }
@@ -247,7 +249,7 @@ function buildFromPrepared(params, preparedUserMessage) {
247
249
  ...senderUsername ? { senderUsername } : {},
248
250
  ...senderE164 ? { senderE164 } : {},
249
251
  ...senderLabel ? { senderLabel } : {},
250
- ...preparedUserMessage ? preparedUserMessage : { content: params.prompt }
252
+ ...preparedUserMessage ?? { content: params.transcriptPrompt ?? params.prompt }
251
253
  };
252
254
  }
253
255
  function buildCodexUserPromptMessage(params) {
@@ -310,6 +312,12 @@ async function mirrorBestEffort(params) {
310
312
  cwd: params.cwd,
311
313
  messages,
312
314
  idempotencyScope: `codex-app-server:${params.threadId}`,
315
+ runId: params.params.runId,
316
+ runMirrorIdentityPrefix: `${params.turnId}:`,
317
+ terminalAssistantOwner: {
318
+ mirrorIdentity: `${params.turnId}:assistant`,
319
+ runId: params.params.runId
320
+ },
313
321
  config: params.params.config
314
322
  });
315
323
  for (const receipt of mirrorResult.userMessageReceipts) try {
@@ -327,8 +335,9 @@ async function mirrorBestEffort(params) {
327
335
  return identity !== void 0 && readCodexMirrorSourceFingerprint(message) === expectedFingerprints.get(identity);
328
336
  });
329
337
  const assistantMirrorIdentity = `${params.turnId}:assistant`;
330
- const assistantTranscriptOwned = mirrorResult.assistantMirrorIdentitiesOwned.includes(assistantMirrorIdentity);
331
- const assistantTranscriptIdempotencyKey = normalizeOptionalString((assistantTranscriptOwned ? mirroredMessages.find((message) => readMirrorIdentity(message) === assistantMirrorIdentity) : void 0)?.idempotencyKey);
338
+ const assistantTranscriptMessage = mirroredMessages.find((message) => readMirrorIdentity(message) === assistantMirrorIdentity);
339
+ const assistantTranscriptOwned = Boolean(assistantTranscriptMessage && mirrorResult.assistantMirrorIdentitiesOwned.includes(assistantMirrorIdentity));
340
+ const assistantTranscriptIdempotencyKey = normalizeOptionalString(assistantTranscriptMessage?.idempotencyKey);
332
341
  const terminalMessage = mirroredMessages.at(-1);
333
342
  const terminalMirrorIdentity = terminalMessage ? readMirrorIdentity(terminalMessage) : void 0;
334
343
  const terminalAnchor = (terminalMirrorIdentity ? mirrorResult.anchorsByMirrorIdentity.get(terminalMirrorIdentity) : void 0) ?? params.params.userTurnTranscriptRecorder?.getAdmissionReceipt();
@@ -391,6 +400,8 @@ async function mirrorPromptAtTurnStartBestEffort(params) {
391
400
  cwd: params.cwd,
392
401
  messages: [userPromptMessage],
393
402
  idempotencyScope: `codex-app-server:${params.threadId}`,
403
+ runId: params.params.runId,
404
+ runMirrorIdentityPrefix: `${params.turnId}:`,
394
405
  config: params.params.config
395
406
  });
396
407
  for (const receipt of mirrorResult.userMessageReceipts) params.notifyUserMessagePersisted(receipt.message, receipt.anchor);
@@ -431,7 +442,7 @@ async function mirror(params) {
431
442
  const sourceFingerprint = fingerprintCodexMirrorSourceMessage(message);
432
443
  return {
433
444
  dedupeIdentity,
434
- idempotencyKey: (message.role === "user" ? normalizeOptionalString(message.idempotencyKey) : void 0) ?? (params.idempotencyScope ? `${params.idempotencyScope}:${dedupeIdentity}` : void 0),
445
+ idempotencyKey: (message.role === "user" ? normalizeOptionalString("idempotencyKey" in message ? message.idempotencyKey : void 0) : void 0) ?? (params.idempotencyScope ? `${params.idempotencyScope}:${dedupeIdentity}` : void 0),
435
446
  message,
436
447
  sourceFingerprint
437
448
  };
@@ -450,8 +461,12 @@ async function mirror(params) {
450
461
  const nextUserMessagesPresent = [];
451
462
  const mirrorFacts = await transcript.readMessageFacts({ idempotencyKeys: candidateIdempotencyKeys });
452
463
  for (const { dedupeIdentity, idempotencyKey, message, sourceFingerprint } of candidates) {
464
+ const mirrorIdentity = readMirrorIdentity(message);
465
+ const ownsRun = Boolean(params.runId && (!params.runMirrorIdentityPrefix || mirrorIdentity?.startsWith(params.runMirrorIdentityPrefix)));
466
+ const terminalOwner = params.terminalAssistantOwner;
467
+ const ownsTerminal = Boolean(ownsRun && terminalOwner && mirrorIdentity === terminalOwner.mirrorIdentity);
453
468
  const transcriptMessage = {
454
- ...attachCodexMirrorAttestation(message, sourceFingerprint),
469
+ ...attachCodexMirrorAttestation(ownsRun && params.runId ? attachCodexMirrorRunId(message, params.runId, ownsTerminal) : message, sourceFingerprint),
455
470
  ...idempotencyKey ? { idempotencyKey } : {}
456
471
  };
457
472
  if (idempotencyKey && mirrorFacts.existingIdempotencyKeys.has(idempotencyKey)) {
@@ -484,8 +499,8 @@ async function mirror(params) {
484
499
  ...attachCodexMirrorAttestation(nextMessage, sourceFingerprint),
485
500
  idempotencyKey
486
501
  } : attachCodexMirrorAttestation(nextMessage, sourceFingerprint);
487
- const mirrorIdentity = readMirrorIdentity(message);
488
502
  if (mirrorIdentity) messageToAppend = attachCodexMirrorIdentity(messageToAppend, mirrorIdentity);
503
+ if (ownsRun && params.runId) messageToAppend = attachCodexMirrorRunId(messageToAppend, params.runId, ownsTerminal);
489
504
  messageToAppend = projectAgentHarnessTranscriptMessageForDisplay({
490
505
  hidden: message.display === false,
491
506
  message: messageToAppend
@@ -530,6 +545,8 @@ async function mirror(params) {
530
545
  };
531
546
  });
532
547
  for (const update of appendedUpdates) try {
548
+ const terminalOwner = params.terminalAssistantOwner;
549
+ const terminalRunId = update.message.role === "assistant" && terminalOwner && readMirrorIdentity(update.message) === terminalOwner.mirrorIdentity ? terminalOwner.runId : void 0;
533
550
  await publishSessionTranscriptUpdateByIdentity({
534
551
  ...transcriptTarget,
535
552
  update: {
@@ -537,6 +554,7 @@ async function mirror(params) {
537
554
  message: update.message,
538
555
  messageId: update.messageId,
539
556
  ...update.messageSeq !== void 0 ? { messageSeq: update.messageSeq } : {},
557
+ ...terminalRunId ? { runId: terminalRunId } : {},
540
558
  sessionKey: transcriptTarget.sessionKey
541
559
  }
542
560
  });
@@ -75,8 +75,8 @@ function copySafeEnvironmentEntries(target, source) {
75
75
  }
76
76
  }
77
77
  /** Spawns the Codex app-server process and returns the shared transport interface. */
78
- function createStdioTransport(options) {
79
- const env = resolveCodexAppServerSpawnEnv(options);
78
+ function createStdioTransport(options, baseEnv = process.env) {
79
+ const env = resolveCodexAppServerSpawnEnv(options, baseEnv);
80
80
  const invocation = resolveCodexAppServerSpawnInvocation(options, {
81
81
  platform: process.platform,
82
82
  env,
@@ -1,12 +1,12 @@
1
+ import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
1
2
  //#region extensions/codex/src/app-server/upstream-prompt-provenance.ts
2
3
  const UPSTREAM_USER_TEXT_META_KEY = "upstreamUserText";
3
4
  const MIRROR_IDENTITY_META_KEY = "mirrorIdentity";
5
+ const CODEX_META_KEY = "__openclaw";
4
6
  function attachCodexMirrorIdentity(message, identity) {
5
- const record = message;
6
- const existing = record["__openclaw"];
7
- const baseMeta = existing && typeof existing === "object" && !Array.isArray(existing) ? existing : {};
7
+ const baseMeta = asOptionalRecord(CODEX_META_KEY in message ? message[CODEX_META_KEY] : void 0) ?? {};
8
8
  return {
9
- ...record,
9
+ ...message,
10
10
  __openclaw: {
11
11
  ...baseMeta,
12
12
  [MIRROR_IDENTITY_META_KEY]: identity
@@ -14,17 +14,15 @@ function attachCodexMirrorIdentity(message, identity) {
14
14
  };
15
15
  }
16
16
  function readMirrorIdentity(message) {
17
- const meta = message["__openclaw"];
18
- if (!meta || typeof meta !== "object" || Array.isArray(meta)) return;
19
- const id = meta[MIRROR_IDENTITY_META_KEY];
17
+ const record = asOptionalRecord(CODEX_META_KEY in message ? message[CODEX_META_KEY] : void 0);
18
+ if (!record) return;
19
+ const id = record[MIRROR_IDENTITY_META_KEY];
20
20
  return typeof id === "string" && id ? id : void 0;
21
21
  }
22
22
  function attachUpstreamUserText(message, text) {
23
- const record = message;
24
- const existing = record["__openclaw"];
25
- const baseMeta = existing && typeof existing === "object" && !Array.isArray(existing) ? existing : {};
23
+ const baseMeta = asOptionalRecord(CODEX_META_KEY in message ? message[CODEX_META_KEY] : void 0) ?? {};
26
24
  return {
27
- ...record,
25
+ ...message,
28
26
  __openclaw: {
29
27
  ...baseMeta,
30
28
  [UPSTREAM_USER_TEXT_META_KEY]: text
@@ -32,9 +30,9 @@ function attachUpstreamUserText(message, text) {
32
30
  };
33
31
  }
34
32
  function readUpstreamUserText(message) {
35
- const meta = message?.["__openclaw"];
36
- if (!meta || typeof meta !== "object" || Array.isArray(meta)) return;
37
- const text = meta[UPSTREAM_USER_TEXT_META_KEY];
33
+ const record = asOptionalRecord(message && CODEX_META_KEY in message ? message[CODEX_META_KEY] : void 0);
34
+ if (!record) return;
35
+ const text = record[UPSTREAM_USER_TEXT_META_KEY];
38
36
  return typeof text === "string" && text ? text : void 0;
39
37
  }
40
38
  //#endregion
@@ -1,7 +1,7 @@
1
- import { d as sessionBindingIdentity } from "./session-binding-DPxIvMgE.js";
2
- import { r as assertCodexThreadForkResponse } from "./protocol-validators-B4F7L8Rf.js";
1
+ import { d as sessionBindingIdentity } from "./session-binding-BTrLf9Qm.js";
2
+ import { r as assertCodexThreadForkResponse } from "./protocol-validators-VAVyEnDp.js";
3
3
  import { t as isIncognitoSessionKey } from "./incognito-session-ET_ufDH-.js";
4
- import { i as createImportedCodexSession, n as codexUpstreamBaseline, t as codexLastTerminalTurnId } from "./session-upstream-marker-CrIFX06J.js";
4
+ import { i as createImportedCodexSession, n as codexUpstreamBaseline, t as codexLastTerminalTurnId } from "./session-upstream-marker-D_2npHlA.js";
5
5
  import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { readVisibleSessionTranscriptMessageEntries } from "openclaw/plugin-sdk/session-transcript-runtime";
7
7
  import { deleteSessionUpstreamLink, upsertSessionUpstreamLink } from "openclaw/plugin-sdk/session-catalog";
@@ -171,7 +171,14 @@ function normalizeTurnId(value) {
171
171
  }
172
172
  async function forkCodexUpstreamSession(params, options) {
173
173
  try {
174
- return await options.control.withPinnedConnection(async (control) => {
174
+ const sourceFingerprint = params.upstream.kind === "codex-app-server" ? readConnectionFingerprint(params.upstream.ref) : void 0;
175
+ const requestControl = sourceFingerprint ? options.controlFactory.forUpstream(params.source.agentId, sourceFingerprint) : void 0;
176
+ if (!sourceFingerprint || !requestControl) return {
177
+ status: "failed",
178
+ code: "upstream-unavailable",
179
+ message: "This Codex thread is not available on the current connection. Reconnect to its host and try again."
180
+ };
181
+ return await requestControl.withPinnedConnection(async (control) => {
175
182
  const incognito = isIncognitoSessionKey(params.targetKey);
176
183
  const clientId = control.clientId?.trim();
177
184
  if (incognito && !clientId) throw new Error("Incognito Codex forks require the live pinned app-server client");
@@ -185,8 +192,7 @@ async function forkCodexUpstreamSession(params, options) {
185
192
  if (linked) deleteSessionUpstreamLink(params.targetKey, params.source.agentId);
186
193
  await control.archiveThread(forkedThreadId).catch(() => void 0);
187
194
  };
188
- const sourceFingerprint = readConnectionFingerprint(params.upstream.ref);
189
- if (params.upstream.kind !== "codex-app-server" || !sourceFingerprint || sourceFingerprint !== control.connectionFingerprint) return {
195
+ if (sourceFingerprint !== control.connectionFingerprint) return {
190
196
  status: "failed",
191
197
  code: "upstream-unavailable",
192
198
  message: "This Codex thread is not available on the current connection. Reconnect to its host and try again."
@@ -1,6 +1,6 @@
1
- import { g as resolveCodexAppServerRuntimeOptions } from "./session-binding-DPxIvMgE.js";
2
- import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-DZXmOL8-.js";
3
- import { t as readCodexAppServerUsage } from "./request-BRl5_UfX.js";
1
+ import { i as resolveCodexAppServerRuntimeOptions } from "./config-CpNeo5AE.js";
2
+ import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-BI1dMHDG.js";
3
+ import { t as readCodexAppServerUsage } from "./request-DSK0W6YI.js";
4
4
  import { CODEX_APP_SERVER_AUTH_MARKER } from "openclaw/plugin-sdk/agent-runtime";
5
5
  //#region extensions/codex/src/app-server/usage.ts
6
6
  /** Handles the synthetic usage credential for a Codex-backed OpenAI route. */
@@ -1,6 +1,6 @@
1
- import { ct as isJsonObject } from "./shared-client-kIBbGjk4.js";
2
- import { d as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-Bu1BTDXr.js";
3
- import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-qgZmzy_4.js";
1
+ import { ut as isJsonObject } from "./shared-client-Dw-rzii0.js";
2
+ import { d as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-DKdrnTMX.js";
3
+ import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-4BjrZEwW.js";
4
4
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { readStringParam, resolveSearchTimeoutSeconds, wrapWebContent } from "openclaw/plugin-sdk/provider-web-search";
6
6
  //#region extensions/codex/src/web-search-provider.runtime.ts
@@ -16,6 +16,13 @@
16
16
  ],
17
17
  "name": "Codex",
18
18
  "description": "Codex app-server harness and native session catalog.",
19
+ "cliCommands": [
20
+ {
21
+ "name": "codex",
22
+ "description": "Inspect and branch from Codex sessions through the Gateway",
23
+ "hasSubcommands": true
24
+ }
25
+ ],
19
26
  "contracts": {
20
27
  "mediaUnderstandingProviders": ["codex"],
21
28
  "migrationProviders": ["codex"],
@@ -45,6 +52,7 @@
45
52
  "onConfigPaths": [
46
53
  "plugins.entries.codex.config.appServer.transport",
47
54
  "plugins.entries.codex.config.sessionCatalog.enabled",
55
+ "plugins.entries.codex.config.sessionCatalog.homes",
48
56
  "plugins.entries.codex.config.supervision.enabled"
49
57
  ]
50
58
  },
@@ -73,7 +81,24 @@
73
81
  "type": "object",
74
82
  "additionalProperties": false,
75
83
  "properties": {
76
- "enabled": { "type": "boolean", "default": true }
84
+ "enabled": { "type": "boolean", "default": true },
85
+ "homes": {
86
+ "type": "array",
87
+ "items": {
88
+ "anyOf": [
89
+ { "type": "string", "minLength": 1, "pattern": "\\S" },
90
+ {
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "required": ["path"],
94
+ "properties": {
95
+ "path": { "type": "string", "minLength": 1, "pattern": "\\S" },
96
+ "label": { "type": "string", "minLength": 1, "pattern": "\\S" }
97
+ }
98
+ }
99
+ ]
100
+ }
101
+ }
77
102
  }
78
103
  },
79
104
  "discovery": {
@@ -392,6 +417,11 @@
392
417
  "label": "Discover Codex Sessions",
393
418
  "help": "List native Codex sessions in the sidebar from this Gateway and eligible paired nodes."
394
419
  },
420
+ "sessionCatalog.homes": {
421
+ "label": "Additional Codex Homes",
422
+ "help": "Existing local Codex home directories to include in native session discovery. String paths use the canonical directory basename as their label; object entries can override it with label. Paths are canonicalized and deduplicated. Requires appServer.transport=stdio and a Gateway restart.",
423
+ "advanced": true
424
+ },
395
425
  "codexDynamicToolsLoading": {
396
426
  "label": "Dynamic Tools Loading",
397
427
  "help": "Use searchable to defer OpenClaw dynamic tools behind Codex tool search, or direct to expose them in the initial context.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.8.1-beta.2",
3
+ "version": "2026.8.1-beta.3",
4
4
  "description": "OpenClaw Codex app-server harness and native session supervision plugin.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "@openai/codex": "0.147.0",
11
+ "@openai/codex": "0.149.1",
12
+ "semver": "7.8.5",
12
13
  "smol-toml": "1.7.1",
13
14
  "typebox": "1.3.6",
14
15
  "ws": "8.21.1",
@@ -35,10 +36,10 @@
35
36
  ]
36
37
  },
37
38
  "compat": {
38
- "pluginApi": ">=2026.8.1-beta.2"
39
+ "pluginApi": ">=2026.8.1-beta.3"
39
40
  },
40
41
  "build": {
41
- "openclawVersion": "2026.8.1-beta.2"
42
+ "openclawVersion": "2026.8.1-beta.3"
42
43
  },
43
44
  "release": {
44
45
  "publishToClawHub": true,
@@ -58,7 +59,7 @@
58
59
  "README.md"
59
60
  ],
60
61
  "peerDependencies": {
61
- "openclaw": ">=2026.8.1-beta.2"
62
+ "openclaw": ">=2026.8.1-beta.3"
62
63
  },
63
64
  "peerDependenciesMeta": {
64
65
  "openclaw": {
@@ -1,49 +0,0 @@
1
- import { k as canUseCodexModelBackedApprovalsReviewerForModel } from "./session-binding-DPxIvMgE.js";
2
- //#region extensions/codex/src/app-server/app-server-policy.ts
3
- /**
4
- * Policy promotion for Codex app-server runs that can safely use OpenClaw tool
5
- * approvals.
6
- */
7
- /**
8
- * Promotes implicit `never` approval policy to `untrusted` only when runtime
9
- * requirements allow OpenClaw to handle tool approvals.
10
- */
11
- function resolveCodexAppServerForOpenClawToolPolicy(params) {
12
- if (!params.shouldPromote || !params.canUseUntrustedApprovalPolicy || params.appServer.approvalPolicy !== "never") return params.appServer;
13
- const explicitMode = params.execPolicy?.mode === "full" || params.pluginConfig.appServer?.mode !== void 0 || isCodexAppServerPolicyMode(params.env.OPENCLAW_CODEX_APP_SERVER_MODE);
14
- const explicitApprovalPolicy = params.pluginConfig.appServer?.approvalPolicy !== void 0 || isConfiguredCodexAppServerApprovalPolicy(params.env.OPENCLAW_CODEX_APP_SERVER_APPROVAL_POLICY) || params.appServer.approvalPolicySource === "requirements";
15
- if (explicitMode || explicitApprovalPolicy) return params.appServer;
16
- return {
17
- ...params.appServer,
18
- approvalPolicy: "untrusted"
19
- };
20
- }
21
- function resolveCodexAppServerForModelProvider(params) {
22
- const explicitProvider = normalizeModelBackedReviewerProvider(params.provider);
23
- if (!isCodexModelBackedApprovalsReviewer(params.appServer.approvalsReviewer) || canUseCodexModelBackedApprovalsReviewerForModel({
24
- modelProvider: explicitProvider,
25
- model: params.model,
26
- config: params.config,
27
- env: params.env,
28
- agentDir: params.agentDir,
29
- codexConfigToml: params.codexConfigToml
30
- })) return params.appServer;
31
- return {
32
- ...params.appServer,
33
- approvalsReviewer: "user"
34
- };
35
- }
36
- function isCodexAppServerPolicyMode(value) {
37
- return value === "guardian" || value === "yolo";
38
- }
39
- function isConfiguredCodexAppServerApprovalPolicy(value) {
40
- return value === "never" || value === "on-request" || value === "on-failure" || value === "untrusted";
41
- }
42
- function isCodexModelBackedApprovalsReviewer(value) {
43
- return value === "auto_review" || value === "guardian_subagent";
44
- }
45
- function normalizeModelBackedReviewerProvider(provider) {
46
- return provider?.trim().toLowerCase() || void 0;
47
- }
48
- //#endregion
49
- export { resolveCodexAppServerForOpenClawToolPolicy as n, resolveCodexAppServerForModelProvider as t };