@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
package/README.md CHANGED
@@ -22,6 +22,10 @@ openclaw codex archive <thread-id> --confirm-no-other-runner [--json] [--url <ur
22
22
 
23
23
  The catalog never includes archived threads and has no archived or include-archived option. Rows appear in the normal Control UI sessions sidebar and open in the normal Chat pane. Transcript history requires a recent Codex App Server with `thread/turns/list` and is fetched 20 full-item turns at a time through opaque cursors; OpenClaw does not fall back to an unbounded `thread/read`, and rejects a serialized transcript page above 20 MiB before transport. `--limit` defaults to 50 sessions per host, `--cursor` requires `--host`, and the sessions Gateway timeout defaults to 75,000 ms so cold paired-node catalogs can complete. Continue and archive retain the shared 30,000 ms default. All operator surfaces require `operator.write`. Paired-node rows can be listed and read; continue and archive operate only on the Gateway-local host, and archive requires the no-other-runner confirmation. Catalog registration does not require `supervision.enabled`; that setting gates agent-facing supervision tools.
24
24
 
25
+ Local discovery reads native provenance from plain or compressed rollouts. A failed read can fall back to the other representation and does not cache an unknown originator as a permanent unmanaged result.
26
+
27
+ With `appServer.remoteWorkspaceRoot`, OpenClaw maps workspace-relative paths to the remote root. Local filesystem-root workspaces, including `/` and Windows drive roots, follow the same mapping.
28
+
25
29
  A supervised OpenClaw Chat cannot be deleted while its model-selection lock protects the native binding. Before native archive, OpenClaw checks the exact target and every non-archived spawned descendant reported by Codex; any active OpenClaw binding blocks the operation. Descendant pagination errors, cycles, and safety-limit exhaustion also fail closed. Codex still does not expose a conditional archive operation or cross-process runner lease, so the confirmation covers unknown native clients and the race between the status read and archive request.
26
30
 
27
31
  Disabling or uninstalling the plugin leaves supervised Chats locked and unavailable rather than rerouting them. Reinstall or re-enable the same plugin and restart the Gateway to resume those Chats.
@@ -30,10 +34,14 @@ These shell commands differ from the in-chat `/codex` runtime commands. In parti
30
34
 
31
35
  Native Codex plugin catalogs are discoverable with `/codex plugins available`, including repository marketplaces declared in `.agents/plugins/marketplace.json` in the bound workspace. An owner or `operator.admin` can install and authorize an exact plugin with `/codex plugins install <plugin>@<marketplace>`. The owner-scoped `codex_plugins` agent tool only reads marketplace metadata; installation and policy changes stay on authenticated `/codex` management commands. Explicitly installing a plugin trusts its skills, apps, MCP servers, and hooks.
32
36
 
37
+ Cached app inventory diagnostics reflect the current refresh or invalidation. Failures from superseded requests remain logged without replacing that newer status.
38
+
33
39
  For a supervised branch, Codex App Server selects the snapshot fork's model and provider from its current native configuration. OpenClaw starts the canonical harness thread with exactly that returned pair. Codex persists the canonical thread's native selection, and later resumes preserve it because OpenClaw omits model and provider overrides. OpenClaw cannot substitute its outer runtime, model, or fallback. The returned initial pair can differ from the source's last recorded model.
34
40
 
35
41
  The visible-history mirror keeps at most 200 user or assistant messages, 512 KiB total, and 64 KiB per message. Image inputs become `[Image attachment]`; image data and local paths are not copied.
36
42
 
43
+ When assembled context bootstraps a Codex thread, redacted tool payloads retain literal JSON field names. Tool inputs retain their shape; tool results retain redacted content.
44
+
37
45
  Settled-turn finalization uses the same configured Codex App Server transport as the supervised conversation. Remote websocket App Server configurations stay on their configured transport. Managed user-home stdio launches running inside an Agent home, and not through the proxy launcher, use a private stdio side turn for native-tool isolation. The bounded finalizer preserves the selected model, provider, and native authorization returned by Codex, and rejects native tool evidence outside the finalization contract. It may mirror a final answer after completed tool work; it does not diagnose why a model omitted a visible final message.
38
46
 
39
47
  When settled-turn recovery rejects history, the `codex settled-turn finalization context capture failed` warning includes a stable `reason`, such as `item_limit`, `byte_limit`, `field_limit`, `unsupported_user_image`, or `snapshot_invalidated`. Unknown failures use `history_read_failed`. The warning excludes transcript content and exception text. Rejected history remains unavailable for finalization, and completed actions are never replayed.
@@ -1,9 +1,9 @@
1
1
  import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
2
- import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-B7-X2TgG.mjs";
3
- import { n as readCodexAppServerUsage } from "./request-BZOfsSXW.mjs";
4
- import "./config-DKhXquav.mjs";
5
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C0NbLms1.mjs";
6
- import { a as resolveCodexAppServerAuthProfileStore } from "./auth-profile-B0okYl2D.mjs";
2
+ import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-CMPy24F5.mjs";
3
+ import { t as readCodexAppServerUsage } from "./request-jSbhc1sg.mjs";
4
+ import "./config-0Gxk3_eq.mjs";
5
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
6
+ import { a as resolveCodexAppServerAuthProfileStore } from "./auth-profile-CgHQ8Vot.mjs";
7
7
  import { isDeepStrictEqual } from "node:util";
8
8
  import { listAgentIds, resolveAgentDir } from "openclaw/plugin-sdk/agent-scope-runtime";
9
9
  import { z } from "zod";
@@ -0,0 +1,23 @@
1
+ import { n as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-0Gxk3_eq.mjs";
2
+ //#region extensions/codex/src/app-server/app-server-policy.ts
3
+ function resolveCodexAppServerForModelProvider(params) {
4
+ if (params.appServer.approvalsReviewer === "user" || canUseCodexModelBackedApprovalsReviewerForModel({
5
+ modelProvider: params.provider,
6
+ model: params.model,
7
+ config: params.config,
8
+ env: {
9
+ ...params.env ?? process.env,
10
+ ...params.appServer.start.env
11
+ },
12
+ agentDir: params.agentDir,
13
+ codexConfigToml: params.codexConfigToml,
14
+ homeScope: params.appServer.start.homeScope,
15
+ codexArgs: params.appServer.start.args
16
+ })) return params.appServer;
17
+ return {
18
+ ...params.appServer,
19
+ approvalsReviewer: "user"
20
+ };
21
+ }
22
+ //#endregion
23
+ export { resolveCodexAppServerForModelProvider as t };
@@ -1,14 +1,14 @@
1
- import { n as isOpenAiCuratedMarketplace, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-Cky2XJUw.mjs";
2
- import { d as readCodexPluginConfig } from "./config-parsing-b088LyhT.mjs";
3
- import { s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-Dnps4W4_.mjs";
4
- import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BL9B5H0L.mjs";
5
- import { i as requestCodexAppServerJson } from "./request-BZOfsSXW.mjs";
6
- import "./config-DKhXquav.mjs";
7
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C0NbLms1.mjs";
8
- import { i as resolveCodexAppServerAuthProfileIdForAgent } from "./auth-profile-B0okYl2D.mjs";
9
- import { c as getLeasedSharedCodexAppServerClient, et as resolveCodexAppServerAuthAccountCacheKey, h as releaseLeasedSharedCodexAppServerClient, o as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-CJCTeFpQ.mjs";
10
- import { t as ensureCodexPluginActivation } from "./plugin-activation-cNHRfaxU.mjs";
11
- import { CODEX_PLUGIN_CONFIG_PATH, buildCodexMigrationPlan, buildCodexPluginsConfigValue, hasCodexPluginConfigConflict, n as resolveCodexConfigPatchMode, readCodexPluginMigrationConfigEntry, t as createCodexAuthItemApplier } from "./plan-DPdMk1Oy.mjs";
1
+ import { d as readCodexPluginConfig } from "./config-parsing-BQq-CHTF.mjs";
2
+ import { s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-CGm0UJOr.mjs";
3
+ import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BW8rd98k.mjs";
4
+ import { r as requestCodexAppServerJson } from "./request-jSbhc1sg.mjs";
5
+ import { l as CODEX_PLUGINS_MARKETPLACE_NAME, n as isOpenAiCuratedMarketplaceName } from "./plugin-inventory-Bf0_piTw.mjs";
6
+ import "./config-0Gxk3_eq.mjs";
7
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
8
+ import { i as resolveCodexAppServerAuthProfileIdForAgent } from "./auth-profile-CgHQ8Vot.mjs";
9
+ import { c as getLeasedSharedCodexAppServerClient, et as resolveCodexAppServerAuthAccountCacheKey, h as releaseLeasedSharedCodexAppServerClient, o as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-qhyYWbew.mjs";
10
+ import { t as ensureCodexPluginActivation } from "./plugin-activation-BcyBv8PG.mjs";
11
+ import { CODEX_PLUGIN_CONFIG_PATH, buildCodexMigrationPlan, buildCodexPluginsConfigValue, hasCodexPluginConfigConflict, n as resolveCodexConfigPatchMode, readCodexPluginMigrationConfigEntry, t as createCodexAuthItemApplier } from "./plan-BJ37d2Og.mjs";
12
12
  import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
13
13
  import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
14
14
  import path from "node:path";
@@ -16,30 +16,6 @@ import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
16
16
  import { sleep } from "openclaw/plugin-sdk/runtime-env";
17
17
  import { MIGRATION_REASON_TARGET_EXISTS, applyMigrationManualItem, markMigrationItemConflict, markMigrationItemError, markMigrationItemSkipped, resolveMigrationConfigRuntime, summarizeMigrationItems, writeMigrationConfigPath } from "openclaw/plugin-sdk/migration";
18
18
  import { archiveMigrationItem, copyMemoryMigrationFileItem, copyMigrationFileItem, resolvePlannedMigrationTargets, withCachedMigrationConfigRuntime, writeMigrationReport } from "openclaw/plugin-sdk/migration-runtime";
19
- //#region extensions/codex/src/migration/apply-report.ts
20
- function codexPluginActivationReportState(result) {
21
- switch (result.reason) {
22
- case "already_active":
23
- case "installed": return {
24
- installed: true,
25
- enabled: true
26
- };
27
- case "auth_required":
28
- case "refresh_failed": return {
29
- installed: true,
30
- enabled: false
31
- };
32
- case "disabled":
33
- case "install_failed":
34
- case "marketplace_missing":
35
- case "plugin_missing": return {
36
- installed: false,
37
- enabled: false
38
- };
39
- }
40
- return result.reason;
41
- }
42
- //#endregion
43
19
  //#region extensions/codex/src/migration/apply.ts
44
20
  const CODEX_PLUGIN_AUTH_REQUIRED_REASON = "auth_required";
45
21
  const CODEX_PLUGIN_NOT_SELECTED_REASON = "not selected for migration";
@@ -47,6 +23,40 @@ const CODEX_PLUGIN_LOAD_WARNING = "Some Codex plugins could not be migrated. Run
47
23
  const TARGET_CODEX_MARKETPLACE_DISCOVERY_POLL_MS = 250;
48
24
  const TARGET_CODEX_MARKETPLACE_DISCOVERY_TIMEOUT_MS = 3e4;
49
25
  const TARGET_CODEX_MARKETPLACE_DISCOVERY_TIMEOUT_ENV = "OPENCLAW_CODEX_MIGRATION_PLUGIN_LIST_TIMEOUT_MS";
26
+ const PLUGIN_ACTIVATION_REPORT_STATE = {
27
+ already_active: {
28
+ installed: true,
29
+ enabled: true
30
+ },
31
+ installed: {
32
+ installed: true,
33
+ enabled: true
34
+ },
35
+ auth_required: {
36
+ installed: true,
37
+ enabled: false
38
+ },
39
+ refresh_failed: {
40
+ installed: true,
41
+ enabled: false
42
+ },
43
+ disabled: {
44
+ installed: false,
45
+ enabled: false
46
+ },
47
+ install_failed: {
48
+ installed: false,
49
+ enabled: false
50
+ },
51
+ marketplace_missing: {
52
+ installed: false,
53
+ enabled: false
54
+ },
55
+ plugin_missing: {
56
+ installed: false,
57
+ enabled: false
58
+ }
59
+ };
50
60
  var CodexPluginConfigConflictError = class extends Error {
51
61
  constructor(reason) {
52
62
  super(reason);
@@ -83,7 +93,6 @@ async function applyCodexMigrationPlan(params) {
83
93
  const codexHome = typeof plan.metadata?.codexHome === "string" && plan.metadata.codexHome.trim() ? plan.metadata.codexHome : plan.source;
84
94
  const authSource = {
85
95
  codexHome,
86
- authPath: path.join(codexHome, "auth.json"),
87
96
  modelsCachePath: path.join(codexHome, "models_cache.json")
88
97
  };
89
98
  const runtime = withCachedMigrationConfigRuntime(params.ctx.runtime ?? params.runtime, params.ctx.config);
@@ -158,7 +167,7 @@ async function applyCodexPluginInstallItem(ctx, item) {
158
167
  ...item.details,
159
168
  code: result.reason,
160
169
  activationReason: result.reason,
161
- ...codexPluginActivationReportState(result),
170
+ ...PLUGIN_ACTIVATION_REPORT_STATE[result.reason],
162
171
  installAttempted: result.installAttempted,
163
172
  diagnostics: result.diagnostics.map((diagnostic) => diagnostic.message)
164
173
  };
@@ -236,7 +245,7 @@ async function requestTargetCodexAppServerJson(params) {
236
245
  ...params,
237
246
  timeoutMs: remainingMs
238
247
  });
239
- if (lastResponse.marketplaces.some(isOpenAiCuratedMarketplace)) return lastResponse;
248
+ if (lastResponse.marketplaces.some((marketplace) => isOpenAiCuratedMarketplaceName(marketplace.name))) return lastResponse;
240
249
  if (Date.now() >= discoveryDeadline) return lastResponse;
241
250
  const waitMs = Math.min(TARGET_CODEX_MARKETPLACE_DISCOVERY_POLL_MS, discoveryDeadline - Date.now());
242
251
  await sleep(waitMs);
@@ -271,7 +280,7 @@ async function buildTargetCodexPluginAppCacheKey(ctx) {
271
280
  });
272
281
  }
273
282
  async function applyCodexPluginConfigItem(ctx, item, appliedItems) {
274
- if (appliedItems.some((candidate) => candidate.kind === "plugin" && candidate.action === "install" && readCodexPluginPolicy(candidate) !== void 0 && !isCodexPluginConfigTerminal(candidate))) return {
283
+ if (appliedItems.some((candidate) => candidate.kind === "plugin" && candidate.action === "install" && readCodexPluginMigrationConfigEntry(candidate, true) !== void 0 && !isCodexPluginConfigTerminal(candidate))) return {
275
284
  ...item,
276
285
  status: "warning",
277
286
  reason: "selected Codex plugin activation is incomplete"
@@ -0,0 +1,155 @@
1
+ import { w as retireSharedCodexAppServerClientIfCurrent } from "./auth-cache-key-CGm0UJOr.mjs";
2
+ import { a as codexPrewriteRejectionCause, o as isCodexAppServerOverloadError, r as CodexAppServerRpcError } from "./rpc-error-hmWM21RB.mjs";
3
+ import { J as unsubscribeCodexAppServerLiveThread, ft as isCodexAppServerStartupError, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-qhyYWbew.mjs";
4
+ import { V as isCodexAppServerBrokenPipeError, c as isCodexAppServerRequestTimeoutError } from "./client-C8lgBOoO.mjs";
5
+ import { n as getCodexAppServerTurnRouter } from "./turn-router-sS69wYnI.mjs";
6
+ import { t as __exportAll } from "./session-binding-sidecars-BrdV95Fg.mjs";
7
+ import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
8
+ import { AgentHarnessPreflightError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
9
+ //#region extensions/codex/src/app-server/attempt-client-cleanup.ts
10
+ var attempt_client_cleanup_exports = /* @__PURE__ */ __exportAll({
11
+ CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS: () => CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS,
12
+ CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS: () => CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS,
13
+ CodexAppServerUnsafeSubscriptionError: () => CodexAppServerUnsafeSubscriptionError,
14
+ assertCodexThreadResumeSubscription: () => assertCodexThreadResumeSubscription,
15
+ closeCodexStartupClientBestEffort: () => closeCodexStartupClientBestEffort,
16
+ interruptCodexTurnAndWaitBestEffort: () => interruptCodexTurnAndWaitBestEffort,
17
+ isCodexNoActiveTurnInterruptError: () => isCodexNoActiveTurnInterruptError,
18
+ retireUnsafeCodexTurnClientBestEffort: () => retireUnsafeCodexTurnClientBestEffort,
19
+ shouldRetireCodexStartupClient: () => shouldRetireCodexStartupClient,
20
+ terminateCodexBackgroundTerminals: () => terminateCodexBackgroundTerminals,
21
+ unsubscribeCodexThreadBestEffort: () => unsubscribeCodexThreadBestEffort
22
+ });
23
+ const CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS = 5e3;
24
+ const CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS = 5e3;
25
+ const CODEX_NO_ACTIVE_TURN_ERROR_CODE = -32600;
26
+ const CODEX_NO_ACTIVE_TURN_ERROR_MESSAGE = "no active turn to interrupt";
27
+ /** Codex also reports this before an accepted turn publishes its start event. */
28
+ function isCodexNoActiveTurnInterruptError(error) {
29
+ return error instanceof CodexAppServerRpcError && error.code === CODEX_NO_ACTIVE_TURN_ERROR_CODE && error.message === CODEX_NO_ACTIVE_TURN_ERROR_MESSAGE;
30
+ }
31
+ /** Raised when a thread subscription may be live on a client OpenClaw no longer controls. */
32
+ var CodexAppServerUnsafeSubscriptionError = class extends Error {
33
+ constructor(message, options) {
34
+ super(message, options);
35
+ this.name = "CodexAppServerUnsafeSubscriptionError";
36
+ }
37
+ };
38
+ function assertCodexThreadResumeSubscription(requestedThreadId, returnedThreadId) {
39
+ if (returnedThreadId !== requestedThreadId) throw new CodexAppServerUnsafeSubscriptionError(`Codex thread/resume returned ${returnedThreadId} for ${requestedThreadId}`);
40
+ }
41
+ async function closeCodexStartupClientBestEffort(client) {
42
+ if (!client) return;
43
+ const retiredSharedClient = retireSharedCodexAppServerClientIfCurrent(client);
44
+ if (!retiredSharedClient || retiredSharedClient.closed) await client.closeAndWait();
45
+ }
46
+ /** Retires an unsafe turn client without replacing an already-authoritative failure. */
47
+ async function retireUnsafeCodexTurnClientBestEffort(client, operation) {
48
+ try {
49
+ await closeCodexStartupClientBestEffort(client);
50
+ } catch (error) {
51
+ embeddedAgentLog.debug("codex app-server unsafe turn client retirement failed", {
52
+ operation,
53
+ error
54
+ });
55
+ try {
56
+ client.close();
57
+ } catch (closeError) {
58
+ embeddedAgentLog.debug("codex app-server unsafe turn client close failed", {
59
+ operation,
60
+ error: closeError
61
+ });
62
+ }
63
+ }
64
+ }
65
+ /** Sends a bounded turn interrupt and waits for Codex to confirm terminal abort handling. */
66
+ async function interruptCodexTurnAndWaitBestEffort(client, params) {
67
+ const timeoutMs = params.timeoutMs && Number.isFinite(params.timeoutMs) && params.timeoutMs > 0 ? params.timeoutMs : CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS;
68
+ const requestParams = {
69
+ threadId: params.threadId,
70
+ turnId: params.turnId
71
+ };
72
+ let cancelWatch;
73
+ try {
74
+ if (!params.turnId) {
75
+ await client.request("turn/interrupt", requestParams, { timeoutMs });
76
+ return true;
77
+ }
78
+ const deadline = performance.now() + timeoutMs;
79
+ const started = createDeferred();
80
+ const completion = getCodexAppServerTurnRouter(client).watchNativeTurnCompletion({
81
+ threadId: params.threadId,
82
+ turnId: params.turnId,
83
+ timeoutMs,
84
+ onStarted: () => started.resolve(true)
85
+ });
86
+ cancelWatch = completion.cancel;
87
+ if (completion.state !== "pending") return await completion.completion;
88
+ const requestInterrupt = async () => {
89
+ try {
90
+ await client.request("turn/interrupt", requestParams, {
91
+ timeoutMs: Math.max(1, deadline - performance.now()),
92
+ signal: completion.settledSignal
93
+ });
94
+ return true;
95
+ } catch (error) {
96
+ if (completion.state === "confirmed") return true;
97
+ if (isCodexNoActiveTurnInterruptError(error)) return false;
98
+ throw error;
99
+ }
100
+ };
101
+ if (!await requestInterrupt()) {
102
+ if (await Promise.race([completion.completion.then(() => false), started.promise]) && completion.state === "pending" && performance.now() < deadline) await requestInterrupt();
103
+ }
104
+ return await completion.completion;
105
+ } catch (error) {
106
+ embeddedAgentLog.debug("codex app-server turn interrupt failed during abort", { error });
107
+ return false;
108
+ } finally {
109
+ cancelWatch?.();
110
+ }
111
+ }
112
+ /** Stops native terminals on the cancelled thread without retiring peer threads. */
113
+ async function terminateCodexBackgroundTerminals(client, threadId, oneShotCliRun = false, waitForNativeItems) {
114
+ const options = {
115
+ timeoutMs: CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS,
116
+ signal: AbortSignal.timeout(CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS)
117
+ };
118
+ try {
119
+ const { data } = await client.request("thread/backgroundTerminals/list", { threadId }, options);
120
+ for (const { processId } of data) await client.request("thread/backgroundTerminals/terminate", {
121
+ threadId,
122
+ processId
123
+ }, options);
124
+ if (data.length > 0) {
125
+ if ((await client.request("thread/backgroundTerminals/list", {
126
+ threadId,
127
+ limit: 1
128
+ }, options)).data.length > 0) throw new Error("native background terminals remain running");
129
+ if (oneShotCliRun) throw new Error("native terminal termination did not confirm process cleanup");
130
+ }
131
+ await waitForNativeItems?.(options.signal);
132
+ } catch (cause) {
133
+ throw new Error("Codex background-terminal cleanup failed; inspect the thread's running terminals before starting more work.", { cause });
134
+ }
135
+ }
136
+ async function unsubscribeCodexThreadBestEffort(client, params) {
137
+ try {
138
+ await unsubscribeCodexAppServerLiveThread(client, params.threadId, params.timeoutMs, params.assertCurrent, params.withCurrent);
139
+ return true;
140
+ } catch (error) {
141
+ params.assertCurrent?.();
142
+ embeddedAgentLog.debug("codex app-server thread unsubscribe cleanup failed", {
143
+ threadId: params.threadId,
144
+ error
145
+ });
146
+ return false;
147
+ }
148
+ }
149
+ function shouldRetireCodexStartupClient(error, spawnedBy, signal) {
150
+ const cause = codexPrewriteRejectionCause(error);
151
+ if (signal.aborted || isCodexAppServerStartupError(cause) || isCodexAppServerRequestTimeoutError(cause)) return true;
152
+ return !isCodexAppServerStartSelectionChangedError(cause) && !isCodexAppServerOverloadError(cause) && !(cause instanceof AgentHarnessPreflightError && cause.scope === void 0) && (isCodexAppServerBrokenPipeError(cause) || !spawnedBy);
153
+ }
154
+ //#endregion
155
+ export { attempt_client_cleanup_exports as a, isCodexNoActiveTurnInterruptError as c, terminateCodexBackgroundTerminals as d, unsubscribeCodexThreadBestEffort as f, assertCodexThreadResumeSubscription as i, retireUnsafeCodexTurnClientBestEffort as l, CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS as n, closeCodexStartupClientBestEffort as o, CodexAppServerUnsafeSubscriptionError as r, interruptCodexTurnAndWaitBestEffort as s, CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS as t, shouldRetireCodexStartupClient as u };
@@ -1,5 +1,6 @@
1
1
  import { r as flattenCodexDynamicToolFunctions } from "./protocol-CANUwXJ3.mjs";
2
- import { lt as isMessageOnlyCodexSourceReply } from "./thread-requests-OWGOiDaV.mjs";
2
+ import { ut as isMessageOnlyCodexSourceReply } from "./thread-requests-CL1e8Wmx.mjs";
3
+ import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
3
4
  import path from "node:path";
4
5
  import { buildAgentWorkspaceInstructionSnapshot, buildBootstrapContextForFiles, embeddedAgentLog, prepareAgentWorkspaceContext } from "openclaw/plugin-sdk/agent-harness-runtime";
5
6
  import { resolveAgentWorkspaceMemoryRouting, shouldIncludeAgentHarnessRuntimeContext } from "openclaw/plugin-sdk/agent-harness-attempt-runtime";
@@ -17,7 +18,7 @@ const CODEX_BOOTSTRAP_CONTEXT_ORDER = /* @__PURE__ */ new Map([
17
18
  ]);
18
19
  /** A child baseline reads the bounded workspace snapshot without invoking admission hooks. */
19
20
  async function prepareCodexWorkspaceDeveloperInstructions(params) {
20
- if (isSameCodexWorkspacePath(params.workspaceDir, params.cwd)) return;
21
+ if (path.resolve(params.workspaceDir) === path.resolve(params.cwd)) return;
21
22
  const files = await resolveBootstrapFilesForPreparation(params);
22
23
  const contextFiles = buildBootstrapContextForFiles(files, {
23
24
  config: params.config,
@@ -26,7 +27,7 @@ async function prepareCodexWorkspaceDeveloperInstructions(params) {
26
27
  return buildAgentWorkspaceInstructionSnapshot(contextFiles, params.workspaceDir).instructions;
27
28
  }
28
29
  async function buildCodexWorkspaceBootstrapContext(params) {
29
- const availableToolNames = new Set(flattenCodexDynamicToolFunctions(params.tools).map((tool) => normalizeCodexDynamicToolName(tool.name)));
30
+ const availableToolNames = new Set(flattenCodexDynamicToolFunctions(params.tools).map((tool) => normalizeLowercaseStringOrEmpty(tool.name)));
30
31
  const inheritsAgentWorkspace = (params.executionWorkspace ?? params.resolvedWorkspace) !== params.resolvedWorkspace;
31
32
  const injectOpenClawContext = shouldIncludeAgentHarnessRuntimeContext(params.params);
32
33
  const restrictedProjectDocNeedsOpenClawCarrier = params.params.pluginHarnessToolPolicyRestricted === true && !params.params.disableTools && !isMessageOnlyCodexSourceReply(params.params) && params.params.bootstrapContextMode !== "lightweight";
@@ -74,15 +75,16 @@ async function buildCodexWorkspaceBootstrapContext(params) {
74
75
  inheritsAgentWorkspace,
75
76
  promptContextFiles,
76
77
  threadDeveloperInstructionFiles: includeAgentWorkspaceInstructions ? prepared.instructionSnapshot.files : [],
77
- turnScopedDeveloperInstructionFiles: injectOpenClawContext ? prepared.personaFiles : [],
78
+ personaFiles: injectOpenClawContext ? prepared.personaFiles : [],
78
79
  memoryReferenceFiles,
79
80
  memoryToolRoutedBootstrapFiles,
80
81
  memoryToolNames,
81
82
  memoryToolRouted,
82
83
  promptContext: renderCodexWorkspaceBootstrapPromptContext(promptContextFiles),
83
84
  threadDeveloperInstructions: includeAgentWorkspaceInstructions ? params.agentWorkspaceDeveloperInstructions ?? prepared.instructionSnapshot.instructions : void 0,
84
- turnScopedDeveloperInstructions: injectOpenClawContext ? prepared.personaInstructions : void 0,
85
- memoryCollaborationInstructions: injectOpenClawContext ? renderCodexWorkspaceMemoryCollaborationInstructions({
85
+ personaInstructions: injectOpenClawContext ? prepared.personaInstructions : void 0,
86
+ sharedPersonaInstructions: injectOpenClawContext ? prepared.sharedPersonaInstructions : void 0,
87
+ memoryInstructions: injectOpenClawContext ? renderCodexWorkspaceMemoryInstructions({
86
88
  files: memoryReferenceFiles,
87
89
  toolNames: memoryToolNames,
88
90
  memoryRecallInstructions: prepared.memoryRecallInstructions
@@ -122,18 +124,15 @@ function renderCodexWorkspaceMemoryReference(params) {
122
124
  for (const file of params.files) lines.push(`- ${file.path}`);
123
125
  return lines.join("\n").trim();
124
126
  }
125
- function renderCodexWorkspaceMemoryCollaborationInstructions(params) {
127
+ function renderCodexWorkspaceMemoryInstructions(params) {
126
128
  const sections = [params.memoryRecallInstructions ? [params.memoryRecallInstructions, renderCodexMemoryToolSearchBridge(params.toolNames)].filter(isNonEmptyString).join("\n").trim() : void 0, renderCodexWorkspaceMemoryReference(params)].filter(isNonEmptyString);
127
129
  return sections.length > 0 ? sections.join("\n\n") : void 0;
128
130
  }
129
131
  function renderCodexMemoryToolSearchBridge(toolNames) {
130
- const memoryToolNames = toolNames.map((name) => normalizeCodexDynamicToolName(name)).filter((name) => CODEX_MEMORY_TOOL_NAMES.has(name)).toSorted();
132
+ const memoryToolNames = toolNames.map(normalizeLowercaseStringOrEmpty).filter((name) => CODEX_MEMORY_TOOL_NAMES.has(name)).toSorted();
131
133
  if (memoryToolNames.length === 0) return;
132
134
  return `Codex may expose ${memoryToolNames.join(" and ")} as deferred tools. When the memory guidance above calls for memory recall, use an already-loaded memory tool directly. If the needed memory tool is deferred and not currently callable, use \`tool_search\` to load it, then call that memory tool.`;
133
135
  }
134
- function isSameCodexWorkspacePath(left, right) {
135
- return path.resolve(left) === path.resolve(right);
136
- }
137
136
  /**
138
137
  * Remaps bootstrap file paths from the resolved workspace to the effective Codex
139
138
  * workspace while preserving platform path separators.
@@ -154,11 +153,8 @@ function getCodexContextFileDisplayBasename(filePath) {
154
153
  function getCodexContextFileBasename(filePath) {
155
154
  return normalizeCodexContextFilePath(filePath).split("/").pop() ?? "";
156
155
  }
157
- function normalizeCodexDynamicToolName(name) {
158
- return name.trim().toLowerCase();
159
- }
160
156
  function isNonEmptyString(value) {
161
157
  return typeof value === "string" && value.length > 0;
162
158
  }
163
159
  //#endregion
164
- export { getCodexContextFileDisplayBasename as a, normalizeCodexDynamicToolName as c, getCodexContextFileBasename as i, prepareCodexWorkspaceDeveloperInstructions as l, CODEX_NATIVE_PROJECT_DOC_BASENAMES as n, isNonEmptyString as o, buildCodexWorkspaceBootstrapContext as r, normalizeCodexContextFilePath as s, CODEX_MEMORY_CONTEXT_BASENAME as t };
160
+ export { getCodexContextFileDisplayBasename as a, prepareCodexWorkspaceDeveloperInstructions as c, getCodexContextFileBasename as i, CODEX_NATIVE_PROJECT_DOC_BASENAMES as n, isNonEmptyString as o, buildCodexWorkspaceBootstrapContext as r, normalizeCodexContextFilePath as s, CODEX_MEMORY_CONTEXT_BASENAME as t };
@@ -1,30 +1,13 @@
1
1
  import { i as isCodexResponsesOAuthCredential, o as resolveCodexResponsesOAuthProfileFingerprint } from "./responses-oauth-twnuTaAa.mjs";
2
- import { t as __exportAll } from "./session-binding-sidecars-jo6H8dFr.mjs";
3
- import { resolveApiKeyForProfile } from "openclaw/plugin-sdk/agent-runtime";
2
+ import { t as __exportAll } from "./session-binding-sidecars-BrdV95Fg.mjs";
4
3
  import { fingerprintResolvedAuthProfileCredential } from "openclaw/plugin-sdk/agent-harness-runtime";
4
+ import { resolveApiKeyForProfile } from "openclaw/plugin-sdk/agent-runtime";
5
5
  import { resolveOpenAICodexAuthIdentity } from "openclaw/plugin-sdk/provider-auth";
6
6
  //#region extensions/codex/src/app-server/auth-binding.ts
7
7
  var auth_binding_exports = /* @__PURE__ */ __exportAll({
8
8
  fingerprintCodexAppServerAuthBinding: () => fingerprintCodexAppServerAuthBinding,
9
9
  prepareCodexAppServerAuthBinding: () => prepareCodexAppServerAuthBinding
10
10
  });
11
- function withMaterializedCredential(params) {
12
- const store = structuredClone(params.store);
13
- if (params.credential.type === "api_key") {
14
- const { keyRef: _keyRef, ...credential } = params.credential;
15
- store.profiles[params.profileId] = {
16
- ...credential,
17
- key: params.value
18
- };
19
- } else if (params.credential.type === "token") {
20
- const { tokenRef: _tokenRef, ...credential } = params.credential;
21
- store.profiles[params.profileId] = {
22
- ...credential,
23
- token: params.value
24
- };
25
- }
26
- return store;
27
- }
28
11
  /** Resolves one forwarded profile once so attestation and execution share exact material. */
29
12
  async function prepareCodexAppServerAuthBinding(params) {
30
13
  const credential = params.authProfileStore.profiles[params.authProfileId];
@@ -73,14 +56,23 @@ async function prepareCodexAppServerAuthBinding(params) {
73
56
  }
74
57
  });
75
58
  if (!fingerprint) throw new Error(`Codex could not attest auth profile "${params.authProfileId}". Re-select the OpenAI profile and retry.`);
59
+ const store = structuredClone(params.authProfileStore);
60
+ if (credential.type === "api_key") {
61
+ const { keyRef: _keyRef, ...materialized } = credential;
62
+ store.profiles[params.authProfileId] = {
63
+ ...materialized,
64
+ key: resolved.apiKey
65
+ };
66
+ } else {
67
+ const { tokenRef: _tokenRef, ...materialized } = credential;
68
+ store.profiles[params.authProfileId] = {
69
+ ...materialized,
70
+ token: resolved.apiKey
71
+ };
72
+ }
76
73
  return {
77
74
  fingerprint,
78
- authProfileStore: withMaterializedCredential({
79
- store: params.authProfileStore,
80
- profileId: params.authProfileId,
81
- credential,
82
- value: resolved.apiKey
83
- })
75
+ authProfileStore: store
84
76
  };
85
77
  }
86
78
  async function fingerprintCodexAppServerAuthBinding(params) {