@openclaw/codex 2026.9.5 → 2026.9.6

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 (120) hide show
  1. package/dist/.setup/{account-usage-runtime-C2MOIvfq.mjs → account-usage-runtime-Eem_WGqY.mjs} +5 -5
  2. package/dist/.setup/{apply-CJ0ZfmBG.mjs → apply-DDOi8uNx.mjs} +22 -28
  3. package/dist/.setup/{attempt-client-cleanup-BpYKdTA0.mjs → attempt-client-cleanup-CEv1cKwF.mjs} +58 -43
  4. package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +331 -0
  5. package/dist/.setup/{auth-cache-key-QirmgiCo.mjs → auth-cache-key-B2mpaI9D.mjs} +9 -81
  6. package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
  7. package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
  8. package/dist/.setup/{binding-connection-Bm38niE8.mjs → binding-connection-ThoatDcb.mjs} +1 -1
  9. package/dist/.setup/{binding-connection.runtime-CnRMC0ta.mjs → binding-connection.runtime-yoHrABt-.mjs} +4 -4
  10. package/dist/.setup/{bounded-turn-BtlZcivC.mjs → bounded-turn-B2HScEgT.mjs} +138 -32
  11. package/dist/.setup/{build-state-Xx9ybZqa.mjs → build-state-C7EnDVgr.mjs} +1 -1
  12. package/dist/.setup/{capabilities-_vXcZGSx.mjs → capabilities-CDXOOFdZ.mjs} +1 -1
  13. package/dist/.setup/{client-vXs2929Q.mjs → client-Cs08OXVQ.mjs} +583 -559
  14. package/dist/.setup/client-catalog-response-BMgt_4q4.mjs +285 -0
  15. package/dist/.setup/{command-dispatch-naHIZwwF.mjs → command-dispatch-B4JuOsOk.mjs} +8 -4
  16. package/dist/.setup/{command-formatters-CGEkdawF.mjs → command-formatters-Bmqvr9tO.mjs} +8 -4
  17. package/dist/.setup/{command-handlers-BtAJEW1X.mjs → command-handlers-DW7Lx9oH.mjs} +106 -172
  18. package/dist/.setup/{command-rpc-DHFpn4le.mjs → command-rpc-DixIj3HW.mjs} +36 -21
  19. package/dist/.setup/{compact-C3i3qlzj.mjs → compact-Du5UvtxA.mjs} +14 -21
  20. package/dist/.setup/{config-CedDWjM-.mjs → config-BoTP_mrL.mjs} +3 -3
  21. package/dist/.setup/{config-options-BsanJ8QG.mjs → config-options-BvaRs51b.mjs} +46 -30
  22. package/dist/.setup/{config-runtime-CeAhl_h4.mjs → config-runtime-C8Rw1m1m.mjs} +1 -1
  23. package/dist/.setup/{config-security-BRQ2mgW9.mjs → config-security-BEReZ6go.mjs} +35 -120
  24. package/dist/.setup/{conversation-binding-DhzrpTM6.mjs → conversation-binding-DP-gMrBP.mjs} +21 -32
  25. package/dist/.setup/{conversation-control-DN53ns41.mjs → conversation-control-uK9Jomlc.mjs} +28 -67
  26. package/dist/.setup/{dynamic-tools-D16lOp67.mjs → dynamic-tools-BDXl-8Cw.mjs} +848 -578
  27. package/dist/.setup/{effective-mcp-catalog-K6kLCN8X.mjs → effective-mcp-catalog-CvnvnGIe.mjs} +3 -3
  28. package/dist/.setup/{ephemeral-turn-R1gA8Sn6.mjs → ephemeral-turn-poidXgek.mjs} +9 -6
  29. package/dist/.setup/{event-projector-assistant-message-DNUR1s0A.mjs → event-projector-assistant-message-BsruvNrH.mjs} +2 -4
  30. package/dist/.setup/{event-projector-items-DyTQ_XqL.mjs → event-projector-items-C6L_5ZiT.mjs} +42 -8
  31. package/dist/.setup/{event-projector-usage-C7Ntzs-f.mjs → event-projector-usage-CnBS8Wa3.mjs} +1 -1
  32. package/dist/.setup/{harness-rxaaoN-o.mjs → harness-a_MsE4-_.mjs} +23 -17
  33. package/dist/.setup/{inference-context-fulhZuz8.mjs → inference-context-D96l9-ew.mjs} +1 -1
  34. package/dist/.setup/inference-proxy-b-aJMSxm.mjs +601 -0
  35. package/dist/.setup/{isolated-completion-B6srt48J.mjs → isolated-completion-BIZFhTNG.mjs} +17 -10
  36. package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
  37. package/dist/.setup/{managed-binary-DP6Rib3P.mjs → managed-binary-BnshlFag.mjs} +13 -2
  38. package/dist/.setup/{model-catalog-DkvUuBey.mjs → model-catalog-CfXJf9Ay.mjs} +9 -10
  39. package/dist/.setup/{models-BDFgm_G-.mjs → models-KnqBv0hE.mjs} +3 -3
  40. package/dist/.setup/{native-auth-BLZGqFjw.mjs → native-auth-rWbGbMn3.mjs} +4 -4
  41. package/dist/.setup/{native-subagent-history-YXaL6dMd.mjs → native-subagent-history-0nYYgo0k.mjs} +26 -13
  42. package/dist/.setup/{native-subagent-monitor-B1hxzIOy.mjs → native-subagent-monitor-D3filLY2.mjs} +145 -317
  43. package/dist/.setup/{native-subagent-task-ids-DsuOonKv.mjs → native-subagent-task-ids-wb8CKZGN.mjs} +69 -39
  44. package/dist/.setup/{node-cli-sessions-Cl8b2ZF3.mjs → node-cli-sessions-r3avj02l.mjs} +86 -68
  45. package/dist/.setup/node-exec-server.runtime-BDwWXVpK.mjs +247 -0
  46. package/dist/.setup/{plan-xD7WKYTM.mjs → plan-CN3VwfNU.mjs} +74 -76
  47. package/dist/.setup/{plugin-activation-r8nq5Jzp.mjs → plugin-activation-DT3MNtqj.mjs} +7 -16
  48. package/dist/.setup/{plugin-app-cache-key-BOxKP7db.mjs → plugin-app-cache-key-B2CsSdnV.mjs} +4 -20
  49. package/dist/.setup/{plugin-approval-roundtrip-CjfzafAZ.mjs → plugin-approval-roundtrip-C0MZzCuP.mjs} +1 -1
  50. package/dist/.setup/{plugin-inventory-DUle8DLz.mjs → plugin-inventory-BoRei8Z4.mjs} +16 -7
  51. package/dist/.setup/{plugin-marketplace-discovery-P-Vndfqq.mjs → plugin-marketplace-discovery-CDOi8IFs.mjs} +4 -1
  52. package/dist/.setup/{plugin-metadata-cache-DsS5buNa.mjs → plugin-metadata-cache-Ctmo83k_.mjs} +224 -154
  53. package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
  54. package/dist/.setup/{provider-fFh_-VR3.mjs → provider-BOsxQHOM.mjs} +9 -5
  55. package/dist/.setup/{provider-capabilities-B8J4Dy-O.mjs → provider-capabilities-BfE88FZ5.mjs} +31 -3
  56. package/dist/.setup/{rate-limits-DOEGYRNs.mjs → rate-limits-CMU3DUD0.mjs} +116 -137
  57. package/dist/.setup/{request-BioXJLYa.mjs → request-D2L0zMrq.mjs} +23 -15
  58. package/dist/.setup/{run-attempt-rlA07pUv.mjs → run-attempt-BHu11r7h.mjs} +1197 -617
  59. package/dist/.setup/{runtime-artifact-Dy38Z5iU.mjs → runtime-artifact-CLZ8udh-.mjs} +29 -45
  60. package/dist/.setup/{sandbox-guard-BBP-RbTf.mjs → sandbox-guard-C2sRMOEY.mjs} +1 -1
  61. package/dist/.setup/{session-binding-_0W_fHRr.mjs → session-binding-Cm0apEbd.mjs} +3 -32
  62. package/dist/.setup/{session-binding-record-TH3xA0zj.mjs → session-binding-record-BGoz8wOK.mjs} +22 -3
  63. package/dist/.setup/{session-binding-sidecars-CKYEcfNn.mjs → session-binding-sidecars-BlB5EvIS.mjs} +48 -45
  64. package/dist/.setup/{session-catalog-fUdWDx-U.mjs → session-catalog-Pno1xGcl.mjs} +482 -182
  65. package/dist/.setup/{session-catalog-adoption-CR_whkEW.mjs → session-catalog-adoption-BI6UTDZT.mjs} +57 -25
  66. package/dist/.setup/{session-catalog-archive-CwZaPacf.mjs → session-catalog-archive-lHBqzhaO.mjs} +6 -6
  67. package/dist/.setup/{session-catalog-events-jMcYfQyd.mjs → session-catalog-events-Bj6j94E_.mjs} +122 -25
  68. package/dist/.setup/{session-catalog-index-B141u15s.mjs → session-catalog-index-B9_VQIUz.mjs} +178 -78
  69. package/dist/.setup/{session-catalog-index-order-Cc5BzlQr.mjs → session-catalog-index-order-hcdz07yN.mjs} +2 -2
  70. package/dist/.setup/{session-catalog-index-state-BAuDztHN.mjs → session-catalog-index-state-Dgh8ORJm.mjs} +5 -2
  71. package/dist/.setup/{session-catalog-native-projection-ChV3cCtm.mjs → session-catalog-native-projection-DowriLid.mjs} +30 -13
  72. package/dist/.setup/{session-catalog-node-adoption-BVRsYOSh.mjs → session-catalog-node-adoption-ITddWx_X.mjs} +24 -12
  73. package/dist/.setup/{session-catalog-node-continue-Dowv8osw.mjs → session-catalog-node-continue-6g6qi4A9.mjs} +22 -13
  74. package/dist/.setup/{session-catalog-projection-C1Bj9Jl-.mjs → session-catalog-projection-zK_PUsiE.mjs} +13 -5
  75. package/dist/.setup/{session-cli-DIj-IE-E.mjs → session-cli-irrD-uo7.mjs} +4 -4
  76. package/dist/.setup/{session-history-C--SrLI8.mjs → session-history-BrqhSCf9.mjs} +17 -22
  77. package/dist/.setup/{session-history-import-JHXT5Xfi.mjs → session-history-import-D-3wAgOP.mjs} +4 -4
  78. package/dist/.setup/{session-history.worker-CpNj7H_P.mjs → session-history.worker-CaCh0xF_.mjs} +5 -18
  79. package/dist/.setup/{session-initialization-DH1z6fXn.mjs → session-initialization-rcgbZiid.mjs} +2 -2
  80. package/dist/.setup/{session-permission-policy-DhurXY0l.mjs → session-permission-policy-BI1QK_98.mjs} +2 -2
  81. package/dist/.setup/{session-retirement-CU87AOg9.mjs → session-retirement-BH-S6qkJ.mjs} +25 -6
  82. package/dist/.setup/{settled-turn-finalizer-CiY2bLFK.mjs → settled-turn-finalizer-DiAi6Kx6.mjs} +8 -8
  83. package/dist/.setup/{shared-client-BpTtuLQ5.mjs → shared-client-DA4VR4Eb.mjs} +59 -89
  84. package/dist/.setup/{side-question-DSCZyoBD.mjs → side-question-BJ1wSDcB.mjs} +147 -211
  85. package/dist/.setup/{source-Bjp4UQij.mjs → source-CUzJq5WN.mjs} +9 -9
  86. package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
  87. package/dist/.setup/{thread-archive-guard-jmecf6OJ.mjs → thread-archive-guard-C9frICzX.mjs} +10 -3
  88. package/dist/.setup/{thread-history-page-BTx-4xsg.mjs → thread-history-page-DoVpnHim.mjs} +1 -1
  89. package/dist/.setup/{thread-lifecycle-Cik28qWn.mjs → thread-lifecycle-B3mfz1TG.mjs} +172 -2271
  90. package/dist/.setup/{thread-ownership-skomxnIt.mjs → thread-ownership-DcTtAcXj.mjs} +4 -2
  91. package/dist/.setup/{thread-policy-Cjs4B8xf.mjs → thread-policy-DGuQsuFC.mjs} +19 -3
  92. package/dist/.setup/thread-requests-BLvGkP2R.mjs +2205 -0
  93. package/dist/.setup/{thread-resume-BkNpj9Pz.mjs → thread-resume-DIBXwOpE.mjs} +6 -6
  94. package/dist/.setup/{timeout-DZF05XrR.mjs → timeout-C910MdAB.mjs} +19 -2
  95. package/dist/.setup/{transcript-history-projection-DHNBDhCU.mjs → transcript-history-projection-ZZpkFkJ_.mjs} +94 -64
  96. package/dist/.setup/{transcript-mirror-D4qp_leP.mjs → transcript-mirror-BtHDBp1G.mjs} +218 -198
  97. package/dist/.setup/{transport-stdio-Cmx94Oiy.mjs → transport-stdio-h2VHOskC.mjs} +135 -55
  98. package/dist/.setup/{upstream-session-fork-D3UKxgVD.mjs → upstream-session-fork-BUr4OUbC.mjs} +44 -36
  99. package/dist/.setup/{usage-BOgBEKso.mjs → usage-BML0r-ua.mjs} +5 -4
  100. package/dist/.setup/{usage-limit-error-C0ow7DOc.mjs → usage-limit-error-DUMbefVY.mjs} +4 -4
  101. package/dist/.setup/{web-search-provider.runtime-CTGuJt6i.mjs → web-search-provider.runtime-CDKlN-Rv.mjs} +4 -3
  102. package/dist/api.js +23 -12
  103. package/dist/catalog-page-worker-entrypoint.js +12 -0
  104. package/dist/catalog-page.worker.js +9 -0
  105. package/dist/cli-metadata.js +1 -1
  106. package/dist/doctor-contract-api.js +2 -2
  107. package/dist/harness.js +1 -1
  108. package/dist/index.js +221 -170
  109. package/dist/media-understanding-provider.js +2 -2
  110. package/dist/migration-provider-api.js +1 -1
  111. package/dist/provider-discovery.js +1 -1
  112. package/dist/session-history-worker-runtime.js +15 -32
  113. package/dist/session-history.worker.js +1 -1
  114. package/package.json +9 -6
  115. package/dist/.setup/attempt-context-VXVwTCfS.mjs +0 -636
  116. package/dist/.setup/inference-proxy-CC15HuSi.mjs +0 -311
  117. package/dist/.setup/launch-args-DnMak49W.mjs +0 -111
  118. package/dist/.setup/node-exec-server.runtime-BaViBKNz.mjs +0 -226
  119. package/dist/.setup/version-CoqzXPgK.mjs +0 -12
  120. package/dist/.setup/{native-execution-policy-YBMHSzC4.mjs → native-execution-policy-umd0tgh4.mjs} +1 -1
@@ -1,4 +1,4 @@
1
- import { g as CatalogParamsError } from "./session-catalog-native-projection-ChV3cCtm.mjs";
1
+ import { v as CatalogParamsError } from "./session-catalog-native-projection-DowriLid.mjs";
2
2
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
4
4
  import { listSessionCatalogEntries, sessionCatalogAdoptedSessionKey, sessionCatalogAdoptedSourceKey } from "openclaw/plugin-sdk/session-catalog";
@@ -21,17 +21,25 @@ function adoptionSessionKeyRest(sessionKey) {
21
21
  const trimmed = sessionKey.trim();
22
22
  return parseAgentSessionKey(trimmed)?.rest ?? trimmed;
23
23
  }
24
- function nodeAdoptionSessionKey(hostId, threadId) {
25
- const source = JSON.stringify([hostId, threadId]);
24
+ function nodeAdoptedSourceKey(hostId, threadId, sourceHomeId) {
25
+ return sessionCatalogAdoptedSourceKey(JSON.stringify([hostId, sourceHomeId]), threadId);
26
+ }
27
+ function nodeAdoptionSessionKey(hostId, threadId, sourceHomeId) {
28
+ const source = JSON.stringify([
29
+ hostId,
30
+ sourceHomeId,
31
+ threadId
32
+ ]);
26
33
  return sessionCatalogAdoptedSessionKey(CODEX_NODE_SESSION_KEY_PREFIX, source);
27
34
  }
28
35
  function readNodeSessionMarker(entry) {
29
36
  const codex = isRecord(entry.pluginExtensions?.codex) ? entry.pluginExtensions.codex : void 0;
30
37
  const marker = codex && isRecord(codex.sessionCatalog) ? codex.sessionCatalog : void 0;
31
- if (!marker || typeof marker.sourceHostId !== "string" || !marker.sourceHostId.startsWith("node:") || typeof marker.sourceThreadId !== "string" || !marker.sourceThreadId.trim() || typeof marker.nodeId !== "string" || !marker.nodeId.trim()) return;
38
+ if (!marker || typeof marker.sourceHostId !== "string" || !marker.sourceHostId.startsWith("node:") || typeof marker.sourceThreadId !== "string" || !marker.sourceThreadId.trim() || typeof marker.nodeId !== "string" || !marker.nodeId.trim() || marker.sourceHomeId !== void 0 && (typeof marker.sourceHomeId !== "string" || !marker.sourceHomeId.trim() || marker.sourceHomeId.length > 256)) return;
32
39
  return {
33
40
  sourceHostId: marker.sourceHostId,
34
41
  sourceThreadId: marker.sourceThreadId,
42
+ ...typeof marker.sourceHomeId === "string" ? { sourceHomeId: marker.sourceHomeId } : {},
35
43
  nodeId: marker.nodeId,
36
44
  ...marker.initializing === true ? { initializing: true } : {}
37
45
  };
@@ -46,8 +54,8 @@ function listNodeAdoptedSessionEntries(params) {
46
54
  })) {
47
55
  const marker = readNodeSessionMarker(entry);
48
56
  const sessionId = entry.sessionId?.trim();
49
- if (!marker || marker.initializing === true && params.includeInitializing !== true || entry.initializationPending === true || entry.agentHarnessId !== "codex" || entry.modelSelectionLocked !== true || !sessionId || adoptionSessionKeyRest(sessionKey) !== nodeAdoptionSessionKey(marker.sourceHostId, marker.sourceThreadId) || marker.sourceHostId !== `node:${marker.nodeId}`) continue;
50
- const sourceKey = sessionCatalogAdoptedSourceKey(marker.sourceHostId, marker.sourceThreadId);
57
+ if (!marker || !marker.sourceHomeId || marker.initializing === true && params.includeInitializing !== true || entry.initializationPending === true || entry.agentHarnessId !== "codex" || entry.modelSelectionLocked !== true || !sessionId || adoptionSessionKeyRest(sessionKey) !== nodeAdoptionSessionKey(marker.sourceHostId, marker.sourceThreadId, marker.sourceHomeId) || marker.sourceHostId !== `node:${marker.nodeId}`) continue;
58
+ const sourceKey = nodeAdoptedSourceKey(marker.sourceHostId, marker.sourceThreadId, marker.sourceHomeId);
51
59
  if (adopted.has(sourceKey)) throw new Error(`multiple OpenClaw sessions adopt Codex thread ${marker.sourceThreadId} on ${marker.sourceHostId}`);
52
60
  adopted.set(sourceKey, {
53
61
  key: sessionKey,
@@ -59,12 +67,13 @@ function listNodeAdoptedSessionEntries(params) {
59
67
  return adopted;
60
68
  }
61
69
  function findNodeAdoptedSessionEntry(params) {
62
- return listNodeAdoptedSessionEntries(params).get(sessionCatalogAdoptedSourceKey(params.hostId, params.threadId));
70
+ return listNodeAdoptedSessionEntries(params).get(nodeAdoptedSourceKey(params.hostId, params.threadId, params.sourceHomeId));
63
71
  }
64
72
  function nodeSessionMarker(params) {
65
73
  return {
66
74
  sourceHostId: params.hostId,
67
75
  sourceThreadId: params.threadId,
76
+ sourceHomeId: params.sourceHomeId,
68
77
  nodeId: params.nodeId,
69
78
  ...params.initializing === true ? { initializing: true } : {}
70
79
  };
@@ -79,7 +88,7 @@ async function finalizeNodeAdoptedSession(params) {
79
88
  preserveActivity: true,
80
89
  update: (entry) => {
81
90
  const current = readNodeSessionMarker(entry);
82
- if (entry.sessionId?.trim() !== params.adopted.sessionId || entry.initializationPending === true || entry.agentHarnessId !== "codex" || entry.modelSelectionLocked !== true || !current || current.sourceHostId !== params.marker.sourceHostId || current.sourceThreadId !== params.marker.sourceThreadId || current.nodeId !== params.marker.nodeId) throw changedError();
91
+ if (entry.sessionId?.trim() !== params.adopted.sessionId || entry.initializationPending === true || entry.agentHarnessId !== "codex" || entry.modelSelectionLocked !== true || !current || current.sourceHostId !== params.marker.sourceHostId || current.sourceThreadId !== params.marker.sourceThreadId || current.sourceHomeId !== params.marker.sourceHomeId || current.nodeId !== params.marker.nodeId) throw changedError();
83
92
  if (current.initializing !== true) return {
84
93
  archivedAt: void 0,
85
94
  archivedBy: void 0,
@@ -106,7 +115,7 @@ async function finalizeNodeAdoptedSession(params) {
106
115
  readConsistency: "latest"
107
116
  });
108
117
  const current = currentEntry ? readNodeSessionMarker(currentEntry) : void 0;
109
- if (currentEntry?.sessionId?.trim() === params.adopted.sessionId && current?.initializing !== true && current?.sourceHostId === params.marker.sourceHostId && current.sourceThreadId === params.marker.sourceThreadId && current.nodeId === params.marker.nodeId) return;
118
+ if (currentEntry?.sessionId?.trim() === params.adopted.sessionId && current?.initializing !== true && current?.sourceHostId === params.marker.sourceHostId && current.sourceThreadId === params.marker.sourceThreadId && current.sourceHomeId === params.marker.sourceHomeId && current.nodeId === params.marker.nodeId) return;
110
119
  throw error;
111
120
  }
112
121
  if (!finalized) throw changedError();
@@ -118,6 +127,7 @@ async function createOrReuseNodeAdoptedSession(params) {
118
127
  runtime: params.api.runtime,
119
128
  hostId: params.hostId,
120
129
  threadId: params.record.threadId,
130
+ sourceHomeId: params.sourceHomeId,
121
131
  includeInitializing: true
122
132
  });
123
133
  if (existing) return existing;
@@ -125,6 +135,7 @@ async function createOrReuseNodeAdoptedSession(params) {
125
135
  ...nodeSessionMarker({
126
136
  hostId: params.hostId,
127
137
  threadId: params.record.threadId,
138
+ sourceHomeId: params.sourceHomeId,
128
139
  nodeId: params.nodeId
129
140
  }),
130
141
  initializing: true
@@ -132,7 +143,7 @@ async function createOrReuseNodeAdoptedSession(params) {
132
143
  try {
133
144
  const created = await params.api.runtime.agent.session.createSessionEntry({
134
145
  cfg: params.config,
135
- key: nodeAdoptionSessionKey(params.hostId, params.record.threadId),
146
+ key: nodeAdoptionSessionKey(params.hostId, params.record.threadId, params.sourceHomeId),
136
147
  agentId: params.agentId,
137
148
  recoverMatchingInitialEntry: true,
138
149
  displayName: params.record.name ?? void 0,
@@ -144,7 +155,7 @@ async function createOrReuseNodeAdoptedSession(params) {
144
155
  },
145
156
  afterCreate: async (entry) => {
146
157
  const storePath = resolveStorePath(params.config.session?.store, { agentId: entry.agentId });
147
- const { importCodexThreadHistoryToTranscript } = await import("./transcript-mirror-D4qp_leP.mjs").then((n) => n.a);
158
+ const { importCodexThreadHistoryToTranscript } = await import("./transcript-mirror-BtHDBp1G.mjs").then((n) => n.a);
148
159
  await importCodexThreadHistoryToTranscript({
149
160
  thread: params.history.thread,
150
161
  throughTurnId: params.history.throughTurnId,
@@ -172,6 +183,7 @@ async function createOrReuseNodeAdoptedSession(params) {
172
183
  runtime: params.api.runtime,
173
184
  hostId: params.hostId,
174
185
  threadId: params.record.threadId,
186
+ sourceHomeId: params.sourceHomeId,
175
187
  includeInitializing: true
176
188
  });
177
189
  if (raced) return raced;
@@ -179,4 +191,4 @@ async function createOrReuseNodeAdoptedSession(params) {
179
191
  }
180
192
  }
181
193
  //#endregion
182
- export { adoptionSessionKeyRest, continueOperations, createOrReuseNodeAdoptedSession, finalizeNodeAdoptedSession, findNodeAdoptedSessionEntry, listNodeAdoptedSessionEntries, nodeSessionMarker, runSessionActionExclusive };
194
+ export { CODEX_NODE_SESSION_KEY_PREFIX, adoptionSessionKeyRest, continueOperations, createOrReuseNodeAdoptedSession, finalizeNodeAdoptedSession, findNodeAdoptedSessionEntry, listNodeAdoptedSessionEntries, nodeAdoptedSourceKey, nodeSessionMarker, readNodeSessionMarker, runSessionActionExclusive };
@@ -1,10 +1,10 @@
1
- import { A as parseTranscriptPage, B as unwrapNodeInvokePayload, E as isInteractiveThreadSource, O as parseCatalogPage, S as catalogError, T as filterCatalogPageByTitle, b as NODE_INVOKE_TIMEOUT_MS, f as CODEX_APP_SERVER_THREADS_LIST_COMMAND, g as CatalogParamsError, p as CODEX_APP_SERVER_THREAD_TURNS_LIST_COMMAND, x as boundedCatalogString } from "./session-catalog-native-projection-ChV3cCtm.mjs";
1
+ import { A as parseCatalogPage, C as boundedCatalogString, D as filterCatalogPageByTitle, H as unwrapNodeInvokePayload, M as parseTranscriptPage, O as isInteractiveThreadSource, S as NODE_INVOKE_TIMEOUT_MS, h as CODEX_APP_SERVER_THREAD_TURNS_LIST_COMMAND, m as CODEX_APP_SERVER_THREADS_LIST_COMMAND, v as CatalogParamsError, w as catalogError } from "./session-catalog-native-projection-DowriLid.mjs";
2
2
  import { n as createCodexCliNodeConversationBindingData } from "./conversation-binding-data-CrcyZk6O.mjs";
3
- import { n as withTimeout } from "./timeout-DZF05XrR.mjs";
4
- import { t as CODEX_CLI_SESSION_RESUME_COMMAND } from "./node-cli-sessions-Cl8b2ZF3.mjs";
5
- import { o as lookupNodeCodexCatalogRecord } from "./session-catalog-fUdWDx-U.mjs";
3
+ import { i as withTimeout } from "./timeout-C910MdAB.mjs";
4
+ import { r as CODEX_CLI_SESSION_SOURCE_UPGRADE_MESSAGE, t as CODEX_CLI_SESSION_RESUME_COMMAND } from "./node-cli-sessions-r3avj02l.mjs";
5
+ import { o as lookupNodeCodexCatalogRecord } from "./session-catalog-Pno1xGcl.mjs";
6
6
  import { t as codexLastTerminalTurnId } from "./session-upstream-marker-D15C9NHp.mjs";
7
- import { createOrReuseNodeAdoptedSession, finalizeNodeAdoptedSession, findNodeAdoptedSessionEntry, nodeSessionMarker, runSessionActionExclusive } from "./session-catalog-node-adoption-BVRsYOSh.mjs";
7
+ import { createOrReuseNodeAdoptedSession, finalizeNodeAdoptedSession, findNodeAdoptedSessionEntry, nodeAdoptedSourceKey, nodeSessionMarker, runSessionActionExclusive } from "./session-catalog-node-adoption-ITddWx_X.mjs";
8
8
  import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
9
9
  import { createSessionCatalogAdoptionCoordinator, publishSessionCatalogHost, sessionCatalogAdoptedSourceKey } from "openclaw/plugin-sdk/session-catalog";
10
10
  //#region extensions/codex/src/session-catalog-node-continue.ts
@@ -26,7 +26,7 @@ function compareNodeLabels(left, right) {
26
26
  return 0;
27
27
  }
28
28
  function canContinueCodexOnNode(node) {
29
- return node.connected === true && CODEX_NODE_CONTINUE_COMMANDS.every((command) => node.commands?.includes(command) === true && node.invocableCommands?.includes(command) === true);
29
+ return node.connected === true && node.caps?.includes("codex-cli-session-source") === true && CODEX_NODE_CONTINUE_COMMANDS.every((command) => node.commands?.includes(command) === true && node.invocableCommands?.includes(command) === true);
30
30
  }
31
31
  async function listPairedNode(params) {
32
32
  const hostId = `node:${params.node.nodeId}`;
@@ -79,10 +79,8 @@ async function listPairedNode(params) {
79
79
  ...common,
80
80
  connected: true,
81
81
  ...page,
82
- sessions: page.sessions.map((session) => {
83
- const adopted = params.adoptedSessions.get(sessionCatalogAdoptedSourceKey(hostId, session.threadId));
84
- return adopted ? Object.assign({}, session, { sessionKey: adopted.key }) : session;
85
- })
82
+ canContinueCodex: common.canContinueCodex && page.canContinueCodex === true && Boolean(page.sourceHomeId),
83
+ sessions: page.sessions.map((session) => Object.assign({}, session, page.sourceHomeId ? { sourceHomeId: page.sourceHomeId } : {}))
86
84
  };
87
85
  }).catch((error) => ({
88
86
  ...common,
@@ -106,7 +104,10 @@ async function requireNodeForCodexContinue(params) {
106
104
  const nodeId = params.hostId.slice(5).trim();
107
105
  if (!nodeId || params.hostId !== `node:${nodeId}`) throw new CatalogParamsError("Codex session catalog hostId is invalid");
108
106
  const node = (await params.runtime.nodes.list()).nodes.find((candidate) => candidate.nodeId === nodeId);
109
- if (!node || !canContinueCodexOnNode(node)) throw new CatalogParamsError("paired node does not permit Codex session continuation");
107
+ if (!node || !canContinueCodexOnNode(node)) {
108
+ if (node?.connected && !node.caps?.includes("codex-cli-session-source")) throw new CatalogParamsError(CODEX_CLI_SESSION_SOURCE_UPGRADE_MESSAGE);
109
+ throw new CatalogParamsError("paired node does not permit Codex session continuation");
110
+ }
110
111
  return {
111
112
  node,
112
113
  nodeId
@@ -125,6 +126,7 @@ async function readNodeCodexHistory(params) {
125
126
  command: CODEX_APP_SERVER_THREAD_TURNS_LIST_COMMAND,
126
127
  params: {
127
128
  agentId: params.agentId,
129
+ sourceHomeId: params.sourceHomeId,
128
130
  threadId: params.record.threadId,
129
131
  limit: 50
130
132
  },
@@ -153,9 +155,12 @@ async function continueNodeCodexSessionInner(params) {
153
155
  agentId: params.agentId,
154
156
  runtime: params.api.runtime,
155
157
  nodeId,
156
- threadId: params.threadId
158
+ threadId: params.threadId,
159
+ sourceHomeId: params.sourceHomeId
157
160
  });
158
161
  if (lookup.kind !== "found") throw new CatalogParamsError(lookup.kind === "cursor-cycle" ? "Codex session eligibility could not be verified" : "Codex session is unavailable on the paired node");
162
+ if (lookup.canContinueCodex !== true || !lookup.sourceHomeId) throw new CatalogParamsError("Codex session source does not support Chat continuation; use a local stdio source or update the node.");
163
+ const sourceHomeId = lookup.sourceHomeId;
159
164
  const record = lookup.record;
160
165
  requireContinuableNodeRecord(record);
161
166
  const existing = findNodeAdoptedSessionEntry({
@@ -164,6 +169,7 @@ async function continueNodeCodexSessionInner(params) {
164
169
  runtime: params.api.runtime,
165
170
  hostId: params.hostId,
166
171
  threadId: params.threadId,
172
+ sourceHomeId,
167
173
  includeInitializing: true
168
174
  });
169
175
  let adopted;
@@ -176,6 +182,7 @@ async function continueNodeCodexSessionInner(params) {
176
182
  agentId: params.agentId,
177
183
  runtime: params.api.runtime,
178
184
  nodeId,
185
+ sourceHomeId,
179
186
  record
180
187
  });
181
188
  adopted = await createOrReuseNodeAdoptedSession({
@@ -184,6 +191,7 @@ async function continueNodeCodexSessionInner(params) {
184
191
  config: params.config,
185
192
  hostId: params.hostId,
186
193
  nodeId,
194
+ sourceHomeId,
187
195
  record,
188
196
  history
189
197
  });
@@ -192,6 +200,7 @@ async function continueNodeCodexSessionInner(params) {
192
200
  const marker = nodeSessionMarker({
193
201
  hostId: params.hostId,
194
202
  threadId: params.threadId,
203
+ sourceHomeId,
195
204
  nodeId
196
205
  });
197
206
  return {
@@ -223,7 +232,7 @@ async function continueNodeCodexSession(params) {
223
232
  agentId: params.agentId
224
233
  }).sessionAgentId;
225
234
  const sourceKey = sessionCatalogAdoptedSourceKey(`node:${nodeId}`, params.threadId);
226
- const operationKey = sessionCatalogAdoptedSourceKey(agentId, sourceKey);
235
+ const operationKey = sessionCatalogAdoptedSourceKey(agentId, params.sourceHomeId ? nodeAdoptedSourceKey(`node:${nodeId}`, params.threadId, params.sourceHomeId) : sourceKey);
227
236
  return await continueNodeAdoption({
228
237
  sourceKey: operationKey,
229
238
  findExisting: () => void 0,
@@ -1,12 +1,12 @@
1
- import { H as detachCodexCatalogString, L as selectCodexCatalogPreviewInput, M as readControlCursor, R as toCatalogSession, c as getCodexCatalogSource, r as projectCodexCatalogNativeThread, s as copyCodexCatalogSource, u as setCodexCatalogSource, x as boundedCatalogString, z as truncateCodexCatalogPreview } from "./session-catalog-native-projection-ChV3cCtm.mjs";
2
- import { n as codexCatalogRowRecency } from "./session-catalog-index-order-Cc5BzlQr.mjs";
3
- import { s as isOpenClawManagedCodexThread } from "./session-catalog-events-jMcYfQyd.mjs";
1
+ import { B as toCatalogSession, C as boundedCatalogString, P as readControlCursor, V as truncateCodexCatalogPreview, W as detachCodexCatalogString, c as copyCodexCatalogSource, f as setCodexCatalogSource, l as getCodexCatalogSource, r as projectCodexCatalogNativeThread, z as selectCodexCatalogPreviewInput } from "./session-catalog-native-projection-DowriLid.mjs";
2
+ import { a as isOpenClawManagedCodexThread } from "./session-catalog-events-Bj6j94E_.mjs";
3
+ import { n as codexCatalogRowRecency } from "./session-catalog-index-order-hcdz07yN.mjs";
4
4
  import { asFiniteNumber, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import path from "node:path";
6
6
  import fs from "node:fs/promises";
7
+ import { root } from "openclaw/plugin-sdk/file-access-runtime";
7
8
  import { extractErrorCode, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
8
9
  import { constants, createZstdDecompress } from "node:zlib";
9
- import { root } from "openclaw/plugin-sdk/file-access-runtime";
10
10
  import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
11
11
  //#region extensions/codex/src/session-catalog-rollouts.ts
12
12
  const WINDOW_BYTES = 131072;
@@ -74,6 +74,14 @@ var NewestRolloutCandidates = class {
74
74
  function codexCatalogRolloutLogicalPath(rolloutPath) {
75
75
  return rolloutPath.replace(/\.zst$/u, "");
76
76
  }
77
+ function resolveCodexCatalogRolloutFingerprint(rolloutPath, previous, files) {
78
+ const logicalPath = rolloutPath && codexCatalogRolloutLogicalPath(rolloutPath);
79
+ if (!logicalPath) return;
80
+ return files?.get(logicalPath) ?? files?.get(`${logicalPath}.zst`) ?? (previous?.rolloutPath && codexCatalogRolloutLogicalPath(previous.rolloutPath) === logicalPath ? previous.fingerprint : void 0);
81
+ }
82
+ function indexCodexCatalogRowsByRollout(rows) {
83
+ return new Map([...rows].flatMap((row) => row.rolloutPath ? [[codexCatalogRolloutLogicalPath(row.rolloutPath), row]] : []));
84
+ }
77
85
  /** Absence is meaningful only inside the layout visited by the currency scan. */
78
86
  function isCodexCatalogRolloutPathCovered(sessionsRoot, rolloutPath) {
79
87
  const directories = path.relative(sessionsRoot, rolloutPath).split(path.sep);
@@ -411,4 +419,4 @@ function mergeCodexCatalogRolloutRow(row, existing, fingerprint) {
411
419
  return merged;
412
420
  }
413
421
  //#endregion
414
- export { CodexCatalogProjectionCapacityError, CodexCatalogProjections, canReuseCodexCatalogPreview, scanCodexCatalogRollouts as i, mergeCodexCatalogRolloutRow, isCodexCatalogRolloutPathCovered as n, projectCodexCatalogDeltaPage, projectCodexCatalogPage, projectCodexCatalogThread, readCodexCatalogRollout as r, codexCatalogRolloutLogicalPath as t };
422
+ export { CodexCatalogProjectionCapacityError, CodexCatalogProjections, resolveCodexCatalogRolloutFingerprint as a, canReuseCodexCatalogPreview, readCodexCatalogRollout as i, mergeCodexCatalogRolloutRow, indexCodexCatalogRowsByRollout as n, scanCodexCatalogRollouts as o, projectCodexCatalogDeltaPage, projectCodexCatalogPage, projectCodexCatalogThread, isCodexCatalogRolloutPathCovered as r, codexCatalogRolloutLogicalPath as t };
@@ -1,10 +1,10 @@
1
- import "./session-catalog-native-projection-ChV3cCtm.mjs";
2
- import "./session-catalog-fUdWDx-U.mjs";
1
+ import "./session-catalog-native-projection-DowriLid.mjs";
2
+ import "./session-catalog-Pno1xGcl.mjs";
3
3
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
+ import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
4
5
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
5
- import { addGatewayClientOptions, callGatewayFromCli } from "openclaw/plugin-sdk/gateway-runtime";
6
6
  import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
7
- import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
7
+ import { addGatewayClientOptions, callGatewayFromCli } from "openclaw/plugin-sdk/gateway-runtime";
8
8
  //#region extensions/codex/src/session-cli.ts
9
9
  const CODEX_SESSION_CATALOG_CLI_TIMEOUT_MS = 75e3;
10
10
  function requestedAgentId(options) {
@@ -48,37 +48,32 @@ function resolveCodexHistoryTarget(target, admission) {
48
48
  };
49
49
  }
50
50
  /** Returns sanitized session-context messages for consumers that need an owned array. */
51
- async function readCodexMirroredSessionHistoryMessages(target, admission, view = "native-evidence", signal, contextTokenBudget) {
51
+ async function readCodexMirroredSessionHistoryMessages(target, admission, signal, contextTokenBudget) {
52
52
  signal?.throwIfAborted();
53
53
  try {
54
54
  let result;
55
- if (view === "native-evidence") {
56
- const { readCodexHistoryMessagesInWorker } = await import("../session-history-worker-runtime.js");
57
- result = await readCodexHistoryMessagesInWorker(target, admission, signal);
55
+ const resolved = resolveCodexHistoryTarget(target, admission);
56
+ const read = (messages) => Array.from(messages);
57
+ if (resolved.kind === "sqlite") {
58
+ const loaded = await SessionManager.openModelContextAsync(resolved.target, {
59
+ admission,
60
+ signal,
61
+ limits: {
62
+ maxBytes: Math.min(67108864, Math.max(1024, Math.floor((contextTokenBudget ?? 128e3) * 8))),
63
+ maxEvents: 1e4,
64
+ toolResultOverflow: "omit"
65
+ }
66
+ });
67
+ result = consumeCodexHistory(loaded.buildSessionContext().messages, loaded.getHeader(), target.sessionId, read, "codex mirrored model context");
58
68
  } else {
59
- const resolved = resolveCodexHistoryTarget(target, admission);
60
- const read = (messages) => Array.from(messages);
61
- if (resolved.kind === "sqlite") {
62
- const loaded = await SessionManager.openModelContextAsync(resolved.target, {
63
- admission,
64
- signal,
65
- limits: {
66
- maxBytes: Math.min(67108864, Math.max(1024, Math.floor((contextTokenBudget ?? 128e3) * 8))),
67
- maxEvents: 1e4
68
- }
69
- });
70
- result = consumeCodexHistory(loaded.buildSessionContext().messages, loaded.getHeader(), target.sessionId, read, "codex mirrored model context");
71
- } else {
72
- const history = await readCodexNativeHistory(resolved, target.sessionId, read, admission);
73
- result = history.status === "ok" ? history.value : void 0;
74
- }
69
+ const history = await readCodexNativeHistory(resolved, target.sessionId, read, admission);
70
+ result = history.status === "ok" ? history.value : void 0;
75
71
  }
76
72
  signal?.throwIfAborted();
77
73
  return result;
78
74
  } catch (error) {
79
75
  signal?.throwIfAborted();
80
- if (view === "model-context") throw error;
81
- return;
76
+ throw error;
82
77
  }
83
78
  }
84
79
  function resolveSqliteMarkerSessionKey(target, marker) {
@@ -1,7 +1,7 @@
1
- import { p as sessionBindingIdentity } from "./session-binding-record-TH3xA0zj.mjs";
2
- import "./session-binding-_0W_fHRr.mjs";
3
- import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-D4qp_leP.mjs";
4
- import { n as prepareCodexSessionInitialization } from "./session-initialization-DH1z6fXn.mjs";
1
+ import { m as sessionBindingIdentity } from "./session-binding-record-BGoz8wOK.mjs";
2
+ import "./session-binding-Cm0apEbd.mjs";
3
+ import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-BtHDBp1G.mjs";
4
+ import { n as prepareCodexSessionInitialization } from "./session-initialization-rcgbZiid.mjs";
5
5
  import { resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
6
6
  //#region extensions/codex/src/app-server/session-history-import.ts
7
7
  /** Creates a session whose transcript is derived from one verified Codex thread snapshot. */
@@ -3,8 +3,8 @@ import { t as CodexHistoryRejection } from "./history-rejection-B4nOXNXF.mjs";
3
3
  import { n as readCodexNativeHistory } from "./session-history-read-B3ZfSUbF.mjs";
4
4
  import { l as serializeCodexMirrorSourceEvidence } from "./transcript-mirror-attestation-CzM-94NC.mjs";
5
5
  import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
- import { serveWorkerTasks } from "openclaw/plugin-sdk/process-runtime";
7
6
  import { Buffer } from "node:buffer";
7
+ import { serveWorkerTasks } from "openclaw/plugin-sdk/worker-task-server";
8
8
  //#region extensions/codex/src/app-server/settled-turn-projection.ts
9
9
  const MAX_RESPONSE_ITEMS = 200;
10
10
  const MAX_PROJECTION_BYTES = 524288;
@@ -354,23 +354,10 @@ async function runCodexHistoryWorkerInput(input) {
354
354
  const onSnapshot = (value) => {
355
355
  version = value;
356
356
  };
357
- if (request.kind === "messages") {
358
- const result = await readCodexNativeHistory(request.target, request.sessionId, (messages) => Array.from(messages), request.admission, onSnapshot);
359
- return {
360
- kind: request.kind,
361
- result,
362
- version
363
- };
364
- }
365
- if (request.kind === "settled") {
366
- const result = await readCodexNativeHistory(request.target, request.sessionId, (messages) => projectVerifiedSettledCodexMessages(messages, request.evidence), request.admission, onSnapshot);
367
- return {
368
- kind: request.kind,
369
- result,
370
- version
371
- };
372
- }
373
- throw new Error("Invalid Codex history worker operation");
357
+ return {
358
+ result: await readCodexNativeHistory(request.target, request.sessionId, (messages) => projectVerifiedSettledCodexMessages(messages, request.evidence), request.admission, onSnapshot),
359
+ version
360
+ };
374
361
  }
375
362
  serveWorkerTasks(runCodexHistoryWorkerInput);
376
363
  //#endregion
@@ -1,5 +1,5 @@
1
- import { h as validateBindingForWrite } from "./session-binding-record-TH3xA0zj.mjs";
2
- import "./session-binding-_0W_fHRr.mjs";
1
+ import { g as validateBindingForWrite } from "./session-binding-record-BGoz8wOK.mjs";
2
+ import "./session-binding-Cm0apEbd.mjs";
3
3
  import { isDeepStrictEqual } from "node:util";
4
4
  import { deleteSessionUpstreamLink, upsertSessionUpstreamLink } from "openclaw/plugin-sdk/session-catalog";
5
5
  //#region extensions/codex/src/app-server/session-initialization.ts
@@ -1,5 +1,5 @@
1
- import { D as selectGuardianApprovalPolicy, O as selectGuardianApprovalsReviewer, S as parseAllowedSandboxModesFromCodexRequirements, a as resolveCodexAppServerNetworkProxy, b as parseAllowedApprovalPoliciesFromCodexRequirements, k as selectUserApprovalsReviewer, x as parseAllowedApprovalsReviewersFromCodexRequirements, z as selectGuardianSandbox } from "./config-security-BRQ2mgW9.mjs";
2
- import { t as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-CedDWjM-.mjs";
1
+ import { S as selectUserApprovalsReviewer, _ as parseAllowedApprovalsReviewersFromCodexRequirements, a as resolveCodexAppServerNetworkProxy, b as selectGuardianApprovalPolicy, g as parseAllowedApprovalPoliciesFromCodexRequirements, j as selectGuardianSandbox, v as parseAllowedSandboxModesFromCodexRequirements, x as selectGuardianApprovalsReviewer } from "./config-security-BEReZ6go.mjs";
2
+ import { t as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-BoTP_mrL.mjs";
3
3
  import { hostname } from "node:os";
4
4
  import { isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
5
5
  //#region extensions/codex/src/app-server/app-server-policy.ts
@@ -1,9 +1,9 @@
1
1
  import { n as withCodexAppServerThreadMutation, t as isIncognitoSessionKey } from "./incognito-session-uhrBF6wJ.mjs";
2
- import { I as hasCodexAppServerLiveThread, U as releaseCodexAppServerLiveThread, _ as retainSharedCodexAppServerClientByInstanceId, z as isCodexAppServerLiveThreadClaimed } from "./shared-client-BpTtuLQ5.mjs";
3
- import { a as closeCodexStartupClientBestEffort, f as unsubscribeCodexThreadBestEffort, n as CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-BpYKdTA0.mjs";
4
- import { t as isSameCodexAppServerThreadOwner } from "./thread-ownership-skomxnIt.mjs";
5
- import { t as codexNativeSubagentMonitorRuntime } from "./native-subagent-monitor-B1hxzIOy.mjs";
6
- import { t as getCodexSessionInitializationRollback } from "./session-initialization-DH1z6fXn.mjs";
2
+ import { I as hasCodexAppServerLiveThread, U as releaseCodexAppServerLiveThread, _ as retainSharedCodexAppServerClientByInstanceId, z as isCodexAppServerLiveThreadClaimed } from "./shared-client-DA4VR4Eb.mjs";
3
+ import { n as CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS, o as closeCodexStartupClientBestEffort, p as unsubscribeCodexThreadBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-CEv1cKwF.mjs";
4
+ import { t as isSameCodexAppServerThreadOwner } from "./thread-ownership-DcTtAcXj.mjs";
5
+ import { t as codexNativeSubagentMonitorRuntime } from "./native-subagent-monitor-D3filLY2.mjs";
6
+ import { t as getCodexSessionInitializationRollback } from "./session-initialization-rcgbZiid.mjs";
7
7
  //#region extensions/codex/src/app-server/session-retirement.ts
8
8
  async function releaseSessionSubscription(client, binding, sessionKey, assertCurrent) {
9
9
  assertCurrent?.();
@@ -25,6 +25,25 @@ async function releaseSessionSubscription(client, binding, sessionKey, assertCur
25
25
  }
26
26
  /** Prepare exact binding deletion before the session owner commits either database. */
27
27
  async function withCodexAppServerSessionDeletion(bindingStore, params, run) {
28
+ return withCodexAppServerSessionMutation(bindingStore, params, run);
29
+ }
30
+ /** Retire the old native context when the host commits a rewind or branch switch. */
31
+ async function withCodexAppServerSessionContextReset(bindingStore, params, run) {
32
+ params.assertCurrent();
33
+ const plan = await bindingStore.prepareSessionGenerationReclaim({
34
+ kind: "session",
35
+ agentId: params.agentId,
36
+ sessionKey: params.sessionKey,
37
+ sessionId: params.sessionId
38
+ });
39
+ params.assertCurrent();
40
+ const sessionId = plan.kind === "verify" && plan.expectedPreviousSessionId === params.previousSessionId ? plan.expectedPreviousSessionId : params.sessionId;
41
+ return withCodexAppServerSessionMutation(bindingStore, {
42
+ ...params,
43
+ sessionId
44
+ }, run);
45
+ }
46
+ async function withCodexAppServerSessionMutation(bindingStore, params, run) {
28
47
  const { assertCurrent } = params;
29
48
  const identity = {
30
49
  kind: "session",
@@ -95,4 +114,4 @@ async function retireCodexAppServerSessionGeneration(params) {
95
114
  }));
96
115
  }
97
116
  //#endregion
98
- export { retireCodexAppServerSessionGeneration, withCodexAppServerSessionDeletion };
117
+ export { retireCodexAppServerSessionGeneration, withCodexAppServerSessionContextReset, withCodexAppServerSessionDeletion };
@@ -1,11 +1,11 @@
1
- import { g as assertCodexPassiveTurnItems } from "./client-vXs2929Q.mjs";
2
1
  import { r as readMirrorIdentity, t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-LphB8slG.mjs";
3
2
  import { a as fingerprintCodexMirrorSourceMessage, c as readCodexMirrorSourceFingerprint } from "./transcript-mirror-attestation-CzM-94NC.mjs";
4
- import { Z as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-BpTtuLQ5.mjs";
5
- import { t as codexTranscriptMirrorRuntime } from "./transcript-mirror-D4qp_leP.mjs";
6
- import { runBoundedCodexAppServerTurn } from "./bounded-turn-BtlZcivC.mjs";
3
+ import { Z as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-DA4VR4Eb.mjs";
4
+ import { _ as assertCodexPassiveTurnItems } from "./client-Cs08OXVQ.mjs";
5
+ import { t as codexTranscriptMirrorRuntime } from "./transcript-mirror-BtHDBp1G.mjs";
6
+ import { runBoundedCodexAppServerTurn } from "./bounded-turn-B2HScEgT.mjs";
7
7
  import { t as resolveCodexLocalRuntimeAttribution } from "./local-runtime-attribution-B_2mnqhb.mjs";
8
- import { a as createAttributedCodexAssistantMessage } from "./event-projector-assistant-message-DNUR1s0A.mjs";
8
+ import { a as createAttributedCodexAssistantMessage } from "./event-projector-assistant-message-BsruvNrH.mjs";
9
9
  import { t as CodexSettledTurnContext } from "./settled-turn-context-fmwouT5I.mjs";
10
10
  import { isSilentReplyText } from "openclaw/plugin-sdk/reply-runtime";
11
11
  //#region extensions/codex/src/app-server/settled-turn-finalizer.ts
@@ -68,14 +68,14 @@ async function runCodexSettledTurnFinalization(operation, options) {
68
68
  provider: modelProvider,
69
69
  api: resolveCodexLocalRuntimeAttribution(attempt).api
70
70
  };
71
- assertCodexPassiveTurnItems(bounded.items, attempt.prompt, "settled-turn finalization");
72
- const text = isSilentReplyText(bounded.text) ? "" : bounded.text.trim();
71
+ assertCodexPassiveTurnItems(bounded.items, attempt.prompt, "settled-turn finalization", { allowManagedHookPrompts: bounded.managedHooksEnabled });
72
+ const text = bounded.text.trim();
73
73
  const assistant = createAttributedCodexAssistantMessage(attribution, text, {
74
74
  tokenUsage: bounded.usage,
75
75
  aborted: false,
76
76
  promptError: null
77
77
  });
78
- if (!text) return {
78
+ if (!text || isSilentReplyText(text)) return {
79
79
  assistant,
80
80
  ...bounded.usage ? { usage: bounded.usage } : {}
81
81
  };