@openclaw/codex 2026.10.1 → 2026.10.5-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 (161) hide show
  1. package/dist/.setup/{account-usage-runtime-B7Vg4rmy.mjs → account-usage-runtime-QBZsvZS8.mjs} +8 -7
  2. package/dist/.setup/{app-server-policy-Bg4FZw1f.mjs → app-server-policy-D_zv8J7V.mjs} +3 -4
  3. package/dist/.setup/{apply-BzlIkqSz.mjs → apply-CBMV8LN0.mjs} +40 -51
  4. package/dist/.setup/{attempt-client-cleanup-HXQxfMc1.mjs → attempt-client-cleanup-t-kd_1ys.mjs} +6 -6
  5. package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +2 -0
  6. package/dist/.setup/{attempt-workspace-context-BmCutoyg.mjs → attempt-workspace-context-CcwP3DA3.mjs} +21 -18
  7. package/dist/.setup/{auth-binding-BoMwpuPN.mjs → auth-binding-BaxlhaNx.mjs} +2 -2
  8. package/dist/.setup/{auth-cache-key-BCCQHWdc.mjs → auth-cache-key-DyfUvsSa.mjs} +30 -41
  9. package/dist/.setup/{binding-connection-C-08ez1w.mjs → binding-connection-B7HAAZSI.mjs} +2 -2
  10. package/dist/.setup/{binding-connection.runtime-Dn2p-fdy.mjs → binding-connection.runtime-DAXn7iFl.mjs} +6 -5
  11. package/dist/.setup/{bounded-turn-Cv4uIEzz.mjs → bounded-turn-CyQVQwGe.mjs} +21 -17
  12. package/dist/.setup/{bounded-turn-isolation-DklXNk3k.mjs → bounded-turn-isolation-BfDAo-qZ.mjs} +4 -4
  13. package/dist/.setup/{build-state-BwxNfFEB.mjs → build-state-CzLMy1S9.mjs} +1 -1
  14. package/dist/.setup/{capabilities-kQntafj_.mjs → capabilities-DbOzOglY.mjs} +1 -1
  15. package/dist/.setup/{client-catalog-response-BNFDYAKh.mjs → client-catalog-response-DsbEAtpd.mjs} +25 -32
  16. package/dist/.setup/{client-BIRVBXXb.mjs → client-y7nO6X9c.mjs} +198 -247
  17. package/dist/.setup/{command-dispatch-D3_ypl-R.mjs → command-dispatch-uA9lz2Kf.mjs} +3 -4
  18. package/dist/.setup/{command-formatters-DV3DHhdr.mjs → command-formatters-xW9KpoSZ.mjs} +16 -26
  19. package/dist/.setup/{command-handlers-KPit4G0p.mjs → command-handlers-VBaJnpZo.mjs} +270 -360
  20. package/dist/.setup/{command-rpc-CmQDOxY9.mjs → command-rpc-C9VxOLuG.mjs} +19 -18
  21. package/dist/.setup/{compact-CLLteFIY.mjs → compact-CD8xJxXS.mjs} +41 -61
  22. package/dist/.setup/{computer-use-BVxocZZc.mjs → computer-use-CiToXF5C.mjs} +109 -147
  23. package/dist/.setup/{config-0Gxk3_eq.mjs → config-C1YVVLEA.mjs} +32 -59
  24. package/dist/.setup/config-contracts.shared-D85SGEuq.mjs +4 -0
  25. package/dist/.setup/{config-options-HG_Rr3W_.mjs → config-options-DDzeNQ8m.mjs} +52 -90
  26. package/dist/.setup/{config-parsing-BQq-CHTF.mjs → config-parsing-DsWSCPHO.mjs} +19 -55
  27. package/dist/.setup/{config-runtime-cUYrqu_a.mjs → config-runtime-DWzK-k0n.mjs} +2 -2
  28. package/dist/.setup/{config-security-KAPScztc.mjs → config-security-clxAZYWX.mjs} +35 -39
  29. package/dist/.setup/config-utils-DN_YT7dE.mjs +47 -0
  30. package/dist/.setup/{context-engine-projection-CsgYSQhW.mjs → context-engine-projection-ps-yn_ci.mjs} +10 -22
  31. package/dist/.setup/{conversation-binding-DJ_288rC.mjs → conversation-binding-CTSLDM9S.mjs} +85 -119
  32. package/dist/.setup/{conversation-binding-data-DJ4ix-W5.mjs → conversation-binding-data-UgLuTSQT.mjs} +9 -8
  33. package/dist/.setup/{conversation-control-CuiZ_pDL.mjs → conversation-control-GXM3unE4.mjs} +7 -10
  34. package/dist/.setup/{cyber-failover-Bb1J6hS1.mjs → cyber-failover-D4dgNfFf.mjs} +2 -5
  35. package/dist/.setup/{cyber-failover-notice-XR03ef31.mjs → cyber-failover-notice-ljgGGL0s.mjs} +1 -1
  36. package/dist/.setup/{doctor-start-options-DPW9JxIE.mjs → doctor-start-options-JjTAl-q_.mjs} +5 -5
  37. package/dist/.setup/{dynamic-tool-build-DgWZMfAQ.mjs → dynamic-tool-build-D731PCdv.mjs} +57 -69
  38. package/dist/.setup/{dynamic-tools-Ct6GKAFr.mjs → dynamic-tools-D0pYbxHH.mjs} +689 -710
  39. package/dist/.setup/{effective-mcp-catalog-DmCSc8TS.mjs → effective-mcp-catalog-1hWFKghy.mjs} +11 -20
  40. package/dist/.setup/{elicitation-input-r9axtppm.mjs → elicitation-input-DXG_qaXr.mjs} +14 -20
  41. package/dist/.setup/{ephemeral-turn-_cBMKCFb.mjs → ephemeral-turn-Cphy5Qr_.mjs} +3 -3
  42. package/dist/.setup/{event-projector-assistant-message-C3Tpt370.mjs → event-projector-assistant-message-CLMKN4x-.mjs} +2 -2
  43. package/dist/.setup/{event-projector-usage-03R0I2dM.mjs → event-projector-usage-BpKfdoTm.mjs} +20 -33
  44. package/dist/.setup/{event-projector-values-DTqZHizf.mjs → event-projector-values-CLvG1Hil.mjs} +4 -5
  45. package/dist/.setup/history-rejection-B4nOXNXF.mjs +13 -0
  46. package/dist/.setup/{inference-context-D-9gWlTR.mjs → inference-context-DNlGwzwy.mjs} +10 -11
  47. package/dist/.setup/{inference-dispatch-B5UKEUyC.mjs → inference-dispatch-CO6tTs4q.mjs} +5 -4
  48. package/dist/.setup/{inference-metadata-CgIf7sOx.mjs → inference-metadata-DCvcG_N_.mjs} +36 -41
  49. package/dist/.setup/{inference-proxy-DUO5E2QQ.mjs → inference-proxy-BDWV0djM.mjs} +10 -14
  50. package/dist/.setup/{isolated-completion-CjrQEeke.mjs → isolated-completion-Bhqd2yBq.mjs} +8 -8
  51. package/dist/.setup/local-runtime-attribution-CZz2DJ4q.mjs +15 -0
  52. package/dist/.setup/{managed-binary-C1VFoVPf.mjs → managed-binary-BtIjV7yN.mjs} +16 -36
  53. package/dist/.setup/{mcp-app-session-preparation-D0yRoreX.mjs → mcp-app-session-preparation-DqSvxFqc.mjs} +24 -25
  54. package/dist/.setup/{mcp-tool-metadata-j10HhfTC.mjs → mcp-tool-metadata-DW41snf3.mjs} +1 -1
  55. package/dist/.setup/{model-catalog--G4arndd.mjs → model-catalog-B227ST3D.mjs} +6 -6
  56. package/dist/.setup/{models-BYbLQPnj.mjs → models-DdRyi93L.mjs} +6 -10
  57. package/dist/.setup/{native-auth-Cjb9y7IZ.mjs → native-auth-esN5MdIv.mjs} +5 -5
  58. package/dist/.setup/{native-execution-policy-ClzpdG3D.mjs → native-execution-policy-MXEe7PB3.mjs} +11 -28
  59. package/dist/.setup/native-hook-relay-BUWIOrSr.mjs +561 -0
  60. package/dist/.setup/{native-mcp-app-5i5eRCwO.mjs → native-mcp-app-CjxJQ4F7.mjs} +6 -6
  61. package/dist/.setup/native-skill-isolation-UMVoNjZz.mjs +391 -0
  62. package/dist/.setup/{native-subagent-monitor-B2C8D_N0.mjs → native-subagent-monitor-iHc8oLg5.mjs} +505 -639
  63. package/dist/.setup/{native-subagent-pending-assignments-BDqhOdJp.mjs → native-subagent-pending-assignments-DmVhedNs.mjs} +11 -23
  64. package/dist/.setup/{native-task-assignments-C6KVqiN1.mjs → native-task-assignments-DimsQ9Qa.mjs} +73 -27
  65. package/dist/.setup/{node-cli-sessions-B5oNDkUS.mjs → node-cli-sessions-CzKg2nGq.mjs} +18 -26
  66. package/dist/.setup/{node-exec-server.runtime-0xSEjKYt.mjs → node-exec-server.runtime-BWkULhBM.mjs} +5 -8
  67. package/dist/.setup/{plan-B5bDIEuQ.mjs → plan-C_F3aio0.mjs} +40 -50
  68. package/dist/.setup/{plugin-activation-BcyBv8PG.mjs → plugin-activation-D7WkJMvU.mjs} +4 -5
  69. package/dist/.setup/{plugin-app-cache-key-BW8rd98k.mjs → plugin-app-cache-key-Bg9DbDI6.mjs} +18 -23
  70. package/dist/.setup/{plugin-approval-roundtrip-C_SGp5YW.mjs → plugin-approval-roundtrip-BSV-51ig.mjs} +4 -6
  71. package/dist/.setup/{plugin-inventory-Bf0_piTw.mjs → plugin-inventory-CYgdo14P.mjs} +28 -43
  72. package/dist/.setup/{plugin-marketplace-discovery-SQPhSuic.mjs → plugin-marketplace-discovery-BblHM3DU.mjs} +7 -10
  73. package/dist/.setup/{plugin-metadata-cache-DWnB7VMj.mjs → plugin-metadata-cache-Bi8TAPwX.mjs} +5 -10
  74. package/dist/.setup/project-doc-thread-config-BVcvnps8.mjs +490 -0
  75. package/dist/.setup/{provider-BoIby-eX.mjs → provider-BJ4xhaGX.mjs} +4 -4
  76. package/dist/.setup/{provider-capabilities-B4yq6UgQ.mjs → provider-capabilities-CjRaV3bx.mjs} +1 -1
  77. package/dist/.setup/{rate-limits-CMPy24F5.mjs → rate-limits-CI8pTPqL.mjs} +15 -32
  78. package/dist/.setup/reasoning-effort-CS9kKWB9.mjs +37 -0
  79. package/dist/.setup/{request-DD3u22uv.mjs → request-Y8dmbqZ3.mjs} +28 -48
  80. package/dist/.setup/{rpc-error-hmWM21RB.mjs → rpc-error-C98SHchT.mjs} +3 -6
  81. package/dist/.setup/{run-attempt-DOVF5OON.mjs → run-attempt-Dx7a4Mfm.mjs} +927 -859
  82. package/dist/.setup/{run-attempt-lifecycle-BuZgVbDA.mjs → run-attempt-lifecycle-KN4oh-7O.mjs} +13 -4
  83. package/dist/.setup/{runtime-artifact-CUTOOnKw.mjs → runtime-artifact-C13pR7tD.mjs} +18 -22
  84. package/dist/.setup/{runtime-artifact-connection-CADz3_BY.mjs → runtime-artifact-connection-jS5DeCok.mjs} +3 -3
  85. package/dist/.setup/{sandbox-guard-WqE8yPge.mjs → sandbox-guard-DIImwCy1.mjs} +4 -6
  86. package/dist/.setup/service-tier-normalization-BPgw2Wdt.mjs +9 -0
  87. package/dist/.setup/{session-binding-Ce7BqiPN.mjs → session-binding-JEHNMPsr.mjs} +13 -40
  88. package/dist/.setup/{session-binding-record-BZB8RgcF.mjs → session-binding-record-DU_0biMD.mjs} +4 -4
  89. package/dist/.setup/{session-binding-record-codec-z4ZpDn6E.mjs → session-binding-record-codec-BpH8u_G9.mjs} +16 -39
  90. package/dist/.setup/{session-binding-sidecars-BrdV95Fg.mjs → session-binding-sidecars-DD-enC8w.mjs} +49 -54
  91. package/dist/.setup/{session-catalog-adoption-CPIP4S_y.mjs → session-catalog-adoption-Ca3OYGYM.mjs} +23 -27
  92. package/dist/.setup/{session-catalog-archive-DcgwvSbF.mjs → session-catalog-archive-Bv6gV7x9.mjs} +6 -6
  93. package/dist/.setup/{session-catalog-events-DRaivXvC.mjs → session-catalog-events-DzFlXNUe.mjs} +6 -5
  94. package/dist/.setup/{session-catalog-index-qwmgqC4t.mjs → session-catalog-index-DozvkUPd.mjs} +111 -105
  95. package/dist/.setup/{session-catalog-index-order-nhyO0wdW.mjs → session-catalog-index-order-CTfoefow.mjs} +28 -5
  96. package/dist/.setup/{session-catalog-limits-DEU36Qlo.mjs → session-catalog-limits-BynIoOYm.mjs} +1 -1
  97. package/dist/.setup/{session-catalog-list-request-tXephOB4.mjs → session-catalog-list-request-D4MYNgDB.mjs} +11 -8
  98. package/dist/.setup/{session-catalog-native-projection-z9Q608QW.mjs → session-catalog-native-projection-rCKnZud1.mjs} +5 -61
  99. package/dist/.setup/{session-catalog-node-adoption-7-WEQTB1.mjs → session-catalog-node-adoption-BdP9Zjqo.mjs} +2 -2
  100. package/dist/.setup/{session-catalog-node-continue-DLWBwAAO.mjs → session-catalog-node-continue-CNJibO4_.mjs} +27 -49
  101. package/dist/.setup/{session-catalog-node-lookup-Uufckwcm.mjs → session-catalog-node-lookup-BH_DBGa9.mjs} +3 -3
  102. package/dist/.setup/{session-catalog-parsing-B-qWJh2x.mjs → session-catalog-parsing-DkeoVn60.mjs} +9 -19
  103. package/dist/.setup/{session-catalog-projection-Cl0Nc7c6.mjs → session-catalog-projection-DDVmALHj.mjs} +8 -22
  104. package/dist/.setup/session-catalog-source-CygTGmrb.mjs +58 -0
  105. package/dist/.setup/{session-cli-kH4vuGod.mjs → session-cli-GwU0izn-.mjs} +20 -41
  106. package/dist/.setup/{session-history-BogBHKLk.mjs → session-history-BO6i_pfk.mjs} +1 -1
  107. package/dist/.setup/{session-history-import-NWKPa4ZO.mjs → session-history-import-CaO8s6ta.mjs} +4 -4
  108. package/dist/.setup/{session-history-read-CNN8zwbD.mjs → session-history-read-BI_2jRED.mjs} +4 -15
  109. package/dist/.setup/{session-history.worker-Cq_4DYgN.mjs → session-history.worker-DJQfek5p.mjs} +147 -159
  110. package/dist/.setup/{session-initialization-D6dtFQkE.mjs → session-initialization-Bi_2DKhc.mjs} +3 -5
  111. package/dist/.setup/{session-permission-policy-BxIUJ0Zd.mjs → session-permission-policy-CD2MAWU8.mjs} +12 -20
  112. package/dist/.setup/{session-retirement-Bt3b0fpe.mjs → session-retirement-IoS3zr17.mjs} +7 -7
  113. package/dist/.setup/{settled-turn-context-BZsMjkIO.mjs → settled-turn-context-BPL6D3RO.mjs} +1 -1
  114. package/dist/.setup/{settled-turn-finalizer-e_24O6HA.mjs → settled-turn-finalizer-X-Fylp-u.mjs} +12 -11
  115. package/dist/.setup/{shared-client-DeenOD8U.mjs → shared-client-ByIwuAC-.mjs} +172 -229
  116. package/dist/.setup/{side-question-BZHn_1Jm.mjs → side-question-BDUdozFy.mjs} +116 -137
  117. package/dist/.setup/{source-0ClinBHI.mjs → source-Bxbqf3S1.mjs} +37 -56
  118. package/dist/.setup/thread-archive-guard-LKdwQKyr.mjs +56 -0
  119. package/dist/.setup/{thread-lifecycle-CoqYpbpk.mjs → thread-lifecycle-run-CfP4PnEf.mjs} +348 -484
  120. package/dist/.setup/thread-model-selection-DcVebr8N.mjs +61 -0
  121. package/dist/.setup/{thread-ownership-CSDZ6mHd.mjs → thread-ownership-Be53aiaG.mjs} +5 -5
  122. package/dist/.setup/{thread-ownership-queue-Dp24d7-F.mjs → thread-ownership-queue-CeyYScUC.mjs} +5 -6
  123. package/dist/.setup/{thread-policy-DCC9lQjC.mjs → thread-policy-CHgY-KNl.mjs} +4 -4
  124. package/dist/.setup/thread-requests-BgzJwJtS.mjs +745 -0
  125. package/dist/.setup/{thread-resume--WOKWxZd.mjs → thread-resume-B2EmMcgE.mjs} +5 -5
  126. package/dist/.setup/{timeout-CXOfNoaX.mjs → timeout-D0mEWSGG.mjs} +6 -12
  127. package/dist/.setup/{transcript-history-projection-B9a7HwUV.mjs → transcript-history-projection-DfKcoZCB.mjs} +3 -4
  128. package/dist/.setup/{transcript-mirror-BfLRARNL.mjs → transcript-mirror-Bee2o6jj.mjs} +68 -68
  129. package/dist/.setup/{transcript-mirror-attestation-YSegaktH.mjs → transcript-mirror-attestation-BzUXnrvv.mjs} +5 -2
  130. package/dist/.setup/{transport-stdio-a0HDa2Mj.mjs → transport-stdio-CRWTkKOn.mjs} +67 -77
  131. package/dist/.setup/{transport-websocket-zqJ0Cmtn.mjs → transport-websocket-DIyPfkHo.mjs} +8 -16
  132. package/dist/.setup/{turn-router-BWhX_SBh.mjs → turn-router-DKDAziUW.mjs} +30 -31
  133. package/dist/.setup/upstream-prompt-provenance-Ccd9MFRJ.mjs +44 -0
  134. package/dist/.setup/{upstream-session-fork-BQvofnk7.mjs → upstream-session-fork-Djp_yssT.mjs} +50 -43
  135. package/dist/.setup/{usage-BEHcVwcZ.mjs → usage-DQA-peQC.mjs} +4 -4
  136. package/dist/.setup/{usage-limit-error-D1p3nE6n.mjs → usage-limit-error-2t3KBqiX.mjs} +12 -21
  137. package/dist/.setup/web-search-item-CvokaZOo.mjs +20 -0
  138. package/dist/.setup/{web-search-provider.runtime-CV9oiB-v.mjs → web-search-provider.runtime-BsuCMNix.mjs} +3 -3
  139. package/dist/.setup/{workspace-write-sandbox-probe-DmUHLrrl.mjs → workspace-write-sandbox-probe-BDWO2Qkh.mjs} +4 -4
  140. package/dist/api.js +15 -15
  141. package/dist/catalog-page.worker.js +1 -1
  142. package/dist/cli-metadata.js +1 -1
  143. package/dist/doctor-contract-api.js +5 -6
  144. package/dist/harness.js +32 -61
  145. package/dist/index.js +302 -416
  146. package/dist/media-understanding-provider.js +32 -43
  147. package/dist/migration-provider-api.js +1 -1
  148. package/dist/native-session-binding-api.js +1 -1
  149. package/dist/native-tool-policy.js +23 -1
  150. package/dist/provider-discovery.js +1 -1
  151. package/dist/session-history-worker-runtime.js +52 -31
  152. package/dist/session-history.worker.js +1 -1
  153. package/openclaw.plugin.json +20 -3
  154. package/package.json +7 -7
  155. package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +0 -5
  156. package/dist/.setup/plugin-thread-config-deadline-CsScGgrk.mjs +0 -124
  157. package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +0 -15
  158. package/dist/.setup/shell-dynamic-tools-BqGszXcq.mjs +0 -85
  159. package/dist/.setup/thread-archive-guard-C9frICzX.mjs +0 -60
  160. package/dist/.setup/thread-requests-Dwg2b4Xl.mjs +0 -2111
  161. package/dist/.setup/upstream-prompt-provenance-fXkKbPVC.mjs +0 -37
@@ -1,10 +1,10 @@
1
- import { A as unwrapNodeInvokePayload, b as parseTranscriptPage, d as boundedCatalogString, f as catalogError, g as isInteractiveThreadSource, h as filterCatalogPageByTitle, n as CODEX_APP_SERVER_THREADS_LIST_COMMAND, o as CatalogParamsError, r as CODEX_APP_SERVER_THREAD_TURNS_LIST_COMMAND, u as NODE_INVOKE_TIMEOUT_MS, v as parseCatalogPage } from "./session-catalog-parsing-B-qWJh2x.mjs";
2
- import { n as createCodexCliNodeConversationBindingData } from "./conversation-binding-data-DJ4ix-W5.mjs";
3
- import { r as CODEX_CLI_SESSION_SOURCE_UPGRADE_MESSAGE, t as CODEX_CLI_SESSION_RESUME_COMMAND } from "./node-cli-sessions-B5oNDkUS.mjs";
4
- import { i as withTimeout } from "./timeout-CXOfNoaX.mjs";
5
- import { t as lookupNodeCodexCatalogRecord } from "./session-catalog-node-lookup-Uufckwcm.mjs";
1
+ import { A as unwrapNodeInvokePayload, b as parseTranscriptPage, d as boundedCatalogString, f as catalogError, g as isInteractiveThreadSource, h as filterCatalogPageByTitle, n as CODEX_APP_SERVER_THREADS_LIST_COMMAND, o as CatalogParamsError, r as CODEX_APP_SERVER_THREAD_TURNS_LIST_COMMAND, u as NODE_INVOKE_TIMEOUT_MS, v as parseCatalogPage } from "./session-catalog-parsing-DkeoVn60.mjs";
2
+ import { n as createCodexCliNodeConversationBindingData } from "./conversation-binding-data-UgLuTSQT.mjs";
3
+ import { r as CODEX_CLI_SESSION_SOURCE_UPGRADE_MESSAGE, t as CODEX_CLI_SESSION_RESUME_COMMAND } from "./node-cli-sessions-CzKg2nGq.mjs";
4
+ import { i as withTimeout } from "./timeout-D0mEWSGG.mjs";
5
+ import { t as lookupNodeCodexCatalogRecord } from "./session-catalog-node-lookup-BH_DBGa9.mjs";
6
6
  import { t as codexLastTerminalTurnId } from "./session-upstream-marker-D15C9NHp.mjs";
7
- import { catalogSessionActions, createOrReuseNodeAdoptedSession, finalizeNodeAdoptedSession, findNodeAdoptedSessionEntry, nodeAdoptedSourceKey, nodeSessionMarker } from "./session-catalog-node-adoption-7-WEQTB1.mjs";
7
+ import { catalogSessionActions, createOrReuseNodeAdoptedSession, finalizeNodeAdoptedSession, findNodeAdoptedSessionEntry, nodeAdoptedSourceKey, nodeSessionMarker } from "./session-catalog-node-adoption-BdP9Zjqo.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
@@ -58,6 +58,12 @@ async function listPairedNode(params) {
58
58
  params.onHost?.(host);
59
59
  return host;
60
60
  }
61
+ const failedHost = (error) => ({
62
+ ...common,
63
+ connected: true,
64
+ sessions: [],
65
+ error: catalogError("NODE_INVOKE_FAILED", error)
66
+ });
61
67
  const eventualHost = Promise.resolve().then(async () => {
62
68
  const raw = await params.runtime.nodes.invoke({
63
69
  nodeId: params.node.nodeId,
@@ -80,23 +86,9 @@ async function listPairedNode(params) {
80
86
  canContinueCodex: common.canContinueCodex && page.canContinueCodex === true && Boolean(page.sourceHomeId),
81
87
  sessions: page.sessions.map((session) => Object.assign({}, session, page.sourceHomeId ? { sourceHomeId: page.sourceHomeId } : {}))
82
88
  };
83
- }).catch((error) => ({
84
- ...common,
85
- connected: true,
86
- sessions: [],
87
- error: catalogError("NODE_INVOKE_FAILED", error)
88
- }));
89
+ }).catch(failedHost);
89
90
  publishSessionCatalogHost(params, eventualHost);
90
- try {
91
- return await withTimeout(eventualHost, NODE_CATALOG_LIST_RESPONSE_TIMEOUT_MS, "paired node Codex session catalog timed out");
92
- } catch (error) {
93
- return {
94
- ...common,
95
- connected: true,
96
- sessions: [],
97
- error: catalogError("NODE_INVOKE_FAILED", error)
98
- };
99
- }
91
+ return await withTimeout(eventualHost, NODE_CATALOG_LIST_RESPONSE_TIMEOUT_MS, "paired node Codex session catalog timed out").catch(failedHost);
100
92
  }
101
93
  async function requireNodeForCodexContinue(params) {
102
94
  const node = (await params.runtime.nodes.list()).nodes.find((candidate) => candidate.nodeId === params.nodeId);
@@ -156,46 +148,32 @@ async function continueNodeCodexSessionInner(params) {
156
148
  const sourceHomeId = lookup.sourceHomeId;
157
149
  const record = lookup.record;
158
150
  requireContinuableNodeRecord(record);
159
- const existing = findNodeAdoptedSessionEntry({
151
+ const source = {
160
152
  agentId: params.agentId,
153
+ api: params.api,
161
154
  config: params.config,
162
155
  runtime: params.api.runtime,
163
156
  hostId: params.hostId,
164
157
  threadId: params.threadId,
158
+ nodeId,
165
159
  sourceHomeId,
160
+ record
161
+ };
162
+ const existing = findNodeAdoptedSessionEntry({
163
+ ...source,
166
164
  includeInitializing: true
167
165
  });
168
166
  let adopted;
169
- let disposition;
170
- if (existing) {
171
- adopted = existing;
172
- disposition = "existing";
173
- } else {
174
- const history = await readNodeCodexHistory({
175
- agentId: params.agentId,
176
- runtime: params.api.runtime,
177
- nodeId,
178
- sourceHomeId,
179
- record
180
- });
167
+ if (existing) adopted = existing;
168
+ else {
169
+ const history = await readNodeCodexHistory(source);
181
170
  adopted = await createOrReuseNodeAdoptedSession({
182
- agentId: params.agentId,
183
- api: params.api,
184
- config: params.config,
185
- hostId: params.hostId,
186
- nodeId,
187
- sourceHomeId,
188
- record,
171
+ ...source,
189
172
  history
190
173
  });
191
- disposition = "forked";
192
174
  }
193
- const marker = nodeSessionMarker({
194
- hostId: params.hostId,
195
- threadId: params.threadId,
196
- sourceHomeId,
197
- nodeId
198
- });
175
+ const disposition = existing ? "existing" : "forked";
176
+ const marker = nodeSessionMarker(source);
199
177
  return {
200
178
  sessionKey: adopted.key,
201
179
  disposition,
@@ -1,6 +1,6 @@
1
- import { A as unwrapNodeInvokePayload, n as CODEX_APP_SERVER_THREADS_LIST_COMMAND, o as CatalogParamsError, u as NODE_INVOKE_TIMEOUT_MS, v as parseCatalogPage } from "./session-catalog-parsing-B-qWJh2x.mjs";
2
- import "./session-catalog-limits-DEU36Qlo.mjs";
3
- import { i as withTimeout } from "./timeout-CXOfNoaX.mjs";
1
+ import { A as unwrapNodeInvokePayload, n as CODEX_APP_SERVER_THREADS_LIST_COMMAND, o as CatalogParamsError, u as NODE_INVOKE_TIMEOUT_MS, v as parseCatalogPage } from "./session-catalog-parsing-DkeoVn60.mjs";
2
+ import "./session-catalog-limits-BynIoOYm.mjs";
3
+ import { i as withTimeout } from "./timeout-D0mEWSGG.mjs";
4
4
  //#region extensions/codex/src/session-catalog-node-lookup.ts
5
5
  async function lookupNodeCodexCatalogRecord(params) {
6
6
  const deadline = performance.now() + NODE_INVOKE_TIMEOUT_MS;
@@ -1,5 +1,5 @@
1
1
  import "./protocol-CANUwXJ3.mjs";
2
- import { n as detachCodexCatalogString } from "./session-catalog-limits-DEU36Qlo.mjs";
2
+ import { n as detachCodexCatalogString } from "./session-catalog-limits-BynIoOYm.mjs";
3
3
  import { asFiniteNumber, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
5
5
  //#region extensions/codex/src/app-server/protocol-session-source.ts
@@ -22,7 +22,6 @@ const MAX_CWD_LENGTH = 4096;
22
22
  const MAX_SESSION_NAME_LENGTH = 500;
23
23
  const MAX_SESSION_PREVIEW_LENGTH = 500;
24
24
  const SESSION_PREVIEW_PREFIX_LENGTH = 2048;
25
- const MAX_SESSION_KEY_LENGTH = 1024;
26
25
  const MAX_METADATA_LENGTH = 500;
27
26
  const MAX_ACTIVE_FLAGS = 16;
28
27
  const MAX_TRANSCRIPT_PAGE_BYTES = 20971520;
@@ -39,10 +38,6 @@ function boundedCatalogString(value, maxLength, overflow = "omit") {
39
38
  if (normalized.length <= maxLength) return detachCodexCatalogString(normalized);
40
39
  return overflow === "truncate" ? detachCodexCatalogString(truncateUtf16Safe(normalized, maxLength)) : void 0;
41
40
  }
42
- function catalogPreview(value, sanitize) {
43
- if (typeof value !== "string") return;
44
- return boundedCatalogString(sanitize(value.replace(/\s+/g, " ")), MAX_SESSION_PREVIEW_LENGTH, "truncate");
45
- }
46
41
  /** Select a bounded input only for the canonical terminal sanitizer. */
47
42
  function selectCodexCatalogPreviewInput(value) {
48
43
  if (value.length <= SESSION_PREVIEW_PREFIX_LENGTH) return value;
@@ -51,7 +46,8 @@ function selectCodexCatalogPreviewInput(value) {
51
46
  }
52
47
  /** Detach the small preview from V8's potentially large sliced-string backing store. */
53
48
  function truncateCodexCatalogPreview(value, sanitize) {
54
- return Buffer.from(catalogPreview(value, sanitize) ?? "", "utf8").toString("utf8");
49
+ const preview = typeof value === "string" ? boundedCatalogString(sanitize(value.replace(/\s+/g, " ")), MAX_SESSION_PREVIEW_LENGTH, "truncate") : void 0;
50
+ return Buffer.from(preview ?? "", "utf8").toString("utf8");
55
51
  }
56
52
  function normalizeInteractiveThreadSource(source) {
57
53
  return CODEX_INTERACTIVE_THREAD_SOURCE_KINDS.find((kind) => kind === source) ?? CODEX_INTERACTIVE_CUSTOM_THREAD_SOURCES.find((kind) => kind === source) ?? (isRecord(source) ? CODEX_INTERACTIVE_CUSTOM_THREAD_SOURCES.find((kind) => kind === source.custom) : void 0);
@@ -74,7 +70,7 @@ function codexCatalogThreadStatus(status) {
74
70
  ...activeFlags.length ? { activeFlags } : {}
75
71
  };
76
72
  }
77
- function toCatalogSession(thread, archived, sanitize, preparedPreview) {
73
+ function toCatalogSession(thread, preparedPreview) {
78
74
  const source = normalizeInteractiveThreadSource(thread.source);
79
75
  if (!source) return;
80
76
  const threadId = boundedCatalogString(thread.id, 256);
@@ -82,7 +78,7 @@ function toCatalogSession(thread, archived, sanitize, preparedPreview) {
82
78
  const gitInfo = isRecord(thread.gitInfo) ? thread.gitInfo : void 0;
83
79
  const sessionId = boundedCatalogString(thread.sessionId, 256);
84
80
  const name = codexCatalogThreadName(thread.name);
85
- const fallbackName = name ? void 0 : preparedPreview ? preparedPreview.value : catalogPreview(thread.preview, sanitize);
81
+ const fallbackName = name ? void 0 : preparedPreview;
86
82
  const cwd = boundedCatalogString(thread.cwd, MAX_CWD_LENGTH);
87
83
  const modelProvider = boundedCatalogString(thread.modelProvider, MAX_METADATA_LENGTH, "truncate");
88
84
  const cliVersion = boundedCatalogString(thread.cliVersion, MAX_METADATA_LENGTH, "truncate");
@@ -90,7 +86,7 @@ function toCatalogSession(thread, archived, sanitize, preparedPreview) {
90
86
  return {
91
87
  threadId,
92
88
  ...codexCatalogThreadStatus(thread.status),
93
- archived,
89
+ archived: false,
94
90
  ...sessionId ? { sessionId } : {},
95
91
  ...thread.name === null ? { name: null } : name ? { name } : {},
96
92
  ...fallbackName ? { fallbackName } : {},
@@ -234,14 +230,9 @@ const CATALOG_SESSION_STRINGS = [
234
230
  "gitBranch",
235
231
  "Git branch",
236
232
  MAX_METADATA_LENGTH
237
- ],
238
- [
239
- "sessionKey",
240
- "OpenClaw session key",
241
- MAX_SESSION_KEY_LENGTH
242
233
  ]
243
234
  ];
244
- function parseCatalogSession(value, options = {}) {
235
+ function parseCatalogSession(value) {
245
236
  if (!isRecord(value) || typeof value.threadId !== "string" || !value.threadId.trim() || value.threadId.length > 256 || value.archived !== false) throw new Error("Codex session catalog returned an invalid session");
246
237
  const status = parseOptionalCatalogString(value.status, "status", 64);
247
238
  if (!status?.trim()) throw new Error("Codex session catalog returned an invalid status");
@@ -258,7 +249,6 @@ function parseCatalogSession(value, options = {}) {
258
249
  archived: value.archived
259
250
  };
260
251
  for (const [key, label, limit] of CATALOG_SESSION_STRINGS) {
261
- if (key === "sessionKey" && !options.allowSessionKey) continue;
262
252
  if (key === "name" && value.name === null) {
263
253
  session.name = null;
264
254
  continue;
@@ -278,13 +268,13 @@ function parseCatalogSession(value, options = {}) {
278
268
  }
279
269
  return session;
280
270
  }
281
- function parseCatalogPage(value, options = {}) {
271
+ function parseCatalogPage(value) {
282
272
  if (!isRecord(value) || !Array.isArray(value.sessions) || value.sessions.length > 100) throw new Error("Codex session catalog returned an invalid page");
283
273
  const nextCursor = parseOptionalCatalogString(value.nextCursor, "next cursor", MAX_CURSOR_LENGTH);
284
274
  const sourceHomeId = parseOptionalCatalogString(value.sourceHomeId, "source home id", 256);
285
275
  const backwardsCursor = parseOptionalCatalogString(value.backwardsCursor, "backwards cursor", MAX_CURSOR_LENGTH);
286
276
  return {
287
- sessions: value.sessions.map((session) => parseCatalogSession(session, options)),
277
+ sessions: value.sessions.map(parseCatalogSession),
288
278
  ...sourceHomeId ? { sourceHomeId } : {},
289
279
  ...typeof value.canContinueCodex === "boolean" ? { canContinueCodex: value.canContinueCodex } : {},
290
280
  ...nextCursor ? { nextCursor } : {},
@@ -1,15 +1,14 @@
1
- import { D as selectCodexCatalogPreviewInput, O as toCatalogSession, S as readControlCursor, d as boundedCatalogString, k as truncateCodexCatalogPreview } from "./session-catalog-parsing-B-qWJh2x.mjs";
2
- import { n as detachCodexCatalogString } from "./session-catalog-limits-DEU36Qlo.mjs";
3
- import { n as codexCatalogRowRecency } from "./session-catalog-index-order-nhyO0wdW.mjs";
1
+ import { D as selectCodexCatalogPreviewInput, O as toCatalogSession, S as readControlCursor, d as boundedCatalogString, k as truncateCodexCatalogPreview } from "./session-catalog-parsing-DkeoVn60.mjs";
2
+ import { n as detachCodexCatalogString } from "./session-catalog-limits-BynIoOYm.mjs";
3
+ import { n as codexCatalogRowRecency } from "./session-catalog-index-order-CTfoefow.mjs";
4
4
  import { t as isOpenClawManagedCodexThread } from "./session-catalog-provenance-CmsOE5mh.mjs";
5
- import { c as copyCodexCatalogSource, l as getCodexCatalogSource, p as setCodexCatalogSource, r as projectCodexCatalogNativeThread } from "./session-catalog-native-projection-z9Q608QW.mjs";
5
+ import { c as setCodexCatalogSource, i as getCodexCatalogSource, r as copyCodexCatalogSource } from "./session-catalog-source-CygTGmrb.mjs";
6
6
  import { asFiniteNumber, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import path from "node:path";
8
8
  import fs from "node:fs/promises";
9
9
  import { extractErrorCode, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
10
10
  import { root } from "openclaw/plugin-sdk/file-access-runtime";
11
11
  import { constants, createZstdDecompress } from "node:zlib";
12
- import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
13
12
  //#region extensions/codex/src/session-catalog-rollouts.ts
14
13
  const WINDOW_BYTES = 131072;
15
14
  const ROLLOUT_SOURCE_DENIAL_CODES = /* @__PURE__ */ new Set([
@@ -166,19 +165,6 @@ async function readCodexCatalogRollout(sessionsRoot, rolloutPath) {
166
165
  }
167
166
  //#endregion
168
167
  //#region extensions/codex/src/session-catalog-projection.ts
169
- /** Single-thread responses remain owned by their native consumers. */
170
- function projectCodexCatalogThread(thread, localSessionsRoot) {
171
- try {
172
- const prepared = projectCodexCatalogNativeThread(thread, sanitizeTerminalText);
173
- return projectCodexCatalogPage({ data: [prepared] }, {
174
- localSessionsRoot,
175
- sanitize: sanitizeTerminalText,
176
- source: getCodexCatalogSource(prepared)
177
- });
178
- } catch (error) {
179
- return Promise.reject(toErrorObject(error, "Codex catalog projection failed"));
180
- }
181
- }
182
168
  var CodexCatalogProjectionCapacityError = class extends Error {
183
169
  constructor() {
184
170
  super("Codex catalog projection queue reached its resident row limit");
@@ -223,7 +209,7 @@ async function projectCodexCatalogPage(response, params) {
223
209
  ...rolloutPath ? { rolloutPath } : {}
224
210
  }];
225
211
  } else {
226
- const session = toCatalogSession(thread, false, sanitize, { value: typeof thread.preview === "string" ? thread.preview : void 0 });
212
+ const session = toCatalogSession(thread, typeof thread.preview === "string" ? thread.preview : void 0);
227
213
  if (session) page.sessions.push(session);
228
214
  }
229
215
  rows.push(setCodexCatalogSource({
@@ -235,7 +221,7 @@ async function projectCodexCatalogPage(response, params) {
235
221
  updatedAt: asFiniteNumber(thread.updatedAt) ?? null,
236
222
  recencyAt: asFiniteNumber(thread.recencyAt) ?? null,
237
223
  page
238
- }, params.source ?? getCodexCatalogSource(thread)));
224
+ }, getCodexCatalogSource(thread)));
239
225
  }
240
226
  return {
241
227
  rows,
@@ -260,7 +246,7 @@ async function projectCodexCatalogDeltaPage(response, params) {
260
246
  nativeMetadata: true
261
247
  });
262
248
  if (typeof thread.preview === "string" && Boolean(thread.preview) !== Boolean(row.preview)) return;
263
- const session = toCatalogSession(thread, false, params.sanitize, { value: row.preview });
249
+ const session = toCatalogSession(thread, row.preview);
264
250
  return copyCodexCatalogSource(thread, {
265
251
  ...row,
266
252
  nativeMetadata: true,
@@ -305,4 +291,4 @@ function mergeCodexCatalogRolloutRow(row, existing, fingerprint) {
305
291
  return merged;
306
292
  }
307
293
  //#endregion
308
- export { CodexCatalogProjectionCapacityError, CodexCatalogProjections, canReuseCodexCatalogPreview, mergeCodexCatalogRolloutRow, readCodexCatalogRollout as n, projectCodexCatalogDeltaPage, projectCodexCatalogPage, projectCodexCatalogThread, resolveCodexCatalogRolloutFingerprint as r, codexCatalogRolloutLogicalPath as t };
294
+ export { CodexCatalogProjectionCapacityError, CodexCatalogProjections, canReuseCodexCatalogPreview, mergeCodexCatalogRolloutRow, readCodexCatalogRollout as n, projectCodexCatalogDeltaPage, projectCodexCatalogPage, resolveCodexCatalogRolloutFingerprint as r, codexCatalogRolloutLogicalPath as t };
@@ -0,0 +1,58 @@
1
+ import { n as defineCodexBuildState } from "./build-state-CzLMy1S9.mjs";
2
+ //#region extensions/codex/src/session-catalog-source.ts
3
+ function hasLiveCodexCatalogSource(sources) {
4
+ for (const source of sources) if (!source.closed) return true;
5
+ return false;
6
+ }
7
+ const getSources = defineCodexBuildState("openclaw.codexCatalogSources", () => ({
8
+ clients: /* @__PURE__ */ new WeakMap(),
9
+ values: /* @__PURE__ */ new WeakMap()
10
+ }));
11
+ const getEphemeralObservers = defineCodexBuildState("openclaw.codexCatalogEphemeralObservers", () => /* @__PURE__ */ new WeakMap());
12
+ /** A passive lifetime fact; the token never retains its client or a lease. */
13
+ function codexCatalogSourceForClient(client) {
14
+ const { clients } = getSources();
15
+ let source = clients.get(client);
16
+ if (!source) {
17
+ source = { closed: false };
18
+ clients.set(client, source);
19
+ }
20
+ return source;
21
+ }
22
+ function closeCodexCatalogClientSource(client) {
23
+ const { clients } = getSources();
24
+ const source = clients.get(client);
25
+ if (source) {
26
+ source.closed = true;
27
+ getEphemeralObservers().delete(source);
28
+ } else clients.set(client, { closed: true });
29
+ }
30
+ /** The catalog observer is bound once per physical source and released on closure. */
31
+ function observeCodexCatalogEphemeralThreads(source, observer) {
32
+ getEphemeralObservers().set(source, observer);
33
+ }
34
+ function getCodexCatalogSource(value) {
35
+ return value !== null && typeof value === "object" ? getSources().values.get(value) : void 0;
36
+ }
37
+ function setCodexCatalogSource(value, source) {
38
+ if (source) getSources().values.set(value, source);
39
+ return value;
40
+ }
41
+ /** Source attribution survives projection without becoming serialized row data. */
42
+ function copyCodexCatalogSource(from, to) {
43
+ return setCodexCatalogSource(to, getCodexCatalogSource(from));
44
+ }
45
+ /** Stamp the final decoded objects, including any bounded catalog DTO replacement. */
46
+ function recordCodexCatalogResponseSource(method, result, source) {
47
+ if (result === null || typeof result !== "object") return;
48
+ if (method === "thread/list" && "data" in result && Array.isArray(result.data)) {
49
+ setCodexCatalogSource(result, source);
50
+ for (const thread of result.data) if (thread !== null && typeof thread === "object") setCodexCatalogSource(thread, source);
51
+ } else if ((method === "thread/read" || method === "thread/start" || method === "thread/fork" || method === "thread/resume") && "thread" in result && result.thread !== null && typeof result.thread === "object") {
52
+ setCodexCatalogSource(result, source);
53
+ setCodexCatalogSource(result.thread, source);
54
+ if ("ephemeral" in result.thread && result.thread.ephemeral === true && "id" in result.thread && typeof result.thread.id === "string") getEphemeralObservers().get(source)?.(result.thread.id);
55
+ }
56
+ }
57
+ //#endregion
58
+ export { hasLiveCodexCatalogSource as a, setCodexCatalogSource as c, getCodexCatalogSource as i, codexCatalogSourceForClient as n, observeCodexCatalogEphemeralThreads as o, copyCodexCatalogSource as r, recordCodexCatalogResponseSource as s, closeCodexCatalogClientSource as t };
@@ -1,7 +1,7 @@
1
- import "./session-catalog-parsing-B-qWJh2x.mjs";
1
+ import "./session-catalog-parsing-DkeoVn60.mjs";
2
2
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
3
- import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
4
3
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
4
+ import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
5
5
  import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
6
6
  import { addGatewayClientOptions, callGatewayFromCli } from "openclaw/plugin-sdk/gateway-runtime";
7
7
  //#region extensions/codex/src/session-cli.ts
@@ -31,13 +31,10 @@ function parsePageLimit(value) {
31
31
  if (!/^\d+$/.test(trimmed) || !Number.isSafeInteger(parsed) || parsed < 1 || parsed > 100) throw new Error(`--limit must be an integer between 1 and 100`);
32
32
  return parsed;
33
33
  }
34
- function normalizeTimestampMs(value) {
35
- return Math.abs(value) < 0xe8d4a51000 ? value * 1e3 : value;
36
- }
37
34
  function formatTimestamp(session) {
38
35
  const value = session.recencyAt ?? session.updatedAt ?? session.createdAt;
39
36
  if (typeof value !== "number" || !Number.isFinite(value)) return "-";
40
- const date = new Date(normalizeTimestampMs(value));
37
+ const date = new Date(Math.abs(value) < 0xe8d4a51000 ? value * 1e3 : value);
41
38
  return Number.isNaN(date.getTime()) ? "-" : `${date.toISOString().replace("T", " ").slice(0, 16)}Z`;
42
39
  }
43
40
  function singleLineTerminalText(value) {
@@ -115,61 +112,43 @@ async function listCodexSessions(options) {
115
112
  writeHost(catalogHost);
116
113
  });
117
114
  }
118
- function readThreadId(value) {
119
- const threadId = value.trim();
115
+ async function runCodexSessionAction(action, threadIdValue, options) {
116
+ const threadId = threadIdValue.trim();
120
117
  if (!threadId) throw new Error("Codex thread id must not be empty");
121
- return threadId;
122
- }
123
- async function continueCodexSession(threadIdValue, options) {
124
- const threadId = readThreadId(threadIdValue);
125
118
  const agentId = requestedAgentId(options);
126
119
  const hostId = options.host?.trim() || "gateway:local";
127
- const raw = await callGatewayFromCli("sessions.catalog.continue", gatewayOptions(options), {
128
- catalogId: "codex",
129
- hostId,
130
- threadId,
131
- ...agentId ? { agentId } : {}
132
- }, {
133
- mode: "cli",
134
- scopes: ["operator.write"]
135
- });
136
- if (!isRecord(raw) || typeof raw.sessionKey !== "string" || !raw.sessionKey.trim()) throw new Error("Codex session continue returned an invalid session key");
137
- const result = { sessionKey: raw.sessionKey };
138
- if (options.json) {
139
- writeJson(result);
140
- return;
141
- }
142
- writeLine(`OpenClaw session: ${singleLineTerminalText(result.sessionKey)}`);
143
- }
144
- async function archiveCodexSession(threadIdValue, options) {
145
- const threadId = readThreadId(threadIdValue);
146
- const agentId = requestedAgentId(options);
147
- const hostId = options.host?.trim() || "gateway:local";
148
- if (options.confirmNoOtherRunner !== true) throw new Error("--confirm-no-other-runner is required because Codex client and runner activity is process-local");
149
- const raw = await callGatewayFromCli("sessions.catalog.archive", gatewayOptions(options), {
120
+ if (action === "archive" && options.confirmNoOtherRunner !== true) throw new Error("--confirm-no-other-runner is required because Codex client and runner activity is process-local");
121
+ const raw = await callGatewayFromCli(`sessions.catalog.${action}`, gatewayOptions(options), {
150
122
  catalogId: "codex",
151
123
  hostId,
152
124
  threadId,
153
125
  ...agentId ? { agentId } : {},
154
- confirmNoOtherRunner: true
126
+ ...action === "archive" ? { confirmNoOtherRunner: true } : {}
155
127
  }, {
156
128
  mode: "cli",
157
129
  scopes: ["operator.write"]
158
130
  });
159
- if (!isRecord(raw) || raw.ok !== true) throw new Error("Codex session archive returned an invalid result");
160
- const result = { ok: true };
131
+ let result;
132
+ if (action === "continue") {
133
+ if (!isRecord(raw) || typeof raw.sessionKey !== "string" || !raw.sessionKey.trim()) throw new Error("Codex session continue returned an invalid session key");
134
+ result = { sessionKey: raw.sessionKey };
135
+ } else if (!isRecord(raw) || raw.ok !== true) throw new Error("Codex session archive returned an invalid result");
136
+ else result = { ok: true };
161
137
  if (options.json) {
162
138
  writeJson(result);
163
139
  return;
164
140
  }
165
- writeLine(`Archived Codex thread ${singleLineTerminalText(threadId)}.`);
141
+ writeLine("sessionKey" in result ? `OpenClaw session: ${singleLineTerminalText(result.sessionKey)}` : `Archived Codex thread ${singleLineTerminalText(threadId)}.`);
166
142
  }
167
143
  /** Registers the plugin-owned Codex session supervision CLI. */
168
144
  function registerCodexSessionCli(program) {
169
145
  const codex = program.command("codex").description("Inspect and branch from Codex sessions through the Gateway");
170
146
  addGatewayClientOptions(codex.command("sessions").description("List non-archived Codex app-server sessions across connected hosts").option("--agent <id>", "Agent id that owns the Codex sessions").option("--search <text>", "Search session titles (case-insensitive)").option("--host <id>", "Filter by stable host id").option("--limit <count>", "Maximum sessions returned per host").option("--cursor <cursor>", "Continue one host page (requires --host)").option("--json", "Print the structured catalog response", false), { timeoutMs: CODEX_SESSION_CATALOG_CLI_TIMEOUT_MS }).action(listCodexSessions);
171
- addGatewayClientOptions(codex.command("continue <thread-id>").description("Continue a Gateway-local Codex thread as an OpenClaw branch").option("--agent <id>", "Agent id that owns the Codex session").option("--host <id>", "Stable local host id from codex sessions").option("--json", "Print the structured response", false)).action(continueCodexSession);
172
- addGatewayClientOptions(codex.command("archive <thread-id>").description("Archive a stored or idle Gateway-local Codex thread").option("--agent <id>", "Agent id that owns the Codex session").option("--host <id>", "Stable local host id from codex sessions").option("--confirm-no-other-runner", "Confirm no other Codex client or OpenClaw runner is using this thread", false).option("--json", "Print the structured response", false)).action(archiveCodexSession);
147
+ for (const [action, description] of [["continue", "Continue a Gateway-local Codex thread as an OpenClaw branch"], ["archive", "Archive a stored or idle Gateway-local Codex thread"]]) {
148
+ const command = codex.command(`${action} <thread-id>`).description(description).option("--agent <id>", "Agent id that owns the Codex session").option("--host <id>", "Stable local host id from codex sessions");
149
+ if (action === "archive") command.option("--confirm-no-other-runner", "Confirm no other Codex client or OpenClaw runner is using this thread", false);
150
+ addGatewayClientOptions(command.option("--json", "Print the structured response", false)).action((threadId, options) => runCodexSessionAction(action, threadId, options));
151
+ }
173
152
  }
174
153
  //#endregion
175
154
  export { registerCodexSessionCli };
@@ -1,4 +1,4 @@
1
- import { n as readCodexNativeHistory, t as consumeCodexHistory } from "./session-history-read-CNN8zwbD.mjs";
1
+ import { n as readCodexNativeHistory, t as consumeCodexHistory } from "./session-history-read-BI_2jRED.mjs";
2
2
  import { resolveAgentHarnessHistoryLimits } from "openclaw/plugin-sdk/agent-harness-attempt-runtime";
3
3
  import { SessionManager } from "openclaw/plugin-sdk/agent-sessions";
4
4
  import { getSessionEntry, parseSqliteSessionFileMarker, resolveTranscriptSessionKeyBySessionId } from "openclaw/plugin-sdk/session-store-runtime";
@@ -1,7 +1,7 @@
1
- import { m as sessionBindingIdentity } from "./session-binding-record-BZB8RgcF.mjs";
2
- import "./session-binding-Ce7BqiPN.mjs";
3
- import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-BfLRARNL.mjs";
4
- import { n as prepareCodexSessionInitialization } from "./session-initialization-D6dtFQkE.mjs";
1
+ import { m as sessionBindingIdentity } from "./session-binding-record-DU_0biMD.mjs";
2
+ import "./session-binding-JEHNMPsr.mjs";
3
+ import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-Bee2o6jj.mjs";
4
+ import { n as prepareCodexSessionInitialization } from "./session-initialization-Bi_2DKhc.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. */
@@ -1,19 +1,8 @@
1
+ import { n as codexHistoryRejectionReason, t as CodexHistoryRejection } from "./history-rejection-B4nOXNXF.mjs";
1
2
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
2
3
  import fs from "node:fs/promises";
3
4
  import { SessionTranscriptReadFenceError, readCodexSessionContext } from "openclaw/plugin-sdk/codex-session-transcript-runtime";
4
5
  import { INLINE_IMAGE_DATA_URL_PREFIX, sanitizeInlineImageDataUrl } from "openclaw/plugin-sdk/inline-image-data-url-runtime";
5
- //#region extensions/codex/src/app-server/history-rejection.ts
6
- /** Only an owning rejection site can supply a diagnostic; exception text is never evidence. */
7
- var CodexHistoryRejection = class extends Error {
8
- constructor(reason) {
9
- super(`Codex history rejected: ${reason}`);
10
- this.reason = reason;
11
- }
12
- };
13
- function codexHistoryRejectionReason(error) {
14
- return error instanceof CodexHistoryRejection ? error.reason : "history_read_failed";
15
- }
16
- //#endregion
17
6
  //#region extensions/codex/src/app-server/image-payload-sanitizer.ts
18
7
  /**
19
8
  * Sanitizes inline image payloads mirrored through Codex history so invalid
@@ -85,7 +74,7 @@ function consumeCodexHistory(messages, header, sessionId, read, imageLabel = "co
85
74
  })());
86
75
  }
87
76
  /** Keeps native evidence and its synchronous consumer inside the same readonly snapshot. */
88
- async function readCodexNativeHistory(target, sessionId, read, admission, onSnapshot) {
77
+ async function readCodexNativeHistory(target, sessionId, read, admission, onSnapshot, physicalSource) {
89
78
  const consume = (messages, header, version) => {
90
79
  try {
91
80
  onSnapshot?.(version);
@@ -102,7 +91,7 @@ async function readCodexNativeHistory(target, sessionId, read, admission, onSnap
102
91
  };
103
92
  try {
104
93
  if (target.kind === "empty") return consume([], void 0);
105
- if (target.kind === "sqlite") return readCodexSessionContext(target.target, consume, admission);
94
+ if (target.kind === "sqlite") return readCodexSessionContext(target.target, consume, admission, physicalSource);
106
95
  const { buildSessionContext, migrateSessionEntries, parseSessionEntries } = await import("openclaw/plugin-sdk/agent-sessions");
107
96
  const entries = parseSessionEntries(await fs.readFile(target.sessionFile, "utf-8"));
108
97
  return consume((function* () {
@@ -119,4 +108,4 @@ async function readCodexNativeHistory(target, sessionId, read, admission, onSnap
119
108
  }
120
109
  }
121
110
  //#endregion
122
- export { codexHistoryRejectionReason as a, CodexHistoryRejection as i, readCodexNativeHistory as n, invalidInlineImageText as r, consumeCodexHistory as t };
111
+ export { readCodexNativeHistory as n, invalidInlineImageText as r, consumeCodexHistory as t };