@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.
Files changed (60) hide show
  1. package/dist/api.js +147 -0
  2. package/dist/{attempt-client-cleanup-DMLXUfa8.js → attempt-client-cleanup-bfsmcQ6m.js} +21 -2
  3. package/dist/{binding-connection-I5Bo-AsX.js → binding-connection-BMvPX73o.js} +15 -3
  4. package/dist/{bounded-turn-qgZmzy_4.js → bounded-turn-B7iBUcuP.js} +22 -16
  5. package/dist/{capabilities-CybGI1oz.js → capabilities-BRMh0aIq.js} +1 -1
  6. package/dist/cli-metadata.js +1 -1
  7. package/dist/{command-formatters-B1AEz8ZA.js → command-formatters-DEsIufkt.js} +2 -2
  8. package/dist/{command-handlers-Db8pu_ds.js → command-handlers-D_-1_qRp.js} +65 -37
  9. package/dist/command-rpc-CCeCkf_v.js +90 -0
  10. package/dist/{compact-LspQaGfl.js → compact-BglNFZrQ.js} +35 -29
  11. package/dist/{session-binding-DPxIvMgE.js → config-giW8X0QA.js} +108 -914
  12. package/dist/context-compaction-activity-BOeJf7yo.js +58 -0
  13. package/dist/doctor-contract-api.js +23 -21
  14. package/dist/{dynamic-tools-BVdyWkUD.js → dynamic-tools-Dnlfa--w.js} +1345 -1424
  15. package/dist/{effective-mcp-catalog-DIIhAtOZ.js → effective-mcp-catalog-CTeGrnfO.js} +2 -2
  16. package/dist/elicitation-input-DMkeki8d.js +71 -0
  17. package/dist/{event-projector-assistant-message-BwxV4d6N.js → event-projector-assistant-message-C5-Ds8mA.js} +18 -1
  18. package/dist/{event-projector-usage-e5huIQWu.js → event-projector-usage-Bk1I90Bg.js} +18 -18
  19. package/dist/harness-Csz0F-DK.js +258 -0
  20. package/dist/harness.js +2 -226
  21. package/dist/index.js +262 -181
  22. package/dist/{isolated-completion-C58NbL40.js → isolated-completion-Cv6FqygM.js} +4 -4
  23. package/dist/managed-binary-DFYK4DWq.js +248 -0
  24. package/dist/media-understanding-provider.js +2 -2
  25. package/dist/model-catalog-i9rNBthX.js +48 -0
  26. package/dist/{models-BFlpn1Ex.js → models-TS3HBU-q.js} +4 -3
  27. package/dist/{native-subagent-monitor-DyTGmTUx.js → native-subagent-monitor-4Mfq2HDs.js} +354 -83
  28. package/dist/node-exec-server.runtime-BpWqJO1V.js +192 -0
  29. package/dist/{plugin-app-cache-key-C3H2CVp6.js → plugin-app-cache-key-C1CAdfcP.js} +19 -4
  30. package/dist/plugin-approval-roundtrip-bUm777tR.js +95 -0
  31. package/dist/{plugin-marketplace-discovery-CzrGJdCR.js → plugin-marketplace-discovery-B9DvaAG-.js} +59 -54
  32. package/dist/{plugin-metadata-cache-CNJPj4_b.js → plugin-metadata-cache-CTCT3w5L.js} +164 -134
  33. package/dist/{protocol-validators-B4F7L8Rf.js → protocol-validators-VeJxxJ0U.js} +80 -5
  34. package/dist/{rate-limits-DZXmOL8-.js → rate-limits-C5_D8Gmb.js} +1 -1
  35. package/dist/{request-BRl5_UfX.js → request-DXXGHko0.js} +2 -2
  36. package/dist/{run-attempt-P8BdxC1I.js → run-attempt-DYc0QCBF.js} +1276 -765
  37. package/dist/{runtime-artifact-BVSPdd6g.js → runtime-artifact-BvyT1uyd.js} +4 -7
  38. package/dist/{sandbox-guard-Cmwc9eIk.js → sandbox-guard-kuWTn9C5.js} +25 -19
  39. package/dist/session-binding-Bcynfd-_.js +874 -0
  40. package/dist/{session-catalog-xwNi_SDM.js → session-catalog-DaLKVtpH.js} +1534 -1288
  41. package/dist/session-catalog-home-id-BNwAJ9D7.js +18 -0
  42. package/dist/{session-cli-7hgXZDV7.js → session-cli-DMc4oS2w.js} +20 -7
  43. package/dist/session-permission-policy-BrNH1bjy.js +160 -0
  44. package/dist/{session-retirement-DoMMJFKm.js → session-retirement-CcNC3YSY.js} +3 -3
  45. package/dist/{session-upstream-marker-CrIFX06J.js → session-upstream-marker-BIkusb95.js} +1 -1
  46. package/dist/{settled-turn-finalizer-BRWBO4MO.js → settled-turn-finalizer-Dc3ApjU4.js} +24 -20
  47. package/dist/{shared-client-kIBbGjk4.js → shared-client-DKz23hHY.js} +1632 -372
  48. package/dist/{side-question-9HAL26l9.js → side-question-DjA_jsNe.js} +105 -54
  49. package/dist/{thread-lifecycle-Bu1BTDXr.js → thread-lifecycle-L7oEkTlq.js} +1147 -114
  50. package/dist/{thread-ownership-6kOQHlyC.js → thread-ownership-DZeuKH1j.js} +2 -2
  51. package/dist/{thread-resume-CPrJNQVM.js → thread-resume-BE9qNEW0.js} +3 -3
  52. package/dist/{transcript-mirror-B9gGgnJS.js → transcript-mirror-DsCMWBca.js} +137 -38
  53. package/dist/{transport-stdio-DIImwDVS.js → transport-stdio-DhoGy33Z.js} +2 -2
  54. package/dist/{upstream-prompt-provenance-ClRBije0.js → upstream-prompt-provenance-CFmsKwr9.js} +12 -14
  55. package/dist/{upstream-session-fork-CE-_LdnP.js → upstream-session-fork-DlaHxSLC.js} +12 -6
  56. package/dist/{usage-CHlV0e-o.js → usage-ROIaW3wo.js} +3 -3
  57. package/dist/{web-search-provider.runtime-DRw2Vl42.js → web-search-provider.runtime-ClaNPV7N.js} +3 -3
  58. package/openclaw.plugin.json +49 -2
  59. package/package.json +9 -8
  60. package/dist/app-server-policy-zcBDc1JU.js +0 -49
@@ -1,16 +1,18 @@
1
- import { d as sessionBindingIdentity, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-DPxIvMgE.js";
2
- import { V as consumeCodexAppServerLiveThread, a as getLeasedSharedCodexAppServerClient, ct as isJsonObject, l as releaseLeasedSharedCodexAppServerClient, q as retainCodexAppServerLiveThread, z as CodexAppServerRpcError } from "./shared-client-kIBbGjk4.js";
3
- import { _ as readCodexNotificationTurnId, a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, g as readCodexNotificationThreadId, r as CodexAppServerUnsafeSubscriptionError, s as isCodexAlreadyTerminalInterruptError } from "./attempt-client-cleanup-DMLXUfa8.js";
4
- import { i as readCodexThreadContextSnapshot, x as readCodexNotificationItem } from "./event-projector-usage-e5huIQWu.js";
1
+ import { G as CodexAppServerRpcError, J as consumeCodexAppServerLiveThread, et as retainCodexAppServerLiveThread, o as getLeasedSharedCodexAppServerClient, p as releaseLeasedSharedCodexAppServerClient, vt as isJsonObject } from "./shared-client-DKz23hHY.js";
2
+ import { d as sessionBindingIdentity, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-Bcynfd-_.js";
3
+ import { _ as readCodexNotificationTurnId, a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, g as readCodexNotificationThreadId, r as CodexAppServerUnsafeSubscriptionError, s as isCodexAlreadyTerminalInterruptError } from "./attempt-client-cleanup-bfsmcQ6m.js";
4
+ import { i as readCodexThreadContextSnapshot, x as readCodexNotificationItem } from "./event-projector-usage-Bk1I90Bg.js";
5
5
  import { t as isIncognitoSessionKey } from "./incognito-session-ET_ufDH-.js";
6
- import { t as resumeCodexAppServerThread } from "./thread-resume-CPrJNQVM.js";
7
- import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-Cmwc9eIk.js";
8
- import { t as isSameCodexAppServerThreadOwner } from "./thread-ownership-6kOQHlyC.js";
9
- import { n as resolveCodexBindingAppServerConnection } from "./binding-connection-I5Bo-AsX.js";
6
+ import { t as resumeCodexAppServerThread } from "./thread-resume-BE9qNEW0.js";
7
+ import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-kuWTn9C5.js";
8
+ import { t as isSameCodexAppServerThreadOwner } from "./thread-ownership-DZeuKH1j.js";
9
+ import { n as resolveCodexBindingAppServerConnection } from "./binding-connection-BMvPX73o.js";
10
+ import { t as persistCodexContextCompactionActivity } from "./context-compaction-activity-BOeJf7yo.js";
10
11
  import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
11
12
  import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
12
13
  import { embeddedAgentLog, resolveCompactionTimeoutMs } from "openclaw/plugin-sdk/agent-harness-runtime";
13
- import { resolveAgentDir as resolveAgentDir$1, resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime";
14
+ import { resolveAgentDir as resolveAgentDir$1 } from "openclaw/plugin-sdk/agent-runtime";
15
+ import { resolveDefaultAgentId as resolveDefaultAgentId$1 } from "openclaw/plugin-sdk/agent-scope-runtime";
14
16
  import { AsyncLocalStorage } from "node:async_hooks";
15
17
  import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
16
18
  import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
@@ -54,6 +56,8 @@ function watchCodexNativeCompactionCompletion(params) {
54
56
  };
55
57
  const complete = () => finish({
56
58
  completed: true,
59
+ ...compactionTurnId ? { turnId: compactionTurnId } : {},
60
+ ...compactionItemId ? { itemId: compactionItemId } : {},
57
61
  ...tokensAfter !== void 0 ? { tokensAfter } : {}
58
62
  });
59
63
  const fail = (reason) => finish({
@@ -235,11 +239,9 @@ function readIgnoredCompactionOverridePaths(params) {
235
239
  const ignored = /* @__PURE__ */ new Set();
236
240
  for (const entry of readCompactionOverrideEntries(params)) {
237
241
  const localProvider = typeof entry.record.provider === "string" ? entry.record.provider.trim() : "";
238
- const inheritedProvider = !localProvider && typeof entry.inheritedRecord?.provider === "string" ? entry.inheritedRecord.provider.trim() : "";
239
- const providerPath = localProvider ? `${entry.path}.compaction.provider` : inheritedProvider && entry.inheritedPath ? `${entry.inheritedPath}.compaction.provider` : void 0;
240
242
  if (typeof entry.record.model === "string" && entry.record.model.trim()) ignored.add(`${entry.path}.compaction.model`);
241
243
  if (typeof entry.record.thinkingLevel === "string" && entry.record.thinkingLevel.trim()) ignored.add(`${entry.path}.compaction.thinkingLevel`);
242
- if (providerPath) ignored.add(providerPath);
244
+ if (localProvider) ignored.add(`${entry.path}.compaction.provider`);
243
245
  }
244
246
  return [...ignored];
245
247
  }
@@ -250,17 +252,6 @@ function readCompactionOverrideEntries(params) {
250
252
  path: "agents.defaults",
251
253
  record: defaultRecord
252
254
  });
253
- const agentId = readAgentIdFromSessionKey(params.sessionKey ?? params.sandboxSessionKey);
254
- if (!agentId) return entries;
255
- const agentRecord = asOptionalRecord((Array.isArray(params.config?.agents?.list) ? params.config.agents.list : []).find((agent) => {
256
- return (typeof agent?.id === "string" ? agent.id.trim().toLowerCase() : "") === agentId;
257
- })?.compaction);
258
- if (agentRecord) entries.push({
259
- path: `agents.list.${agentId}`,
260
- record: agentRecord,
261
- inheritedRecord: defaultRecord,
262
- inheritedPath: "agents.defaults"
263
- });
264
255
  return entries;
265
256
  }
266
257
  function readAgentIdFromSessionKey(sessionKey) {
@@ -291,6 +282,7 @@ async function compactCodexNativeThread(params, options) {
291
282
  config: params.config,
292
283
  sessionKey: params.sandboxSessionKey ?? params.sessionKey,
293
284
  sessionId: params.sessionId,
285
+ agentId: params.agentId,
294
286
  sandbox,
295
287
  surface: "native compaction"
296
288
  });
@@ -325,7 +317,7 @@ async function compactCodexNativeThread(params, options) {
325
317
  let connection;
326
318
  try {
327
319
  const config = params.config ?? {};
328
- const agentId = params.agentId ?? readAgentIdFromSessionKey(params.sessionKey) ?? resolveDefaultAgentId(config);
320
+ const agentId = params.agentId ?? readAgentIdFromSessionKey(params.sessionKey) ?? resolveDefaultAgentId$1(config);
329
321
  connection = resolveCodexBindingAppServerConnection({
330
322
  binding,
331
323
  authProfileId: requestedAuthProfileId ?? binding.authProfileId,
@@ -431,27 +423,30 @@ async function compactCodexNativeThread(params, options) {
431
423
  result: skippedCodexNativeCompactionResult(params, {
432
424
  reason: "codex app-server compaction aborted before native compaction",
433
425
  code: "aborted_before_native_compaction",
426
+ request: options.nativeCompactionRequest ?? "after_context_engine",
434
427
  expectedThreadId: binding.threadId,
435
428
  currentThreadId: currentBinding?.threadId
436
429
  })
437
430
  };
438
431
  }
439
432
  if (!currentBinding || !isSameNativeCompactionBinding(currentBinding, binding)) {
440
- embeddedAgentLog.warn("skipping codex app-server compaction because the thread binding changed", {
433
+ embeddedAgentLog.warn("codex app-server compaction could not use the thread binding because it changed", {
441
434
  sessionId: params.sessionId,
442
435
  sessionKey: params.sessionKey,
443
436
  expectedThreadId: binding.threadId,
444
437
  currentThreadId: currentBinding?.threadId
445
438
  });
439
+ const isRequiredPreflight = options.nativeCompactionRequest === "required_preflight";
446
440
  return {
447
441
  started: false,
448
- result: options.allowNonManualNativeRequest ? skippedCodexNativeCompactionResult(params, {
442
+ result: options.allowNonManualNativeRequest && !isRequiredPreflight ? skippedCodexNativeCompactionResult(params, {
449
443
  reason: "codex app-server binding changed before native compaction",
450
444
  code: "binding_changed_before_native_compaction",
445
+ request: options.nativeCompactionRequest ?? "after_context_engine",
451
446
  expectedThreadId: binding.threadId,
452
447
  currentThreadId: currentBinding?.threadId
453
448
  }) : failedCodexThreadBindingCompactionResult(params, {
454
- threadId: binding.threadId,
449
+ threadId: currentBinding?.threadId ?? binding.threadId,
455
450
  reason: "codex app-server binding changed before native compaction",
456
451
  recovery: "stale_thread_binding"
457
452
  })
@@ -502,6 +497,16 @@ async function compactCodexNativeThread(params, options) {
502
497
  const completion = await completionWatch.completion;
503
498
  if (!completion.completed) throw new Error(completion.reason);
504
499
  tokensAfter = completion.tokensAfter;
500
+ if (completion.turnId && completion.itemId) await persistCodexContextCompactionActivity({
501
+ sessionTarget: params.sessionTarget,
502
+ config: params.config,
503
+ cwd: params.workspaceDir,
504
+ runId: params.runId,
505
+ threadId: binding.threadId,
506
+ turnId: completion.turnId,
507
+ itemId: completion.itemId,
508
+ timestamp: Date.now()
509
+ });
505
510
  embeddedAgentLog.info("completed codex app-server compaction", {
506
511
  sessionId: params.sessionId,
507
512
  threadId: binding.threadId
@@ -545,7 +550,7 @@ async function compactCodexNativeThread(params, options) {
545
550
  pending: false,
546
551
  completed: true,
547
552
  ...options.allowNonManualNativeRequest ? {
548
- request: "after_context_engine",
553
+ request: options.nativeCompactionRequest ?? "after_context_engine",
549
554
  trigger: params.trigger ?? "unknown"
550
555
  } : {}
551
556
  };
@@ -560,6 +565,7 @@ async function compactCodexNativeThread(params, options) {
560
565
  if (options.allowNonManualNativeRequest) return skippedCodexNativeCompactionResult(params, {
561
566
  reason: "codex app-server compaction aborted before native compaction",
562
567
  code: "aborted_before_native_compaction",
568
+ request: options.nativeCompactionRequest ?? "after_context_engine",
563
569
  expectedThreadId: initialBinding.threadId,
564
570
  currentThreadId: binding.threadId
565
571
  });
@@ -594,7 +600,7 @@ function skippedCodexNativeCompactionResult(params, skipped) {
594
600
  backend: "codex-app-server",
595
601
  skipped: true,
596
602
  reason: skipped.code,
597
- request: "after_context_engine",
603
+ request: skipped.request ?? "after_context_engine",
598
604
  trigger: params.trigger ?? "unknown",
599
605
  ...skipped.expectedThreadId ? { expectedThreadId: skipped.expectedThreadId } : {},
600
606
  ...skipped.currentThreadId ? { currentThreadId: skipped.currentThreadId } : {}