@openclaw/codex 2026.9.8 → 2026.10.1-beta.2

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 (151) hide show
  1. package/README.md +8 -0
  2. package/dist/.setup/{account-usage-runtime-G348lY1q.mjs → account-usage-runtime-DGqFpAud.mjs} +5 -5
  3. package/dist/.setup/app-server-policy-Bg4FZw1f.mjs +23 -0
  4. package/dist/.setup/{apply-Cqb-YoCS.mjs → apply-CXTudl9p.mjs} +48 -39
  5. package/dist/.setup/attempt-client-cleanup-BH0hW2xU.mjs +155 -0
  6. package/dist/.setup/{attempt-workspace-context-BJ5Z_olH.mjs → attempt-workspace-context-BY0jprWJ.mjs} +11 -15
  7. package/dist/.setup/{auth-binding-BLWz7stm.mjs → auth-binding-BoMwpuPN.mjs} +17 -25
  8. package/dist/.setup/{auth-cache-key-Dnps4W4_.mjs → auth-cache-key-CGm0UJOr.mjs} +244 -82
  9. package/dist/.setup/{auth-profile-B0okYl2D.mjs → auth-profile-CgHQ8Vot.mjs} +2 -1
  10. package/dist/.setup/{auth-profile-selection-DFu9e167.mjs → auth-profile-selection-hr8ocLtz.mjs} +5 -7
  11. package/dist/.setup/{binding-connection-DTtN1KrX.mjs → binding-connection-C-08ez1w.mjs} +2 -2
  12. package/dist/.setup/{binding-connection.runtime-6TpgD1M6.mjs → binding-connection.runtime-Dn2p-fdy.mjs} +3 -3
  13. package/dist/.setup/{bounded-turn-isolation-B8K_ylqk.mjs → bounded-turn-isolation-DklXNk3k.mjs} +4 -4
  14. package/dist/.setup/{bounded-turn-BNunZPtz.mjs → bounded-turn-pGsfXcmH.mjs} +14 -13
  15. package/dist/.setup/{build-state-DIQ5O_-S.mjs → build-state-CqQnsg7T.mjs} +1 -1
  16. package/dist/.setup/{capabilities-B3WEZl4e.mjs → capabilities-kQntafj_.mjs} +1 -1
  17. package/dist/.setup/{client-qyUBJlGZ.mjs → client-C8lgBOoO.mjs} +438 -160
  18. package/dist/.setup/{client-catalog-response-DRvx_wCC.mjs → client-catalog-response-Bqp7WG51.mjs} +57 -25
  19. package/dist/.setup/command-authorization-AikPDtcc.mjs +15 -0
  20. package/dist/.setup/{command-dispatch-Btrs1D6f.mjs → command-dispatch-DhBbFIQ5.mjs} +3 -3
  21. package/dist/.setup/{command-formatters-R3ckE3Co.mjs → command-formatters-DV3DHhdr.mjs} +7 -5
  22. package/dist/.setup/{command-handlers-DvlCHJch.mjs → command-handlers-ztOOzm6O.mjs} +82 -144
  23. package/dist/.setup/{command-rpc-skzRq4wD.mjs → command-rpc-CuC5fPom.mjs} +23 -31
  24. package/dist/.setup/{compact-8ttks5U5.mjs → compact-tUb9AYfH.mjs} +117 -65
  25. package/dist/.setup/{plugin-metadata-cache-BRwtRct9.mjs → computer-use-BBN9y326.mjs} +65 -202
  26. package/dist/.setup/{config-DKhXquav.mjs → config-0Gxk3_eq.mjs} +5 -6
  27. package/dist/.setup/{config-options-CzyWLTJt.mjs → config-options-HG_Rr3W_.mjs} +13 -23
  28. package/dist/.setup/{config-parsing-b088LyhT.mjs → config-parsing-BQq-CHTF.mjs} +41 -4
  29. package/dist/.setup/{config-runtime-C0NbLms1.mjs → config-runtime-cUYrqu_a.mjs} +2 -2
  30. package/dist/.setup/{config-security-CE-FcGw9.mjs → config-security-KAPScztc.mjs} +20 -36
  31. package/dist/.setup/{context-engine-projection-PezSESth.mjs → context-engine-projection-CsgYSQhW.mjs} +11 -14
  32. package/dist/.setup/{conversation-binding-74LaGGH-.mjs → conversation-binding-B3MNMVzb.mjs} +36 -48
  33. package/dist/.setup/{conversation-binding-data-C746z5Pn.mjs → conversation-binding-data-DJ4ix-W5.mjs} +1 -1
  34. package/dist/.setup/{conversation-control-OrN6zuaY.mjs → conversation-control-CYsMlCuE.mjs} +19 -21
  35. package/dist/.setup/{cyber-failover-XV0nNRZu.mjs → cyber-failover-Bb1J6hS1.mjs} +1 -1
  36. package/dist/.setup/{cyber-failover-notice-RNpGpTyP.mjs → cyber-failover-notice-XR03ef31.mjs} +1 -1
  37. package/dist/.setup/doctor-start-options-DPW9JxIE.mjs +63 -0
  38. package/dist/.setup/dynamic-tool-build-C8xGEXmR.mjs +463 -0
  39. package/dist/.setup/{dynamic-tools-Db2sY5cZ.mjs → dynamic-tools-DyERJnR6.mjs} +238 -878
  40. package/dist/.setup/{effective-mcp-catalog-Bi6-SQ7i.mjs → effective-mcp-catalog-C26Mio5l.mjs} +83 -11
  41. package/dist/.setup/{elicitation-input-DPoK8F7w.mjs → elicitation-input-r9axtppm.mjs} +4 -2
  42. package/dist/.setup/{ephemeral-turn-DiCS1ijR.mjs → ephemeral-turn-D8VcDTNo.mjs} +2 -2
  43. package/dist/.setup/{event-projector-assistant-message-MV_1dj-3.mjs → event-projector-assistant-message-BN7CNUB5.mjs} +2 -2
  44. package/dist/.setup/{event-projector-values-DJSz8BTk.mjs → event-projector-values-DTqZHizf.mjs} +2 -12
  45. package/dist/.setup/{inference-dispatch-CMZtjQyz.mjs → inference-dispatch-B5UKEUyC.mjs} +12 -21
  46. package/dist/.setup/{inference-proxy-DhcXOgUE.mjs → inference-proxy-DUO5E2QQ.mjs} +6 -5
  47. package/dist/.setup/{isolated-completion-D80IXfQF.mjs → isolated-completion-C0jrcplS.mjs} +8 -8
  48. package/dist/.setup/{managed-binary-kiWRhNRE.mjs → managed-binary-C1VFoVPf.mjs} +31 -38
  49. package/dist/.setup/mcp-app-session-preparation-BxN0_CYe.mjs +223 -0
  50. package/dist/.setup/mcp-tool-metadata-j10HhfTC.mjs +43 -0
  51. package/dist/.setup/{model-catalog-DiC0Tkha.mjs → model-catalog-DZyNeDKG.mjs} +7 -7
  52. package/dist/.setup/{models-DfLmPV0k.mjs → models-DSseKSMg.mjs} +10 -7
  53. package/dist/.setup/{native-auth-CuG53tu4.mjs → native-auth-Cjb9y7IZ.mjs} +5 -6
  54. package/dist/.setup/{native-execution-policy-BxZJy5mP.mjs → native-execution-policy-ClzpdG3D.mjs} +1 -12
  55. package/dist/.setup/native-mcp-app-CqcPVmhH.mjs +310 -0
  56. package/dist/.setup/{native-subagent-monitor-BwkQXf9e.mjs → native-subagent-monitor-BUYOUp9X.mjs} +235 -318
  57. package/dist/.setup/{native-subagent-pending-assignments-DwkCzLvD.mjs → native-subagent-pending-assignments-BDqhOdJp.mjs} +0 -4
  58. package/dist/.setup/{native-task-assignments-DMQ0g3hu.mjs → native-task-assignments-C6KVqiN1.mjs} +9 -8
  59. package/dist/.setup/{node-cli-sessions-HC4W6FLI.mjs → node-cli-sessions-B5oNDkUS.mjs} +11 -17
  60. package/dist/.setup/{node-exec-server.runtime-BgBfWQqo.mjs → node-exec-server.runtime-0xSEjKYt.mjs} +2 -2
  61. package/dist/.setup/{plan-DPdMk1Oy.mjs → plan-BJ37d2Og.mjs} +67 -89
  62. package/dist/.setup/{plugin-activation-cNHRfaxU.mjs → plugin-activation-BcyBv8PG.mjs} +4 -4
  63. package/dist/.setup/{plugin-app-cache-key-BL9B5H0L.mjs → plugin-app-cache-key-BW8rd98k.mjs} +11 -15
  64. package/dist/.setup/plugin-approval-roundtrip-CuahdPLC.mjs +109 -0
  65. package/dist/.setup/{plugin-inventory-Cky2XJUw.mjs → plugin-inventory-Bf0_piTw.mjs} +29 -51
  66. package/dist/.setup/{plugin-marketplace-discovery-D_dV9FXa.mjs → plugin-marketplace-discovery-SQPhSuic.mjs} +2 -16
  67. package/dist/.setup/plugin-metadata-cache-DWnB7VMj.mjs +84 -0
  68. package/dist/.setup/plugin-thread-config-deadline-B8LGaZNW.mjs +124 -0
  69. package/dist/.setup/{provider-D6F_7p1I.mjs → provider-BnwHVD_z.mjs} +4 -4
  70. package/dist/.setup/provider-capabilities-D68Whix6.mjs +50 -0
  71. package/dist/.setup/{rate-limits-B7-X2TgG.mjs → rate-limits-CMPy24F5.mjs} +1 -5
  72. package/dist/.setup/{request-BZOfsSXW.mjs → request-jSbhc1sg.mjs} +189 -49
  73. package/dist/.setup/rpc-error-hmWM21RB.mjs +57 -0
  74. package/dist/.setup/{run-attempt-dYJhjZrp.mjs → run-attempt-BLDZeYLD.mjs} +553 -727
  75. package/dist/.setup/{run-attempt-lifecycle-C-6O3Exn.mjs → run-attempt-lifecycle-BuZgVbDA.mjs} +19 -3
  76. package/dist/.setup/{runtime-artifact-DDQ-HGXf.mjs → runtime-artifact-CUTOOnKw.mjs} +5 -6
  77. package/dist/.setup/{runtime-artifact-connection-D68qQn1m.mjs → runtime-artifact-connection-CADz3_BY.mjs} +5 -4
  78. package/dist/.setup/{sandbox-guard-DjCz2eOw.mjs → sandbox-guard-WqE8yPge.mjs} +3 -3
  79. package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +15 -0
  80. package/dist/.setup/{session-binding-DGCYAfvD.mjs → session-binding-Ce7BqiPN.mjs} +92 -102
  81. package/dist/.setup/session-binding-meta-Lkm5Lpf4.mjs +15 -0
  82. package/dist/.setup/session-binding-record-BZB8RgcF.mjs +179 -0
  83. package/dist/.setup/session-binding-record-codec-z4ZpDn6E.mjs +216 -0
  84. package/dist/.setup/{session-binding-sidecars-jo6H8dFr.mjs → session-binding-sidecars-BrdV95Fg.mjs} +8 -2
  85. package/dist/.setup/{session-catalog-adoption-BU_pHWG7.mjs → session-catalog-adoption-CPIP4S_y.mjs} +34 -18
  86. package/dist/.setup/{session-catalog-archive-spHfihri.mjs → session-catalog-archive-DcgwvSbF.mjs} +24 -29
  87. package/dist/.setup/{session-catalog-events-BMCFMZw-.mjs → session-catalog-events-Bdjw9HEn.mjs} +5 -5
  88. package/dist/.setup/{session-catalog-index-DwJjnF5k.mjs → session-catalog-index-DufISKJ6.mjs} +361 -72
  89. package/dist/.setup/{session-catalog-index-order-BcQpHks3.mjs → session-catalog-index-order-nhyO0wdW.mjs} +1 -1
  90. package/dist/.setup/{session-catalog-limits-DDxOsQeC.mjs → session-catalog-limits-DEU36Qlo.mjs} +1 -1
  91. package/dist/.setup/{session-catalog-index-state-TeO7EyO-.mjs → session-catalog-list-request-tXephOB4.mjs} +180 -6
  92. package/dist/.setup/{session-catalog-native-projection-CuaFZuQE.mjs → session-catalog-native-projection-D6IiLtMb.mjs} +7 -6
  93. package/dist/.setup/{session-catalog-node-adoption-DgXvSGu0.mjs → session-catalog-node-adoption-7-WEQTB1.mjs} +12 -2
  94. package/dist/.setup/{session-catalog-node-continue-DjKXHBbi.mjs → session-catalog-node-continue-DLWBwAAO.mjs} +11 -15
  95. package/dist/.setup/{session-catalog-node-lookup-CtAXI5W5.mjs → session-catalog-node-lookup-Uufckwcm.mjs} +2 -2
  96. package/dist/.setup/{session-catalog-parsing-CPGaPYr-.mjs → session-catalog-parsing-B-qWJh2x.mjs} +70 -28
  97. package/dist/.setup/{session-catalog-projection-CGfzfP93.mjs → session-catalog-projection-8aHNwzWD.mjs} +6 -122
  98. package/dist/.setup/{session-catalog-provenance-DoAvktcj.mjs → session-catalog-provenance-CmsOE5mh.mjs} +6 -1
  99. package/dist/.setup/{session-cli-DlmBHYIe.mjs → session-cli-kH4vuGod.mjs} +1 -2
  100. package/dist/.setup/{session-history-D83lJWHG.mjs → session-history-BogBHKLk.mjs} +1 -1
  101. package/dist/.setup/{session-history-import-WhX-X33a.mjs → session-history-import-NWKPa4ZO.mjs} +4 -4
  102. package/dist/.setup/{session-history-read-Ov3StuL4.mjs → session-history-read-CNN8zwbD.mjs} +8 -19
  103. package/dist/.setup/{session-history.worker-MnPKncqP.mjs → session-history.worker-Cq_4DYgN.mjs} +3 -3
  104. package/dist/.setup/{session-initialization-6aveB9qb.mjs → session-initialization-D6dtFQkE.mjs} +2 -2
  105. package/dist/.setup/{session-permission-policy-Ci_fVX6y.mjs → session-permission-policy-BxIUJ0Zd.mjs} +8 -37
  106. package/dist/.setup/{session-retirement-LlYWBKTJ.mjs → session-retirement-Czbchv_O.mjs} +14 -15
  107. package/dist/.setup/{settled-turn-context-D4yj4rxf.mjs → settled-turn-context-BZsMjkIO.mjs} +13 -6
  108. package/dist/.setup/{settled-turn-finalizer-DW9W3gza.mjs → settled-turn-finalizer-DjZsIwbZ.mjs} +8 -8
  109. package/dist/.setup/{shared-client-CJCTeFpQ.mjs → shared-client-qhyYWbew.mjs} +291 -272
  110. package/dist/.setup/{provider-capabilities-DG5qbsUZ.mjs → shell-dynamic-tools-D3Brj3g9.mjs} +16 -55
  111. package/dist/.setup/{side-question-BLeGj7TQ.mjs → side-question-D3NJlgbl.mjs} +99 -91
  112. package/dist/.setup/{source-CJis_1EF.mjs → source-BYu0T780.mjs} +24 -40
  113. package/dist/.setup/{thread-lifecycle-_bAbjedG.mjs → thread-lifecycle-Cbz_7ySv.mjs} +262 -305
  114. package/dist/.setup/{thread-ownership-B6pPt21M.mjs → thread-ownership-DwuSrt3s.mjs} +10 -8
  115. package/dist/.setup/{thread-policy-gNPzzpVp.mjs → thread-policy-DoNxbhqt.mjs} +22 -21
  116. package/dist/.setup/{thread-requests-OWGOiDaV.mjs → thread-requests-CL1e8Wmx.mjs} +107 -98
  117. package/dist/.setup/{thread-resume-GOry0AYh.mjs → thread-resume-BT6NHMkM.mjs} +10 -18
  118. package/dist/.setup/{transcript-history-projection-DRSifI-1.mjs → transcript-history-projection-B9a7HwUV.mjs} +11 -16
  119. package/dist/.setup/{transcript-mirror-kxmCYsuF.mjs → transcript-mirror-BfLRARNL.mjs} +64 -67
  120. package/dist/.setup/{transport-stdio-Bdegpn2V.mjs → transport-stdio-a0HDa2Mj.mjs} +27 -8
  121. package/dist/.setup/{transport-websocket-BTBE-LD9.mjs → transport-websocket-zqJ0Cmtn.mjs} +3 -8
  122. package/dist/.setup/{attempt-client-cleanup-B-S7ngS_.mjs → turn-router-sS69wYnI.mjs} +75 -170
  123. package/dist/.setup/{upstream-session-fork-gkdRj2yH.mjs → upstream-session-fork-ChSld66u.mjs} +35 -46
  124. package/dist/.setup/{usage-CApUvLOV.mjs → usage-D8e8Xiqf.mjs} +4 -4
  125. package/dist/.setup/{usage-limit-error-wSMQkbpV.mjs → usage-limit-error-GbT-5NcW.mjs} +4 -4
  126. package/dist/.setup/{web-search-provider.runtime-UKgeiBUG.mjs → web-search-provider.runtime-dL2GD1Kl.mjs} +4 -20
  127. package/dist/.setup/websocket-data-XlRvt8Ys.mjs +6 -0
  128. package/dist/.setup/workspace-write-sandbox-probe-DmUHLrrl.mjs +118 -0
  129. package/dist/api.js +34 -54
  130. package/dist/catalog-page.worker.js +1 -1
  131. package/dist/cli-metadata.js +1 -1
  132. package/dist/doctor-contract-api.js +15 -27
  133. package/dist/harness.js +37 -22
  134. package/dist/index.js +2880 -276
  135. package/dist/media-understanding-provider.js +2 -2
  136. package/dist/migration-provider-api.js +1 -1
  137. package/dist/native-session-binding-api.js +2 -0
  138. package/dist/provider-discovery.js +1 -1
  139. package/dist/session-history-worker-runtime.js +33 -4
  140. package/dist/session-history.worker.js +1 -1
  141. package/openclaw.plugin.json +3 -3
  142. package/package.json +6 -6
  143. package/dist/.setup/config-utils-D0CXecki.mjs +0 -57
  144. package/dist/.setup/incognito-session-DWYapfwf.mjs +0 -2
  145. package/dist/.setup/managed-thread-store-BMqgThVL.mjs +0 -100
  146. package/dist/.setup/rpc-error-BlD2vuzn.mjs +0 -31
  147. package/dist/.setup/session-binding-meta-B7aEMU7g.mjs +0 -6
  148. package/dist/.setup/session-binding-record-Oe9L-CNY.mjs +0 -375
  149. package/dist/.setup/session-catalog-BFafIiF6.mjs +0 -2599
  150. package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +0 -170
  151. package/dist/.setup/shared-client-lifecycle-7xgtlo15.mjs +0 -153
@@ -1,11 +1,19 @@
1
- import { h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-CJCTeFpQ.mjs";
2
- import { dt as normalizeCodexDynamicToolName } from "./thread-requests-OWGOiDaV.mjs";
1
+ import { ft as normalizeCodexDynamicToolName } from "./thread-requests-CL1e8Wmx.mjs";
3
2
  import { pinExecToolTarget } from "openclaw/plugin-sdk/codex-mcp-projection";
4
3
  import { loadNodeExecAvailability } from "openclaw/plugin-sdk/node-selection-runtime";
5
4
  //#region extensions/codex/src/app-server/shell-dynamic-tools.ts
6
5
  const CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME = "node_exec";
7
6
  const CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME = "gateway_exec";
8
7
  const CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME = "gateway_process";
8
+ const CODEX_DISABLED_NATIVE_SHELL_DYNAMIC_TOOLS = /* @__PURE__ */ new Set([
9
+ "exec",
10
+ "process",
11
+ "sandbox_exec",
12
+ "sandbox_process",
13
+ CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME,
14
+ CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME,
15
+ CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME
16
+ ]);
9
17
  const PROCESS_FOLLOWUP_TEXT = "Use process (list/poll/log/write/send-keys/submit/paste/kill/clear/remove) for follow-up.";
10
18
  function isCodexDynamicToolExcluded(config, names) {
11
19
  const normalizedNames = new Set(names.map((name) => normalizeCodexDynamicToolName(name)));
@@ -67,58 +75,11 @@ function createSandboxProcessProjection(processTool) {
67
75
  description: "Manage background shell sessions through OpenClaw's configured sandbox backend for this session: list, poll, log, write, send-keys, submit, paste, kill, clear, or remove. Use only for sandbox follow-up; use Codex's native shell session handling only when no OpenClaw sandbox is active and native Code Mode is available."
68
76
  };
69
77
  }
70
- //#endregion
71
- //#region extensions/codex/src/app-server/provider-capabilities.ts
72
- function resolveOverriddenProviderWebSearchSupport(modelProviderOverride) {
73
- const provider = modelProviderOverride?.trim().toLowerCase();
74
- if (!provider) return;
75
- return provider === "openai" ? "supported" : "unsupported";
76
- }
77
- async function readConfiguredProviderWebSearchSupport(params) {
78
- if (params.expectedNativeModelProvider) {
79
- if (((await params.client.request("config/read", { includeLayers: false }, {
80
- timeoutMs: params.timeoutMs,
81
- signal: params.signal
82
- })).config.model_provider ?? "openai") !== params.expectedNativeModelProvider) return "unknown";
83
- }
84
- return (await params.client.request("modelProvider/capabilities/read", {}, {
85
- timeoutMs: params.timeoutMs,
86
- signal: params.signal
87
- })).webSearch ? "supported" : "unsupported";
88
- }
89
- async function resolveCodexProviderWebSearchSupportForClient(params) {
90
- const overrideSupport = resolveOverriddenProviderWebSearchSupport(params.modelProviderOverride);
91
- if (overrideSupport) return overrideSupport;
92
- try {
93
- return await readConfiguredProviderWebSearchSupport(params);
94
- } catch {
95
- return "unknown";
96
- }
97
- }
98
- async function resolveCodexProviderWebSearchSupport(params) {
99
- const overrideSupport = resolveOverriddenProviderWebSearchSupport(params.modelProviderOverride);
100
- if (overrideSupport) return overrideSupport;
101
- let client;
102
- try {
103
- client = await params.clientFactory({
104
- startOptions: params.appServer.start,
105
- ...params.preparedAuth ? { preparedAuth: params.preparedAuth } : { authProfileId: params.authProfileId },
106
- agentDir: params.agentDir,
107
- config: params.config,
108
- timeoutMs: params.appServer.requestTimeoutMs
109
- });
110
- return await resolveCodexProviderWebSearchSupportForClient({
111
- client,
112
- timeoutMs: params.appServer.requestTimeoutMs,
113
- modelProviderOverride: params.modelProviderOverride,
114
- expectedNativeModelProvider: params.expectedNativeModelProvider,
115
- signal: params.signal
116
- });
117
- } catch {
118
- return "unknown";
119
- } finally {
120
- if (client) releaseLeasedSharedCodexAppServerClient(client);
121
- }
78
+ /** Keeps replacement shell tools direct even when model metadata mandates Codex Code Mode. */
79
+ function placeDisabledNativeShellToolsInDirectNamespace(tools, nativeToolSurfaceEnabled) {
80
+ if (nativeToolSurfaceEnabled !== false) return tools;
81
+ for (const tool of tools) if (CODEX_DISABLED_NATIVE_SHELL_DYNAMIC_TOOLS.has(normalizeCodexDynamicToolName(tool.name))) tool.catalogMode = "direct-only";
82
+ return tools;
122
83
  }
123
84
  //#endregion
124
- export { CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME as a, createNodeExecAliasDynamicTool as c, isCodexDynamicToolExcluded as d, CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME as i, createSandboxExecProjection as l, resolveCodexProviderWebSearchSupportForClient as n, createGatewayExecProjection as o, CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME as r, createGatewayProcessProjection as s, resolveCodexProviderWebSearchSupport as t, createSandboxProcessProjection as u };
85
+ export { createGatewayProcessProjection as a, createSandboxProcessProjection as c, createGatewayExecProjection as i, isCodexDynamicToolExcluded as l, CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME as n, createNodeExecAliasDynamicTool as o, CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME as r, createSandboxExecProjection as s, CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME as t, placeDisabledNativeShellToolsInDirectNamespace as u };
@@ -1,30 +1,32 @@
1
1
  import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
2
- import { v as sessionBindingIdentity } from "./session-binding-record-Oe9L-CNY.mjs";
3
- import { c as shouldAutoApproveCodexAppServerApprovals, l as withMcpElicitationsApprovalPolicy, m as readCodexRequirementsToml, n as hasCodexMcpToolApprovalOverrides } from "./config-security-CE-FcGw9.mjs";
4
- import { c as isCodexPairedNodeRemoteExecPlacementSandbox, d as readCodexPluginConfig, l as isCodexRemoteExecPlacementSandbox, u as isCodexSandboxExecServerEnabled } from "./config-parsing-b088LyhT.mjs";
5
- import { i as resolveCodexAppServerHomeScope, l as resolveCodexModelBackedReviewerPolicyContext } from "./config-options-CzyWLTJt.mjs";
6
- import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-B7-X2TgG.mjs";
7
- import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-DTtN1KrX.mjs";
8
- import { n as canUseCodexModelBackedApprovalsReviewerForModel, r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-DKhXquav.mjs";
9
- import { X as readRecentCodexRateLimits, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, tt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-CJCTeFpQ.mjs";
10
- import { A as handleDynamicToolCallWithTimeout, B as resolveCodexToolAbortTerminalReason, P as resolveDynamicToolCallTimeoutMs, S as assertCodexTurnStartResponse, i as isCodexAppServerApprovalRequest, k as createCodexElicitationResponse, s as isCodexAppServerIndeterminateRequestCancellationError, w as readCodexDynamicToolCallParams, y as assertCodexThreadForkResponse, z as toCodexDynamicToolProtocolResponse } from "./client-qyUBJlGZ.mjs";
11
- import { f as terminateCodexBackgroundTerminals, p as unsubscribeCodexThreadBestEffort, s as interruptCodexTurnAndWaitBestEffort, u as retireUnsafeCodexTurnClientBestEffort } from "./attempt-client-cleanup-B-S7ngS_.mjs";
12
- import { t as CodexEphemeralTurn } from "./ephemeral-turn-DiCS1ijR.mjs";
13
- import { Ct as refreshCodexPluginAppApprovalPolicy, D as buildCodexNativeHookRelayConfig, M as resolveCodexNativeHookRelayEvents, N as resolveCodexNativeHookRelayTtlMs, O as buildCodexNativeHookRelayDisabledConfig, St as mergeCodexThreadConfigs, ft as resolveCodexDynamicToolsLoading, g as CODEX_NATIVE_PERSONALITY_NONE, p as resolveCodexWebSearchPlan, r as buildCodexRuntimeThreadConfig, y as resolveCodexAppServerThreadModelSelection } from "./thread-requests-OWGOiDaV.mjs";
14
- import { S as resolveCodexAppServerReasoningEffort, o as buildCodexUserInput, r as buildCodexTemporalAdditionalContext, x as readCodexSupportedReasoningEfforts } from "./thread-lifecycle-_bAbjedG.mjs";
15
- import { o as resolveCodexSessionBinding } from "./session-binding-DGCYAfvD.mjs";
16
- import { a as refreshCodexThreadPolicy, i as assertCodexSupervisionThreadLineage, n as CodexThreadPolicyHandoffError } from "./thread-policy-gNPzzpVp.mjs";
17
- import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-DjCz2eOw.mjs";
18
- import { E as CodexNativeToolLifecycleProjector, a as emitDynamicToolStartedDiagnostic, b as createCodexNativePreToolUseFailureBuffer, c as buildDynamicTools, f as resolveCodexExternalSandboxPolicyForOpenClawSandbox, g as shouldRequireCodexSandboxExecServerEnvironment, h as shouldEnableCodexAppServerNativeToolSurface, i as emitDynamicToolErrorDiagnostic, m as resolveCodexSandboxEnvironmentSelection, o as emitDynamicToolTerminalDiagnostic, p as resolveCodexMessageToolProvider, r as routeCodexAppServerElicitationRequest, s as handleCodexAppServerApprovalRequest, t as createCodexDynamicToolBridge, v as ensureCodexSandboxExecServerEnvironment, y as releaseCodexSandboxExecServerEnvironment } from "./dynamic-tools-Db2sY5cZ.mjs";
19
- import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-Ci_fVX6y.mjs";
20
- import { n as resolveCodexProviderWebSearchSupportForClient } from "./provider-capabilities-DG5qbsUZ.mjs";
2
+ import { m as sessionBindingIdentity } from "./session-binding-record-BZB8RgcF.mjs";
3
+ import { c as shouldAutoApproveCodexAppServerApprovals, f as readCodexRequirementsToml, l as withMcpElicitationsApprovalPolicy, n as hasCodexMcpToolApprovalOverrides } from "./config-security-KAPScztc.mjs";
4
+ import { c as isCodexPairedNodeRemoteExecPlacementSandbox, d as readCodexPluginConfig, l as isCodexRemoteExecPlacementSandbox, u as isCodexSandboxExecServerEnabled } from "./config-parsing-BQq-CHTF.mjs";
5
+ import { i as resolveCodexAppServerHomeScope, l as resolveCodexModelBackedReviewerPolicyContext } from "./config-options-HG_Rr3W_.mjs";
6
+ import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-CMPy24F5.mjs";
7
+ import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-C-08ez1w.mjs";
8
+ import { n as canUseCodexModelBackedApprovalsReviewerForModel, r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-0Gxk3_eq.mjs";
9
+ import { X as readRecentCodexRateLimits, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, tt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-qhyYWbew.mjs";
10
+ import { N as toCodexDynamicToolProtocolResponse, P as resolveCodexToolAbortTerminalReason, T as handleDynamicToolCallWithTimeout, _ as assertCodexTurnStartResponse, a as isCodexAppServerIndeterminateRequestCancellationError, k as resolveDynamicToolCallTimeoutMs, m as assertCodexThreadForkResponse, r as isCodexAppServerApprovalRequest, w as createCodexElicitationResponse, y as readCodexDynamicToolCallParams } from "./client-C8lgBOoO.mjs";
11
+ import { d as terminateCodexBackgroundTerminals, f as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, s as interruptCodexTurnAndWaitBestEffort } from "./attempt-client-cleanup-BH0hW2xU.mjs";
12
+ import { t as CodexEphemeralTurn } from "./ephemeral-turn-D8VcDTNo.mjs";
13
+ import { Ct as mergeCodexThreadConfigs, N as resolveCodexNativeHookRelayEvents, O as buildCodexNativeHookRelayConfig, P as resolveCodexNativeHookRelayTtlMs, _ as CODEX_NATIVE_PERSONALITY_NONE, b as resolveCodexAppServerThreadModelSelection, k as buildCodexNativeHookRelayDisabledConfig, m as resolveCodexWebSearchPlan, pt as resolveCodexDynamicToolsLoading, r as buildCodexRuntimeThreadConfig, wt as refreshCodexPluginAppApprovalPolicy } from "./thread-requests-CL1e8Wmx.mjs";
14
+ import { b as resolveCodexAppServerReasoningEffort, o as buildCodexUserInput, r as buildCodexTemporalAdditionalContext, y as readCodexSupportedReasoningEfforts } from "./thread-lifecycle-Cbz_7ySv.mjs";
15
+ import { r as resolveCodexSessionBinding } from "./session-binding-Ce7BqiPN.mjs";
16
+ import { i as assertCodexSupervisionThreadLineage, n as CodexThreadPolicyHandoffError, o as refreshCodexThreadPolicy } from "./thread-policy-DoNxbhqt.mjs";
17
+ import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-WqE8yPge.mjs";
18
+ import { a as resolveCodexExternalSandboxPolicyForOpenClawSandbox, c as shouldEnableCodexAppServerNativeToolSurface, l as shouldRequireCodexSandboxExecServerEnvironment, o as resolveCodexMessageToolProvider, s as resolveCodexSandboxEnvironmentSelection, t as buildDynamicTools } from "./dynamic-tool-build-C8xGEXmR.mjs";
19
+ import { i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-BxIUJ0Zd.mjs";
20
+ import { a as emitDynamicToolStartedDiagnostic, c as ensureCodexSandboxExecServerEnvironment, i as emitDynamicToolErrorDiagnostic, l as releaseCodexSandboxExecServerEnvironment, m as CodexNativeToolLifecycleProjector, o as emitDynamicToolTerminalDiagnostic, r as routeCodexAppServerElicitationRequest, s as handleCodexAppServerApprovalRequest, t as createCodexDynamicToolBridge, u as createCodexNativePreToolUseFailureBuffer } from "./dynamic-tools-DyERJnR6.mjs";
21
+ import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-Bg4FZw1f.mjs";
22
+ import { n as resolveCodexProviderWebSearchSupportForClient } from "./provider-capabilities-D68Whix6.mjs";
21
23
  import { readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
22
24
  import { randomUUID } from "node:crypto";
23
25
  import { isDeepStrictEqual } from "node:util";
24
26
  import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
25
27
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
26
- import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
27
28
  import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage as formatErrorMessage$1, resolveSandboxContext, runAgentCleanupStep } from "openclaw/plugin-sdk/agent-harness-runtime";
29
+ import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
28
30
  import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
29
31
  import { loadCodexBundleMcpApprovalConfig, resolveCodexMcpToolOverridesForAgent } from "openclaw/plugin-sdk/codex-mcp-projection";
30
32
  import { registerNativeHookRelayForBundledRuntime } from "openclaw/plugin-sdk/native-hook-relay-runtime";
@@ -81,6 +83,69 @@ You may perform non-mutating inspection, including reading or searching files an
81
83
 
82
84
  Do not modify files, source, git state, permissions, configuration, workspace state, or external state unless the user explicitly requests that mutation in this side conversation. Do not request escalated permissions or broader sandbox access unless the user explicitly requests a mutation that requires it. If the user explicitly requests a mutation, keep it minimal, local to the request, and avoid disrupting the main thread.`;
83
85
  //#endregion
86
+ //#region extensions/codex/src/app-server/side-question-run-params.ts
87
+ function buildSideRunAttemptParams(params, options) {
88
+ return {
89
+ params,
90
+ config: params.cfg,
91
+ agentDir: params.agentDir,
92
+ provider: params.provider,
93
+ modelId: params.model,
94
+ model: params.runtimeModel ?? {
95
+ id: params.model,
96
+ provider: params.provider
97
+ },
98
+ prompt: params.question,
99
+ timeoutMs: options.timeoutMs,
100
+ sessionId: params.sessionId,
101
+ sessionFile: params.sessionFile,
102
+ sessionKey: params.sessionKey,
103
+ ...params.sandboxSessionKey ? { sandboxSessionKey: params.sandboxSessionKey } : {},
104
+ agentId: params.agentId,
105
+ ...params.messageChannel ? { messageChannel: params.messageChannel } : {},
106
+ ...params.messageProvider ? { messageProvider: params.messageProvider } : {},
107
+ ...params.chatType ? { chatType: params.chatType } : {},
108
+ ...params.agentAccountId ? { agentAccountId: params.agentAccountId } : {},
109
+ ...params.messageTo ? { messageTo: params.messageTo } : {},
110
+ ...params.messageThreadId !== void 0 ? { messageThreadId: params.messageThreadId } : {},
111
+ ...params.chatId ? { chatId: params.chatId } : {},
112
+ ...params.messageActionTurnCapability ? { messageActionTurnCapability: params.messageActionTurnCapability } : {},
113
+ ...params.groupId !== void 0 ? { groupId: params.groupId } : {},
114
+ ...params.groupChannel !== void 0 ? { groupChannel: params.groupChannel } : {},
115
+ ...params.groupSpace !== void 0 ? { groupSpace: params.groupSpace } : {},
116
+ ...params.memberRoleIds ? { memberRoleIds: params.memberRoleIds } : {},
117
+ ...params.spawnedBy !== void 0 ? { spawnedBy: params.spawnedBy } : {},
118
+ ...params.senderId !== void 0 ? { senderId: params.senderId } : {},
119
+ ...params.senderName !== void 0 ? { senderName: params.senderName } : {},
120
+ ...params.senderUsername !== void 0 ? { senderUsername: params.senderUsername } : {},
121
+ ...params.senderE164 !== void 0 ? { senderE164: params.senderE164 } : {},
122
+ ...params.senderIsOwner !== void 0 ? { senderIsOwner: params.senderIsOwner } : {},
123
+ ...params.currentChannelId ? { currentChannelId: params.currentChannelId } : {},
124
+ ...params.toolsAllow ? { toolsAllow: params.toolsAllow } : {},
125
+ workspaceDir: options.cwd,
126
+ authProfileId: options.authProfileId,
127
+ authProfileIdSource: options.authProfileId ? params.preparedRuntimeAuth.plan.forwardedAuthProfileSource : void 0,
128
+ thinkLevel: params.resolvedThinkLevel ?? "off",
129
+ resolvedReasoningLevel: params.resolvedReasoningLevel,
130
+ authStorage: params.preparedRuntimeAuth.authStorage,
131
+ authProfileStore: params.preparedRuntimeAuth.authProfileStore,
132
+ modelRegistry: params.preparedRuntimeAuth.modelRegistry,
133
+ preparedModelRuntime: params.preparedModelRuntime,
134
+ ...params.preparedRuntimeAuth.resolvedApiKey ? { resolvedApiKey: params.preparedRuntimeAuth.resolvedApiKey } : {},
135
+ runId: options.runId,
136
+ abortSignal: params.opts?.abortSignal,
137
+ onAgentEvent: (event) => {
138
+ if (event.stream === "approval") params.opts?.onApprovalEvent?.(event.data);
139
+ },
140
+ onBlockReply: params.opts?.onBlockReply,
141
+ onPartialReply: params.opts?.onPartialReply,
142
+ onToolResult: params.opts?.onToolResult,
143
+ requireExplicitMessageTarget: true,
144
+ hostCapabilities: params.hostCapabilities,
145
+ sandbox: params.sandbox
146
+ };
147
+ }
148
+ //#endregion
84
149
  //#region extensions/codex/src/app-server/side-question.ts
85
150
  const SIDE_QUESTION_COMPLETION_TIMEOUT_MS = 6e5;
86
151
  var CodexSideQuestionTimeoutError = class extends Error {
@@ -97,7 +162,7 @@ async function runCodexAppServerSideQuestion(params, options) {
97
162
  config: params.cfg
98
163
  });
99
164
  const hostCapabilities = params.hostCapabilities;
100
- const { binding, assertCurrent } = await resolveCodexSessionBinding({
165
+ const { binding, authority } = await resolveCodexSessionBinding({
101
166
  bindingStore: options.bindingStore,
102
167
  identity: bindingIdentity,
103
168
  config: params.cfg,
@@ -105,6 +170,7 @@ async function runCodexAppServerSideQuestion(params, options) {
105
170
  assertCurrent: hostCapabilities.assertActive,
106
171
  signal: params.opts?.abortSignal
107
172
  });
173
+ const assertCurrent = authority.assertCurrent;
108
174
  if (!binding?.threadId) throw new Error("Codex /btw needs an active Codex thread. Send a normal message first, then try /btw again.");
109
175
  if (isCodexPairedNodeRemoteExecPlacementSandbox(params.sandbox)) throw new Error("Normal Codex turns are supported on nodes, but /btw is not yet bound to the active placement.");
110
176
  const pluginConfig = readCodexPluginConfig(options.pluginConfig);
@@ -256,7 +322,7 @@ async function runCodexAppServerSideQuestion(params, options) {
256
322
  if (nativeExecutionBlock) throw new Error(nativeExecutionBlock);
257
323
  if (!nativeToolSurfaceEnabled) throw new Error("Codex-native /btw side-question mode is unavailable because the effective tool policy restricts Codex native tools for this session.");
258
324
  const clientOptions = {
259
- assertCurrent,
325
+ assertCurrent: authority.assertLegacyCurrent,
260
326
  startOptions: appServer.start,
261
327
  timeoutMs: appServer.requestTimeoutMs,
262
328
  authRequirement: preparedRuntimeAuth.plan.modelRoute?.authRequirement,
@@ -370,7 +436,7 @@ async function runCodexAppServerSideQuestion(params, options) {
370
436
  });
371
437
  return approvalResult.kind === "handled" ? approvalResult.response : createCodexElicitationResponse("decline", null, { message: "OpenClaw Codex side questions do not support interactive MCP input." });
372
438
  }
373
- if (request.method === "item/tool/requestUserInput") return isSideUserInputRequest(request.params, childThreadId, turnId) ? { answers: {} } : void 0;
439
+ if (request.method === "item/tool/requestUserInput") return isJsonObject(request.params) && request.params.threadId === childThreadId && request.params.turnId === turnId ? { answers: {} } : void 0;
374
440
  if (isCodexAppServerApprovalRequest(request.method)) return handleCodexAppServerApprovalRequest({
375
441
  method: request.method,
376
442
  requestParams: request.params,
@@ -459,7 +525,7 @@ async function runCodexAppServerSideQuestion(params, options) {
459
525
  }),
460
526
  signal: runAbortController.signal,
461
527
  runBeforeToolCall: sideRunParams.hostCapabilities.runBeforeToolCall,
462
- assertActive: assertCurrent,
528
+ assertActive: authority.assertLegacyCurrent,
463
529
  onPreToolUseFailure: (failure) => {
464
530
  if (!nativePreToolUseFailures.active && nativeToolLifecycleProjector) nativeToolLifecycleProjector.recordPreToolUseFailure(failure, nativeToolRunWasAbortedBeforeCleanup);
465
531
  else nativePreToolUseFailures.record(failure);
@@ -493,6 +559,7 @@ async function runCodexAppServerSideQuestion(params, options) {
493
559
  const scoped = requestOptions();
494
560
  return {
495
561
  ...scoped,
562
+ withCurrent: authority.withCurrent,
496
563
  assertCurrent: () => {
497
564
  scoped.assertCurrent();
498
565
  assertCurrentBinding();
@@ -567,6 +634,7 @@ async function runCodexAppServerSideQuestion(params, options) {
567
634
  threadId: childThreadId,
568
635
  developerInstructions: SIDE_DEVELOPER_INSTRUCTIONS,
569
636
  ...scoped,
637
+ withCurrent: authority.withCurrent,
570
638
  signal: runAbortController.signal,
571
639
  assertCurrent: () => {
572
640
  assertCurrent();
@@ -579,6 +647,9 @@ async function runCodexAppServerSideQuestion(params, options) {
579
647
  throw error instanceof CodexThreadPolicyHandoffError ? error : new CodexThreadPolicyHandoffError("not-written", error);
580
648
  }
581
649
  return response.thread.id;
650
+ }, {
651
+ assertCurrent,
652
+ authority
582
653
  }),
583
654
  onClientChange: (nextClient) => {
584
655
  client = nextClient;
@@ -615,7 +686,8 @@ async function runCodexAppServerSideQuestion(params, options) {
615
686
  }, {
616
687
  timeoutMs: appServer.requestTimeoutMs,
617
688
  signal: runAbortController.signal,
618
- assertCurrent
689
+ assertCurrent,
690
+ withCurrent: authority.withCurrent
619
691
  }).catch((error) => {
620
692
  if (isCodexAppServerIndeterminateRequestCancellationError(error)) turnId = "";
621
693
  throw error;
@@ -650,10 +722,10 @@ async function runCodexAppServerSideQuestion(params, options) {
650
722
  if (result.turn?.status === "interrupted") throw new Error("Codex /btw side thread was interrupted.");
651
723
  assertCurrent();
652
724
  if (!result.text) throw new Error("Codex /btw completed without an answer.");
653
- return {
725
+ return await authority.withCurrent(() => ({
654
726
  text: result.text,
655
727
  usage: result.usage
656
- };
728
+ }));
657
729
  } catch (error) {
658
730
  primaryFailure = { error };
659
731
  throw error;
@@ -693,67 +765,6 @@ async function runCodexAppServerSideQuestion(params, options) {
693
765
  });
694
766
  }
695
767
  }
696
- function buildSideRunAttemptParams(params, options) {
697
- return {
698
- params,
699
- config: params.cfg,
700
- agentDir: params.agentDir,
701
- provider: params.provider,
702
- modelId: params.model,
703
- model: params.runtimeModel ?? {
704
- id: params.model,
705
- provider: params.provider
706
- },
707
- prompt: params.question,
708
- timeoutMs: options.timeoutMs,
709
- sessionId: params.sessionId,
710
- sessionFile: params.sessionFile,
711
- sessionKey: params.sessionKey,
712
- ...params.sandboxSessionKey ? { sandboxSessionKey: params.sandboxSessionKey } : {},
713
- agentId: params.agentId,
714
- ...params.messageChannel ? { messageChannel: params.messageChannel } : {},
715
- ...params.messageProvider ? { messageProvider: params.messageProvider } : {},
716
- ...params.chatType ? { chatType: params.chatType } : {},
717
- ...params.agentAccountId ? { agentAccountId: params.agentAccountId } : {},
718
- ...params.messageTo ? { messageTo: params.messageTo } : {},
719
- ...params.messageThreadId !== void 0 ? { messageThreadId: params.messageThreadId } : {},
720
- ...params.chatId ? { chatId: params.chatId } : {},
721
- ...params.messageActionTurnCapability ? { messageActionTurnCapability: params.messageActionTurnCapability } : {},
722
- ...params.groupId !== void 0 ? { groupId: params.groupId } : {},
723
- ...params.groupChannel !== void 0 ? { groupChannel: params.groupChannel } : {},
724
- ...params.groupSpace !== void 0 ? { groupSpace: params.groupSpace } : {},
725
- ...params.memberRoleIds ? { memberRoleIds: params.memberRoleIds } : {},
726
- ...params.spawnedBy !== void 0 ? { spawnedBy: params.spawnedBy } : {},
727
- ...params.senderId !== void 0 ? { senderId: params.senderId } : {},
728
- ...params.senderName !== void 0 ? { senderName: params.senderName } : {},
729
- ...params.senderUsername !== void 0 ? { senderUsername: params.senderUsername } : {},
730
- ...params.senderE164 !== void 0 ? { senderE164: params.senderE164 } : {},
731
- ...params.senderIsOwner !== void 0 ? { senderIsOwner: params.senderIsOwner } : {},
732
- ...params.currentChannelId ? { currentChannelId: params.currentChannelId } : {},
733
- ...params.toolsAllow ? { toolsAllow: params.toolsAllow } : {},
734
- workspaceDir: options.cwd,
735
- authProfileId: options.authProfileId,
736
- authProfileIdSource: options.authProfileId ? params.preparedRuntimeAuth.plan.forwardedAuthProfileSource : void 0,
737
- thinkLevel: params.resolvedThinkLevel ?? "off",
738
- resolvedReasoningLevel: params.resolvedReasoningLevel,
739
- authStorage: params.preparedRuntimeAuth.authStorage,
740
- authProfileStore: params.preparedRuntimeAuth.authProfileStore,
741
- modelRegistry: params.preparedRuntimeAuth.modelRegistry,
742
- preparedModelRuntime: params.preparedModelRuntime,
743
- ...params.preparedRuntimeAuth.resolvedApiKey ? { resolvedApiKey: params.preparedRuntimeAuth.resolvedApiKey } : {},
744
- runId: options.runId,
745
- abortSignal: params.opts?.abortSignal,
746
- onAgentEvent: (event) => {
747
- if (event.stream === "approval") params.opts?.onApprovalEvent?.(event.data);
748
- },
749
- onBlockReply: params.opts?.onBlockReply,
750
- onPartialReply: params.opts?.onPartialReply,
751
- onToolResult: params.opts?.onToolResult,
752
- requireExplicitMessageTarget: true,
753
- hostCapabilities: params.hostCapabilities,
754
- sandbox: params.sandbox
755
- };
756
- }
757
768
  async function createCodexSideToolBridge(input) {
758
769
  const { params } = input;
759
770
  const sandboxSessionKey = params.sandboxSessionKey?.trim() || params.sessionKey?.trim() || params.sessionId || input.sessionAgentId;
@@ -811,9 +822,6 @@ async function createCodexSideToolBridge(input) {
811
822
  webSearchPlan
812
823
  };
813
824
  }
814
- function isSideUserInputRequest(value, threadId, turnId) {
815
- return isJsonObject(value) && value.threadId === threadId && value.turnId === turnId;
816
- }
817
825
  async function forkCodexSideThread(client, params, options) {
818
826
  try {
819
827
  return await client.request("thread/fork", params, options);
@@ -1,13 +1,13 @@
1
- import { a as marketplaceRef, n as isOpenAiCuratedMarketplace, o as pluginReadParams, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-Cky2XJUw.mjs";
2
- import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BL9B5H0L.mjs";
3
- import { o as withCodexAppServerJsonClient } from "./request-BZOfsSXW.mjs";
4
- import "./config-DKhXquav.mjs";
5
- import { t as __exportAll } from "./session-binding-sidecars-jo6H8dFr.mjs";
1
+ import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BW8rd98k.mjs";
2
+ import { a as withCodexAppServerJsonClient } from "./request-jSbhc1sg.mjs";
3
+ import { a as pluginReadParams, i as marketplaceRef, l as CODEX_PLUGINS_MARKETPLACE_NAME, n as isOpenAiCuratedMarketplaceName } from "./plugin-inventory-Bf0_piTw.mjs";
4
+ import "./config-0Gxk3_eq.mjs";
5
+ import { t as __exportAll } from "./session-binding-sidecars-BrdV95Fg.mjs";
6
6
  import { asNonArrayRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import path from "node:path";
8
8
  import os from "node:os";
9
9
  import fs from "node:fs/promises";
10
- import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
10
+ import { coerceErrorMessage, extractErrorCode } from "openclaw/plugin-sdk/error-runtime";
11
11
  import { isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
12
12
  import { pathExists } from "openclaw/plugin-sdk/security-runtime";
13
13
  import { tryReadJson } from "@openclaw/fs-safe/json";
@@ -82,7 +82,7 @@ async function discoverCodexMemoryFile(candidate) {
82
82
  if (!stat.isFile()) throw new Error(`Codex memory source must be a regular file: ${candidate.path}`);
83
83
  return candidate;
84
84
  } catch (error) {
85
- if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") return;
85
+ if (extractErrorCode(error) === "ENOENT") return;
86
86
  throw error;
87
87
  }
88
88
  }
@@ -114,9 +114,6 @@ function defaultCodexHome() {
114
114
  const configuredHome = process.env.CODEX_HOME;
115
115
  return resolveHomePath(configuredHome !== void 0 && configuredHome.length > 0 ? configuredHome : "~/.codex");
116
116
  }
117
- function personalAgentsSkillsDir() {
118
- return path.join(resolveUserHomeDir(), ".agents", "skills");
119
- }
120
117
  async function discoverInstalledCuratedPlugins(codexHome, options = {}) {
121
118
  const startOptions = sourceCodexAppServerStartOptions(codexHome);
122
119
  try {
@@ -175,7 +172,7 @@ function sourceCodexAppServerStartOptions(codexHome) {
175
172
  function discoverInstalledCuratedPluginSources(response) {
176
173
  const installedByName = /* @__PURE__ */ new Map();
177
174
  for (const marketplace of response.marketplaces) {
178
- if (!isOpenAiCuratedMarketplace(marketplace)) continue;
175
+ if (!isOpenAiCuratedMarketplaceName(marketplace.name)) continue;
179
176
  const remote = !marketplace.path;
180
177
  for (const summary of marketplace.plugins) {
181
178
  if (!summary.installed) continue;
@@ -194,7 +191,7 @@ function discoverInstalledCuratedPluginSources(response) {
194
191
  enabled: summary.enabled
195
192
  },
196
193
  marketplace: marketplaceRef(marketplace, CODEX_PLUGINS_MARKETPLACE_NAME),
197
- ...remote ? { readPluginName: summary.remotePluginId?.trim() || void 0 } : { readPluginName: pluginName },
194
+ readPluginName: remote ? summary.remotePluginId?.trim() || void 0 : pluginName,
198
195
  remote
199
196
  });
200
197
  }
@@ -214,27 +211,34 @@ async function withPluginMigrationEligibility(params) {
214
211
  });
215
212
  continue;
216
213
  }
217
- const detail = await readPluginDetail(params.requestOptions, marketplace, plugin, readPluginName);
218
- if (!detail.ok) {
214
+ let detail;
215
+ try {
216
+ if (!readPluginName) throw new Error(`Codex remote plugin "${plugin.pluginName ?? plugin.name}" has no readable remote plugin id.`);
217
+ detail = (await params.requestOptions.request({
218
+ method: "plugin/read",
219
+ requestParams: pluginReadParams(marketplace, readPluginName)
220
+ })).plugin;
221
+ } catch (error) {
222
+ const message = coerceErrorMessage(error);
219
223
  evaluated.push({
220
224
  ...plugin,
221
225
  migratable: false,
222
226
  migrationBlock: {
223
227
  code: "plugin_read_unavailable",
224
- error: detail.error
228
+ error: message
225
229
  },
226
- message: `Codex plugin "${plugin.pluginName ?? plugin.name}" detail could not be read: ${detail.error}`
230
+ message: `Codex plugin "${plugin.pluginName ?? plugin.name}" detail could not be read: ${message}`
227
231
  });
228
232
  continue;
229
233
  }
230
- if (detail.detail.apps.length === 0) {
234
+ if (detail.apps.length === 0) {
231
235
  evaluated.push({
232
236
  ...plugin,
233
237
  migratable: true
234
238
  });
235
239
  continue;
236
240
  }
237
- const apps = detail.detail.apps.map(({ id, name }) => ({
241
+ const apps = detail.apps.map(({ id, name }) => ({
238
242
  id,
239
243
  name
240
244
  })).toSorted((left, right) => left.id.localeCompare(right.id));
@@ -279,7 +283,7 @@ async function withPluginMigrationEligibility(params) {
279
283
  const appInfoById = new Map(snapshot.apps.map((app) => [app.id, app]));
280
284
  const installedAppsById = new Map(snapshot.installedApps.map((app) => [app.id, app]));
281
285
  for (const { plugin, apps: declaredApps } of pending) {
282
- const apps = declaredApps.map((app) => sourcePluginAppFactWithInventory(app, appInfoById.get(app.id), installedAppsById.get(app.id))).toSorted((left, right) => left.id.localeCompare(right.id));
286
+ const apps = declaredApps.map((app) => sourcePluginAppFactWithInventory(app, appInfoById.get(app.id), installedAppsById.get(app.id)));
283
287
  const blockCode = migrationBlockCodeForApps(apps);
284
288
  if (!blockCode) {
285
289
  evaluated.push({
@@ -312,26 +316,6 @@ async function readSourceCodexAccount(options) {
312
316
  default: return "missing";
313
317
  }
314
318
  }
315
- async function readPluginDetail(options, marketplace, plugin, readPluginName) {
316
- if (!readPluginName) return {
317
- ok: false,
318
- error: `Codex remote plugin "${plugin.pluginName ?? plugin.name}" has no readable remote plugin id.`
319
- };
320
- try {
321
- return {
322
- ok: true,
323
- detail: (await options.request({
324
- method: "plugin/read",
325
- requestParams: pluginReadParams(marketplace, readPluginName)
326
- })).plugin
327
- };
328
- } catch (error) {
329
- return {
330
- ok: false,
331
- error: coerceErrorMessage(error)
332
- };
333
- }
334
- }
335
319
  async function refreshSourceAppInventory(options) {
336
320
  const key = buildCodexPluginAppCacheKey({ appServer: { start: options.startOptions } });
337
321
  const request = async (method, requestParams) => await options.request({
@@ -397,7 +381,7 @@ function pluginNameFromSummary(summary) {
397
381
  async function discoverCodexSource(options = {}) {
398
382
  const codexHome = resolveHomePath(options.input?.trim() || defaultCodexHome());
399
383
  const codexSkillsDir = path.join(codexHome, "skills");
400
- const agentsSkillsDir = personalAgentsSkillsDir();
384
+ const agentsSkillsDir = path.join(resolveUserHomeDir(), ".agents", "skills");
401
385
  const configPath = path.join(codexHome, "config.toml");
402
386
  const authPath = path.join(codexHome, "auth.json");
403
387
  const modelsCachePath = path.join(codexHome, "models_cache.json");