@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
@@ -0,0 +1,58 @@
1
+ import { embeddedAgentLog, formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
2
+ import { appendSessionTranscriptMessageByIdentity, publishSessionTranscriptUpdateByIdentity } from "openclaw/plugin-sdk/session-transcript-runtime";
3
+ //#region extensions/codex/src/app-server/context-compaction-activity.ts
4
+ const CONTEXT_COMPACTION_CUSTOM_TYPE = "openclaw.context-compaction";
5
+ async function persistCodexContextCompactionActivity(params) {
6
+ const target = params.sessionTarget;
7
+ if (!target?.sessionId || !target.sessionKey || !target.storePath) return;
8
+ const activityId = `codex-context-compaction:${params.threadId}:${params.turnId}:${params.itemId}`;
9
+ const message = {
10
+ role: "custom",
11
+ customType: CONTEXT_COMPACTION_CUSTOM_TYPE,
12
+ content: "Context compacted",
13
+ display: true,
14
+ excludeFromContext: true,
15
+ details: {
16
+ kind: "context_compaction",
17
+ backend: "codex-app-server",
18
+ threadId: params.threadId,
19
+ turnId: params.turnId,
20
+ itemId: params.itemId,
21
+ ...params.runId ? { runId: params.runId } : {}
22
+ },
23
+ ...params.runId ? { __openclaw: { runId: params.runId } } : {},
24
+ timestamp: params.timestamp,
25
+ idempotencyKey: activityId
26
+ };
27
+ try {
28
+ const appended = await appendSessionTranscriptMessageByIdentity({
29
+ agentId: target.agentId,
30
+ sessionId: target.sessionId,
31
+ sessionKey: target.sessionKey,
32
+ storePath: target.storePath,
33
+ config: params.config,
34
+ cwd: params.cwd,
35
+ eventId: activityId,
36
+ message
37
+ });
38
+ if (!appended?.appended) return;
39
+ await publishSessionTranscriptUpdateByIdentity({
40
+ agentId: target.agentId,
41
+ sessionId: target.sessionId,
42
+ sessionKey: target.sessionKey,
43
+ storePath: target.storePath,
44
+ update: {
45
+ message: appended.message,
46
+ messageId: appended.messageId,
47
+ ...params.runId ? { runId: params.runId } : {}
48
+ }
49
+ });
50
+ } catch (error) {
51
+ embeddedAgentLog.warn("failed to persist codex context compaction activity", {
52
+ error: formatErrorMessage(error),
53
+ itemId: params.itemId
54
+ });
55
+ }
56
+ }
57
+ //#endregion
58
+ export { persistCodexContextCompactionActivity as t };
@@ -3,8 +3,10 @@ import { asNullableRecord, isRecord } from "openclaw/plugin-sdk/string-coerce-ru
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import { isDeepStrictEqual } from "node:util";
6
- import { canonicalPathFromExistingAncestor, isPathInside, pathExists } from "openclaw/plugin-sdk/security-runtime";
7
6
  import { listAgentIds, resolveAgentDir, resolveSessionAgentIds } from "openclaw/plugin-sdk/agent-scope-runtime";
7
+ import { pathExists } from "openclaw/plugin-sdk/security-runtime";
8
+ import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
9
+ import { canonicalPathFromExistingAncestor, isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
8
10
  import { withFileLock } from "openclaw/plugin-sdk/file-lock";
9
11
  import { archiveLegacyStateSource, legacyStateFileExists } from "openclaw/plugin-sdk/runtime-doctor-migrations";
10
12
  //#region extensions/codex/src/migration/session-binding-sidecars.ts
@@ -242,24 +244,23 @@ async function resolveLegacySessionFileLocator(sessionsDir, entry, sessionId) {
242
244
  if (!isPathInside(canonicalBase, canonicalCandidate)) throw new Error("legacy session file locator escapes its session directory");
243
245
  return candidate;
244
246
  }
245
- function resolveLegacyBindingOwnerAgentId(params) {
247
+ function tryResolveLegacyBindingOwnerAgentId(params) {
246
248
  if (params.sessionKey.trim().toLowerCase().startsWith("agent:")) return resolveSessionAgentIds({
247
249
  sessionKey: params.sessionKey,
248
250
  config: params.config
249
251
  }).sessionAgentId;
250
252
  const storeAgentId = params.storeAgentIds?.size === 1 ? [...params.storeAgentIds][0] : void 0;
251
- return resolveSessionAgentIds({
252
- sessionKey: params.sessionKey,
253
- config: params.config,
254
- ...storeAgentId ? { agentId: storeAgentId } : {}
255
- }).sessionAgentId;
256
- }
257
- function tryResolveLegacyBindingOwnerAgentId(params) {
258
- try {
259
- return resolveLegacyBindingOwnerAgentId(params);
253
+ const configuredAgentId = params.config.agents?.defaults?.systemAgent?.agentId?.trim();
254
+ const systemAgentId = !storeAgentId && configuredAgentId ? normalizeAgentId(configuredAgentId) : void 0;
255
+ const fallbackAgentIds = systemAgentId && listAgentIds(params.config).includes(systemAgentId) ? [void 0, systemAgentId] : [void 0];
256
+ for (const fallbackAgentId of fallbackAgentIds) try {
257
+ return resolveSessionAgentIds({
258
+ sessionKey: params.sessionKey,
259
+ config: params.config,
260
+ ...storeAgentId ? { agentId: storeAgentId } : fallbackAgentId ? { fallbackAgentId } : {}
261
+ }).sessionAgentId;
260
262
  } catch (error) {
261
- if (error.code === "AGENT_SELECTION_REQUIRED") return;
262
- throw error;
263
+ if (error.code !== "AGENT_SELECTION_REQUIRED") throw error;
263
264
  }
264
265
  }
265
266
  function copyBindingForSession(stored, sessionId) {
@@ -292,7 +293,7 @@ async function migrateSource(source, candidates, params, store) {
292
293
  return await withFileLock(source.sidecarPath, LEGACY_BINDING_LOCK_OPTIONS, async () => {
293
294
  const [contents, stat] = await Promise.all([fs.readFile(source.sidecarPath, "utf8"), fs.stat(source.sidecarPath)]);
294
295
  const raw = JSON.parse(contents);
295
- const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-DPxIvMgE.js").then((n) => n.f), import("./conversation-binding-data-CW2GuupV.js").then((n) => n.t)]);
296
+ const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-Bcynfd-_.js").then((n) => n.f), import("./conversation-binding-data-CW2GuupV.js").then((n) => n.t)]);
296
297
  const agentId = owner?.agentId ?? (source.agentIds.size === 1 ? [...source.agentIds][0] : void 0);
297
298
  const baseStored = createStoredCodexAppServerBinding(raw, {
298
299
  now: stat.mtime.toISOString(),
@@ -536,8 +537,9 @@ function hasLegacyPluginDestructivePolicy(value) {
536
537
  const plugins = asNullableRecord(codexPlugins.plugins);
537
538
  return Object.values(plugins ?? {}).some((plugin) => asNullableRecord(plugin)?.allow_destructive_actions === "on-request");
538
539
  }
539
- function hasRetiredOnFailureApprovalPolicy(value) {
540
- return asNullableRecord(value)?.approvalPolicy === "on-failure";
540
+ function hasRetiredApprovalPolicy(value) {
541
+ const approvalPolicy = asNullableRecord(value)?.approvalPolicy;
542
+ return approvalPolicy === "on-failure" || approvalPolicy === "untrusted";
541
543
  }
542
544
  /** Legacy Codex config keys that doctor should report or repair. */
543
545
  const legacyConfigRules = [
@@ -570,8 +572,8 @@ const legacyConfigRules = [
570
572
  "config",
571
573
  "appServer"
572
574
  ],
573
- message: "plugins.entries.codex.config.appServer.approvalPolicy=\"on-failure\" was retired by Codex 0.143; use \"on-request\". Run \"openclaw doctor --fix\".",
574
- match: hasRetiredOnFailureApprovalPolicy
575
+ message: "plugins.entries.codex.config.appServer.approvalPolicy values \"on-failure\" and \"untrusted\" are retired; use \"on-request\". Run \"openclaw doctor --fix\".",
576
+ match: hasRetiredApprovalPolicy
575
577
  }
576
578
  ];
577
579
  /**
@@ -583,7 +585,7 @@ function normalizeCompatibilityConfig({ cfg }) {
583
585
  const rawAppServer = asNullableRecord(rawPluginConfig?.appServer);
584
586
  const shouldRemoveDynamicToolsProfile = rawPluginConfig !== null && hasRetiredDynamicToolsProfile(rawPluginConfig);
585
587
  const shouldRewriteDestructivePolicy = hasLegacyPluginDestructivePolicy(rawCodexPlugins);
586
- const shouldRewriteApprovalPolicy = hasRetiredOnFailureApprovalPolicy(rawAppServer);
588
+ const shouldRewriteApprovalPolicy = hasRetiredApprovalPolicy(rawAppServer);
587
589
  if (!rawPluginConfig || !shouldRemoveDynamicToolsProfile && !shouldRewriteDestructivePolicy && !shouldRewriteApprovalPolicy) return {
588
590
  config: cfg,
589
591
  changes: []
@@ -611,8 +613,8 @@ function normalizeCompatibilityConfig({ cfg }) {
611
613
  }
612
614
  if (shouldRewriteApprovalPolicy) {
613
615
  const nextAppServer = asNullableRecord(nextPluginConfig.appServer);
614
- if (nextAppServer?.approvalPolicy === "on-failure") nextAppServer.approvalPolicy = "on-request";
615
- changes.push("Renamed plugins.entries.codex.config.appServer.approvalPolicy=\"on-failure\" to \"on-request\".");
616
+ if (nextAppServer?.approvalPolicy === "on-failure" || nextAppServer?.approvalPolicy === "untrusted") nextAppServer.approvalPolicy = "on-request";
617
+ changes.push("Renamed retired plugins.entries.codex.config.appServer.approvalPolicy to \"on-request\".");
616
618
  }
617
619
  return {
618
620
  config: nextConfig,