@openclaw/codex 2026.9.4 → 2026.9.5

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 (148) hide show
  1. package/assets/activity.svg +30 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/.setup/account-usage-runtime-C2MOIvfq.mjs +75 -0
  4. package/dist/{apply-CvT8tW5i.js → .setup/apply-CJ0ZfmBG.mjs} +11 -11
  5. package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
  6. package/dist/{attempt-client-cleanup-DKHzbwt5.js → .setup/attempt-client-cleanup-BpYKdTA0.mjs} +29 -14
  7. package/dist/{attempt-context-D44yeDII.js → .setup/attempt-context-VXVwTCfS.mjs} +5 -5
  8. package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
  9. package/dist/{auth-binding-CWlKVccJ.js → .setup/auth-binding-DhLWa_7K.mjs} +1 -1
  10. package/dist/{auth-cache-key-7orQae_j.js → .setup/auth-cache-key-QirmgiCo.mjs} +3 -3
  11. package/dist/{auth-profile-CwzO4_RG.js → .setup/auth-profile-WqZtZfXN.mjs} +1 -1
  12. package/dist/.setup/binding-connection-Bm38niE8.mjs +50 -0
  13. package/dist/.setup/binding-connection.runtime-CnRMC0ta.mjs +48 -0
  14. package/dist/{bounded-turn-C_Hneydj.js → .setup/bounded-turn-BtlZcivC.mjs} +16 -11
  15. package/dist/{build-state-BCmg9-5p.js → .setup/build-state-Xx9ybZqa.mjs} +1 -1
  16. package/dist/{capabilities-8vx68WLH.js → .setup/capabilities-_vXcZGSx.mjs} +1 -1
  17. package/dist/{client-B57KWPQx.js → .setup/client-vXs2929Q.mjs} +332 -163
  18. package/dist/{command-dispatch-BpduNGVf.js → .setup/command-dispatch-naHIZwwF.mjs} +3 -3
  19. package/dist/{command-formatters-lxlkNZgU.js → .setup/command-formatters-CGEkdawF.mjs} +2 -2
  20. package/dist/{command-handlers-tiL9iWj7.js → .setup/command-handlers-BtAJEW1X.mjs} +59 -42
  21. package/dist/{command-rpc-CR5EOEZX.js → .setup/command-rpc-DHFpn4le.mjs} +22 -13
  22. package/dist/{compact-B_H3AOd7.js → .setup/compact-C3i3qlzj.mjs} +28 -43
  23. package/dist/{config-oIORaQ5T.js → .setup/config-CedDWjM-.mjs} +5 -4
  24. package/dist/{config-options-CXMq1T-C.js → .setup/config-options-BsanJ8QG.mjs} +6 -418
  25. package/dist/{protocol-5bh1G-H7.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
  26. package/dist/{config-runtime-D0zGNIHu.js → .setup/config-runtime-CeAhl_h4.mjs} +2 -2
  27. package/dist/.setup/config-security-BRQ2mgW9.mjs +465 -0
  28. package/dist/{conversation-binding-DsB4-O7U.js → .setup/conversation-binding-DhzrpTM6.mjs} +23 -21
  29. package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
  30. package/dist/{conversation-control-CtUu1b3m.js → .setup/conversation-control-DN53ns41.mjs} +17 -13
  31. package/dist/.setup/cyber-failover-DYwbmf1o.mjs +123 -0
  32. package/dist/.setup/cyber-failover-notice-e9G3J9-e.mjs +17 -0
  33. package/dist/{dynamic-tools-CmN5RAip.js → .setup/dynamic-tools-D16lOp67.mjs} +101 -55
  34. package/dist/{effective-mcp-catalog-Bd73bqA8.js → .setup/effective-mcp-catalog-K6kLCN8X.mjs} +3 -3
  35. package/dist/{ephemeral-turn-D78_VmzO.js → .setup/ephemeral-turn-R1gA8Sn6.mjs} +4 -5
  36. package/dist/{event-projector-assistant-message-BmBM4qBV.js → .setup/event-projector-assistant-message-DNUR1s0A.mjs} +6 -3
  37. package/dist/{event-projector-items-5VhsECCO.js → .setup/event-projector-items-DyTQ_XqL.mjs} +1 -1
  38. package/dist/{attempt-notifications-C9XufG6l.js → .setup/event-projector-usage-C7Ntzs-f.mjs} +102 -9
  39. package/dist/{harness-C7rRa7bm.js → .setup/harness-rxaaoN-o.mjs} +74 -20
  40. package/dist/{inference-context-Dr_mzvk4.js → .setup/inference-context-fulhZuz8.mjs} +1 -1
  41. package/dist/{inference-proxy-HGXKUIre.js → .setup/inference-proxy-CC15HuSi.mjs} +4 -4
  42. package/dist/{isolated-completion-DWVb5U2J.js → .setup/isolated-completion-B6srt48J.mjs} +7 -7
  43. package/dist/{launch-args-RXQwn8zV.js → .setup/launch-args-DnMak49W.mjs} +22 -1
  44. package/dist/{managed-binary-D22rNEcR.js → .setup/managed-binary-DP6Rib3P.mjs} +2 -2
  45. package/dist/{managed-thread-store-D1t5jh3G.js → .setup/managed-thread-store-BMqgThVL.mjs} +48 -14
  46. package/dist/{model-catalog-Dq2n8f_p.js → .setup/model-catalog-DkvUuBey.mjs} +35 -10
  47. package/dist/{models-PCKOim-h.js → .setup/models-BDFgm_G-.mjs} +3 -3
  48. package/dist/.setup/native-auth-BLZGqFjw.mjs +57 -0
  49. package/dist/{native-subagent-history-DjtPloaU.js → .setup/native-subagent-history-YXaL6dMd.mjs} +24 -29
  50. package/dist/.setup/native-subagent-monitor-B1hxzIOy.mjs +5031 -0
  51. package/dist/{native-subagent-task-ids-BzTdT0Uw.js → .setup/native-subagent-task-ids-DsuOonKv.mjs} +32 -8
  52. package/dist/{node-cli-sessions-DKaOmVUh.js → .setup/node-cli-sessions-Cl8b2ZF3.mjs} +1 -1
  53. package/dist/{node-exec-server.runtime-Cl2vapEi.js → .setup/node-exec-server.runtime-BaViBKNz.mjs} +3 -3
  54. package/dist/{plan-7uG-Fp36.js → .setup/plan-xD7WKYTM.mjs} +64 -48
  55. package/dist/{plugin-activation-BYQculil.js → .setup/plugin-activation-r8nq5Jzp.mjs} +3 -3
  56. package/dist/{plugin-app-cache-key-d0eKxy7b.js → .setup/plugin-app-cache-key-BOxKP7db.mjs} +29 -25
  57. package/dist/{plugin-approval-roundtrip-Bz3FT8W5.js → .setup/plugin-approval-roundtrip-CjfzafAZ.mjs} +1 -1
  58. package/dist/{plugin-inventory-oL4Na1ZG.js → .setup/plugin-inventory-DUle8DLz.mjs} +7 -6
  59. package/dist/{plugin-metadata-cache-ClPJpRio.js → .setup/plugin-metadata-cache-DsS5buNa.mjs} +29 -14
  60. package/dist/{provider-capabilities-BvCUL69A.js → .setup/provider-capabilities-B8J4Dy-O.mjs} +2 -2
  61. package/dist/{provider-MQ8PVkuE.js → .setup/provider-fFh_-VR3.mjs} +4 -4
  62. package/dist/{rate-limits-CBMmWBr9.js → .setup/rate-limits-DOEGYRNs.mjs} +90 -46
  63. package/dist/{request-B7hEkBGq.js → .setup/request-BioXJLYa.mjs} +113 -33
  64. package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
  65. package/dist/{run-attempt-CvsAAGa0.js → .setup/run-attempt-rlA07pUv.mjs} +580 -498
  66. package/dist/{runtime-artifact-BJ0rXBZ_.js → .setup/runtime-artifact-Dy38Z5iU.mjs} +2 -2
  67. package/dist/{sandbox-guard-BxgyoM8M.js → .setup/sandbox-guard-BBP-RbTf.mjs} +3 -3
  68. package/dist/{session-binding-CI8UuilT.js → .setup/session-binding-_0W_fHRr.mjs} +46 -64
  69. package/dist/{session-binding-record-Bcvslnhf.js → .setup/session-binding-record-TH3xA0zj.mjs} +181 -3
  70. package/dist/.setup/session-binding-sidecars-CKYEcfNn.mjs +543 -0
  71. package/dist/{session-catalog-adoption-tcZi1IfX.js → .setup/session-catalog-adoption-CR_whkEW.mjs} +6 -6
  72. package/dist/{session-catalog-archive-CwKg8Xz2.js → .setup/session-catalog-archive-CwZaPacf.mjs} +6 -6
  73. package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +250 -0
  74. package/dist/.setup/session-catalog-fUdWDx-U.mjs +2464 -0
  75. package/dist/.setup/session-catalog-index-B141u15s.mjs +1070 -0
  76. package/dist/.setup/session-catalog-index-order-Cc5BzlQr.mjs +48 -0
  77. package/dist/.setup/session-catalog-index-state-BAuDztHN.mjs +180 -0
  78. package/dist/{thread-history-page-D0JIp48V.js → .setup/session-catalog-native-projection-ChV3cCtm.mjs} +206 -95
  79. package/dist/{session-catalog-node-adoption-B1tgDW-m.js → .setup/session-catalog-node-adoption-BVRsYOSh.mjs} +3 -3
  80. package/dist/{session-catalog-node-continue-Ci-DXyJP.js → .setup/session-catalog-node-continue-Dowv8osw.mjs} +7 -7
  81. package/dist/.setup/session-catalog-projection-C1Bj9Jl-.mjs +414 -0
  82. package/dist/{session-cli-DNN_jhGc.js → .setup/session-cli-DIj-IE-E.mjs} +4 -4
  83. package/dist/{session-history-Cz-tOOYj.js → .setup/session-history-C--SrLI8.mjs} +10 -5
  84. package/dist/{session-history-import-DwyijFI6.js → .setup/session-history-import-JHXT5Xfi.mjs} +4 -4
  85. package/dist/{session-history-read-cxPUxyVV.js → .setup/session-history-read-B3ZfSUbF.mjs} +2 -2
  86. package/dist/{session-history.worker-BeK1YOyT.js → .setup/session-history.worker-CpNj7H_P.mjs} +5 -6
  87. package/dist/{session-initialization-Ct0_Hzmg.js → .setup/session-initialization-DH1z6fXn.mjs} +2 -2
  88. package/dist/{session-permission-policy-BBmXA8Eg.js → .setup/session-permission-policy-DhurXY0l.mjs} +2 -2
  89. package/dist/{session-retirement-B2YfbAAT.js → .setup/session-retirement-CU87AOg9.mjs} +6 -6
  90. package/dist/{settled-turn-context-Du6gdUDd.js → .setup/settled-turn-context-fmwouT5I.mjs} +2 -2
  91. package/dist/{settled-turn-finalizer-Dn91stmc.js → .setup/settled-turn-finalizer-CiY2bLFK.mjs} +9 -9
  92. package/dist/{shared-client-CscigXXL.js → .setup/shared-client-BpTtuLQ5.mjs} +286 -145
  93. package/dist/{side-question-BGMJQf4U.js → .setup/side-question-DSCZyoBD.mjs} +64 -47
  94. package/dist/{source-CElXU0Oy.js → .setup/source-Bjp4UQij.mjs} +7 -6
  95. package/dist/{thread-archive-guard-DfpBr-Sz.js → .setup/thread-archive-guard-jmecf6OJ.mjs} +1 -1
  96. package/dist/.setup/thread-history-page-BTx-4xsg.mjs +83 -0
  97. package/dist/{thread-lifecycle-DXl1-I6b.js → .setup/thread-lifecycle-Cik28qWn.mjs} +256 -128
  98. package/dist/{thread-ownership-BsDRTsyp.js → .setup/thread-ownership-skomxnIt.mjs} +4 -4
  99. package/dist/{thread-policy-BuEQfE0g.js → .setup/thread-policy-Cjs4B8xf.mjs} +2 -2
  100. package/dist/{thread-resume-DsDOZpFg.js → .setup/thread-resume-BkNpj9Pz.mjs} +8 -5
  101. package/dist/.setup/timeout-DZF05XrR.mjs +63 -0
  102. package/dist/{transcript-history-projection-v17wXgdK.js → .setup/transcript-history-projection-DHNBDhCU.mjs} +8 -3
  103. package/dist/{transcript-mirror-C5CKgNy6.js → .setup/transcript-mirror-D4qp_leP.mjs} +15 -6
  104. package/dist/{transcript-mirror-attestation-DibE0krH.js → .setup/transcript-mirror-attestation-CzM-94NC.mjs} +4 -1
  105. package/dist/{transport-stdio-BGjHoYLr.js → .setup/transport-stdio-Cmx94Oiy.mjs} +149 -44
  106. package/dist/{upstream-session-fork-BZerMte_.js → .setup/upstream-session-fork-D3UKxgVD.mjs} +27 -26
  107. package/dist/{usage-tCk-mg_x.js → .setup/usage-BOgBEKso.mjs} +4 -4
  108. package/dist/.setup/usage-limit-error-C0ow7DOc.mjs +166 -0
  109. package/dist/{version-omm6IPI3.js → .setup/version-CoqzXPgK.mjs} +1 -1
  110. package/dist/{web-search-provider.runtime-B7bGbGWq.js → .setup/web-search-provider.runtime-CTGuJt6i.mjs} +3 -3
  111. package/dist/api.js +6 -6
  112. package/dist/cli-metadata.js +1 -1
  113. package/dist/doctor-contract-api.js +8 -528
  114. package/dist/harness.js +1 -1
  115. package/dist/index.js +123 -83
  116. package/dist/media-understanding-provider.js +3 -3
  117. package/dist/migration-provider-api.js +1 -1
  118. package/dist/native-tool-policy.js +12 -0
  119. package/dist/provider-discovery.js +18 -0
  120. package/dist/session-history-worker-runtime.js +23 -5
  121. package/dist/session-history.worker.js +2 -2
  122. package/dist/web-search-contract-api.js +1 -1
  123. package/openclaw.plugin.json +354 -69
  124. package/package.json +11 -8
  125. package/dist/binding-connection-D3udKbIE.js +0 -60
  126. package/dist/event-projector-usage-BfXmpOec.js +0 -102
  127. package/dist/native-subagent-history-owner-Pcp7JuVF.js +0 -34
  128. package/dist/native-subagent-monitor-fQ7eIXEf.js +0 -2978
  129. package/dist/rpc-error-ttN_QjEm.js +0 -30
  130. package/dist/session-catalog-ct-AH01I.js +0 -1477
  131. package/dist/session-catalog-home-id-CwhLdC03.js +0 -18
  132. package/dist/session-catalog-provenance-D-dIfRAH.js +0 -96
  133. package/dist/timeout-BVw8aaM1.js +0 -33
  134. package/dist/{auth-profile-selection-DFu9e167.js → .setup/auth-profile-selection-DFu9e167.mjs} +0 -0
  135. package/dist/{config-utils-DujwEnhg.js → .setup/config-utils-DujwEnhg.mjs} +0 -0
  136. package/dist/{context-compaction-activity-CMla5FPJ.js → .setup/context-compaction-activity-CMla5FPJ.mjs} +0 -0
  137. package/dist/{elicitation-input-DPoK8F7w.js → .setup/elicitation-input-DPoK8F7w.mjs} +0 -0
  138. package/dist/{history-rejection-B4nOXNXF.js → .setup/history-rejection-B4nOXNXF.mjs} +0 -0
  139. package/dist/{image-payload-sanitizer-tupAr-2o.js → .setup/image-payload-sanitizer-tupAr-2o.mjs} +0 -0
  140. package/dist/{incognito-session-uhrBF6wJ.js → .setup/incognito-session-uhrBF6wJ.mjs} +0 -0
  141. package/dist/{local-runtime-attribution-B_2mnqhb.js → .setup/local-runtime-attribution-B_2mnqhb.mjs} +0 -0
  142. package/dist/{native-execution-policy-umd0tgh4.js → .setup/native-execution-policy-YBMHSzC4.mjs} +1 -1
  143. /package/dist/{plugin-marketplace-discovery-P-Vndfqq.js → .setup/plugin-marketplace-discovery-P-Vndfqq.mjs} +0 -0
  144. /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
  145. /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
  146. /package/dist/{session-upstream-marker-D15C9NHp.js → .setup/session-upstream-marker-D15C9NHp.mjs} +0 -0
  147. /package/dist/{upstream-prompt-provenance-LphB8slG.js → .setup/upstream-prompt-provenance-LphB8slG.mjs} +0 -0
  148. /package/dist/{web-search-provider.shared-BrZmlqyR.js → .setup/web-search-provider.shared-BrZmlqyR.mjs} +0 -0
@@ -1,50 +1,51 @@
1
- import { a as readCodexPluginInventory, o as resolveOwnedAppApprovalOverrideKeys } from "./plugin-inventory-oL4Na1ZG.js";
2
- import { l as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced } from "./session-binding-record-Bcvslnhf.js";
3
- import { f as assertCodexModelBackedReviewerEffectiveConfig, g as readCodexEffectiveConfig, h as CODEX_SESSION_OVERRIDABLE_LAYER_TYPES, n as codexSandboxPolicyForTurn } from "./config-options-CXMq1T-C.js";
4
- import { S as resolveCodexPluginsPolicy, a as flattenCodexDynamicToolFunctions, c as resolveCodexAppServerLocalHomeDir, o as isJsonObject, s as resolveCodexAppServerHomeDir } from "./protocol-5bh1G-H7.js";
5
- import { L as resolveCodexToolAbortTerminalReason, _ as assertCodexThreadAcceptsDirectInput, b as assertCodexThreadStartResponse, d as isCodexAppServerRequestTimeoutError, l as isCodexAppServerOverloadError, p as resolveCodexAppServerClientInstanceId, r as getCodexAppServerClientInstanceId, v as assertCodexThreadForkResponse } from "./client-B57KWPQx.js";
6
- import { i as markStartedCodexManagedThread } from "./managed-thread-store-D1t5jh3G.js";
7
- import { n as withCodexAppServerThreadMutation, t as isIncognitoSessionKey } from "./incognito-session-uhrBF6wJ.js";
8
- import { n as isCodexThreadReadMissingError, t as CodexAppServerRpcError } from "./rpc-error-ttN_QjEm.js";
9
- import { t as projectBoundedCodexThreadHistory } from "./transcript-history-projection-v17wXgdK.js";
10
- import { c as serializeCodexAppInventoryError, o as CodexAppInventoryCache, s as defaultCodexAppInventoryCache, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-d0eKxy7b.js";
11
- import { t as withAbortableTimeout } from "./timeout-BVw8aaM1.js";
12
- import { n as codexCatalogHomeId } from "./session-catalog-home-id-CwhLdC03.js";
13
- import { n as readCodexSessionMeta } from "./session-catalog-provenance-D-dIfRAH.js";
14
- import "./config-oIORaQ5T.js";
15
- import { r as sanitizeInlineImageDataUrl, t as invalidInlineImageText } from "./image-payload-sanitizer-tupAr-2o.js";
16
- import { t as assertCodexSessionRuntimeOwnership } from "./binding-connection-D3udKbIE.js";
17
- import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-CwzO4_RG.js";
18
- import { C as CodexThreadBindingConflictError, D as bindCodexInferenceThread, E as assertCodexInferenceRouteConfig, H as isCodexAppServerClientRuntimeLive, K as readCodexClientSessionMeta, R as consumeCodexAppServerLiveThread, S as CodexAdoptedThreadActiveError, U as isCodexAppServerLiveThreadClaimed, Y as unsubscribeCodexAppServerLiveThread, _ as retainSharedCodexAppServerClientByInstanceId, k as prepareCodexInferenceThreadConfig, n as captureCodexAppServerClientLifetime, q as releaseCodexAppServerLiveThread, w as CodexThreadStartRequestError } from "./shared-client-CscigXXL.js";
19
- import { a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, n as CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS, r as CodexAppServerUnsafeSubscriptionError, s as isCodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-DKHzbwt5.js";
20
- import { t as ensureCodexPluginActivation } from "./plugin-activation-BYQculil.js";
21
- import { o as resolveCodexSessionBinding, r as hashCodexAppServerBindingFingerprint } from "./session-binding-CI8UuilT.js";
22
- import { i as refreshCodexThreadPolicy, n as CodexThreadPolicyHandoffError, r as assertCodexSupervisionThreadLineage, t as CodexIncognitoPolicyChangeError } from "./thread-policy-BuEQfE0g.js";
23
- import { t as resumeCodexAppServerThread } from "./thread-resume-DsDOZpFg.js";
24
- import { r as retainCodexAppServerBindingSubscription, s as withExclusiveCodexAppServerThread } from "./thread-ownership-BsDRTsyp.js";
25
- import "./transcript-mirror-C5CKgNy6.js";
1
+ import { a as readCodexPluginInventory, o as resolveOwnedAppApprovalOverrideKeys } from "./plugin-inventory-DUle8DLz.mjs";
2
+ import { n as assertCodexBindingMayBeReplaced, p as sessionBindingIdentity } from "./session-binding-record-TH3xA0zj.mjs";
3
+ import { g as resolveCodexAppServerLocalHomeDir, h as resolveCodexAppServerHomeDir, m as isJsonObject, p as flattenCodexDynamicToolFunctions } from "./config-security-BRQ2mgW9.mjs";
4
+ import { f as resolveCodexPluginsPolicy } from "./config-parsing-CcB9iPoq.mjs";
5
+ import { L as resolveCodexToolAbortTerminalReason, _ as assertCodexThreadAcceptsDirectInput, b as assertCodexThreadStartResponse, d as isCodexAppServerRequestTimeoutError, l as isCodexAppServerOverloadError, p as resolveCodexAppServerClientInstanceId, r as getCodexAppServerClientInstanceId, v as assertCodexThreadForkResponse } from "./client-vXs2929Q.mjs";
6
+ import { d as readCodexEffectiveConfig, n as codexSandboxPolicyForTurn, s as assertCodexModelBackedReviewerEffectiveConfig, u as CODEX_SESSION_OVERRIDABLE_LAYER_TYPES } from "./config-options-BsanJ8QG.mjs";
7
+ import { f as getCurrentSharedClientEntry } from "./auth-cache-key-QirmgiCo.mjs";
8
+ import { i as markStartedCodexManagedThread } from "./managed-thread-store-BMqgThVL.mjs";
9
+ import { n as withCodexAppServerThreadMutation, t as isIncognitoSessionKey } from "./incognito-session-uhrBF6wJ.mjs";
10
+ import { a as isCodexThreadReadMissingError, i as CodexAppServerRpcError, t as withAbortableTimeout } from "./timeout-DZF05XrR.mjs";
11
+ import { t as projectBoundedCodexThreadHistory } from "./transcript-history-projection-DHNBDhCU.mjs";
12
+ import { a as defaultCodexAppInventoryCache, i as CodexAppInventoryCache, o as serializeCodexAppInventoryError, s as codexAppIdentityKey, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-BOxKP7db.mjs";
13
+ import { a as codexCatalogHomeId, c as readCodexSessionMeta } from "./session-catalog-events-jMcYfQyd.mjs";
14
+ import { t as assertCodexSessionRuntimeOwnership } from "./binding-connection-Bm38niE8.mjs";
15
+ import "./config-CedDWjM-.mjs";
16
+ import { r as sanitizeInlineImageDataUrl, t as invalidInlineImageText } from "./image-payload-sanitizer-tupAr-2o.mjs";
17
+ import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-WqZtZfXN.mjs";
18
+ import { C as CodexThreadBindingConflictError, E as nativeHookRelayUnregisterQueue, G as unsubscribeCodexAppServerLiveThread, H as readCodexClientSessionMeta, L as hasCodexAppServerSiblingThreadWork, N as consumeCodexAppServerLiveThread, O as assertCodexInferenceRouteConfig, R as isCodexAppServerClientRuntimeLive, S as CodexAdoptedThreadActiveError, T as CodexThreadStartRequestError, U as releaseCodexAppServerLiveThread, _ as retainSharedCodexAppServerClientByInstanceId, j as prepareCodexInferenceThreadConfig, k as bindCodexInferenceThread, n as captureCodexAppServerClientLifetime, w as CodexThreadClientReplacementError, z as isCodexAppServerLiveThreadClaimed } from "./shared-client-BpTtuLQ5.mjs";
19
+ import { a as closeCodexStartupClientBestEffort, f as unsubscribeCodexThreadBestEffort, h as hasCodexAppServerSiblingRouteWork, l as retireUnsafeCodexTurnClientBestEffort, n as CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS, r as CodexAppServerUnsafeSubscriptionError, s as isCodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-BpYKdTA0.mjs";
20
+ import { t as ensureCodexPluginActivation } from "./plugin-activation-r8nq5Jzp.mjs";
21
+ import { o as resolveCodexSessionBinding, r as hashCodexAppServerBindingFingerprint } from "./session-binding-_0W_fHRr.mjs";
22
+ import { i as refreshCodexThreadPolicy, n as CodexThreadPolicyHandoffError, r as assertCodexSupervisionThreadLineage, t as CodexIncognitoPolicyChangeError } from "./thread-policy-Cjs4B8xf.mjs";
23
+ import { t as resumeCodexAppServerThread } from "./thread-resume-BkNpj9Pz.mjs";
24
+ import { r as retainCodexAppServerBindingSubscription, s as withExclusiveCodexAppServerThread } from "./thread-ownership-skomxnIt.mjs";
25
+ import "./transcript-mirror-D4qp_leP.mjs";
26
26
  import { asOptionalRecord, isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
27
27
  import * as crypto$1 from "node:crypto";
28
28
  import crypto, { createHash } from "node:crypto";
29
+ import { isDeepStrictEqual } from "node:util";
29
30
  import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
30
31
  import { addTimerTimeoutGraceMs, finiteSecondsToTimerSafeMilliseconds } from "openclaw/plugin-sdk/number-runtime";
31
32
  import path from "node:path";
32
33
  import os from "node:os";
33
34
  import fs from "node:fs/promises";
34
35
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
36
+ import { toErrorObject } from "openclaw/plugin-sdk/error-runtime";
35
37
  import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
38
+ import { emitTrustedDiagnosticEvent } from "openclaw/plugin-sdk/diagnostic-runtime";
36
39
  import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
37
40
  import { createStageTimingTracker, formatStageTimings } from "openclaw/plugin-sdk/time-runtime";
38
41
  import { isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
39
42
  import { resolveAgentDir as resolveAgentDir$1 } from "openclaw/plugin-sdk/agent-runtime";
40
- import { AgentHarnessPreflightError, SKILL_WORKSHOP_TOOL_NAME, buildCredentialSafetyPrompt, buildDelegationGuidanceSection, buildHarnessVisibleReplyGuidance, buildSkillWorkshopPromptSection, buildTemporalContextText, buildUiPresentationPrompt, embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, isHostScopedAgentToolActive, isOpenClawRuntimeContextCustomMessage, resolveMainSessionDelegationMode } from "openclaw/plugin-sdk/agent-harness-runtime";
41
- import { isDeepStrictEqual } from "node:util";
42
- import { emitTrustedDiagnosticEvent } from "openclaw/plugin-sdk/diagnostic-runtime";
43
+ import { AgentHarnessPreflightError, SKILL_WORKSHOP_TOOL_NAME, buildCredentialSafetyPrompt, buildDelegationGuidanceSection, buildHarnessVisibleReplyGuidance, buildSkillWorkshopPromptSection, buildTemporalContextText, buildUiPresentationPrompt, embeddedAgentLog, formatErrorMessage as formatErrorMessage$1, isActiveHarnessContextEngine, isHostScopedAgentToolActive, isOpenClawRuntimeContextCustomMessage, resolveMainSessionDelegationMode } from "openclaw/plugin-sdk/agent-harness-runtime";
43
44
  import { redactSensitiveFieldValue, redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
44
45
  import { IMAGE_BLOCK_TOKENS } from "openclaw/plugin-sdk/agent-core";
45
46
  import { resolveRequiredHomeDir, resolveStateDir } from "openclaw/plugin-sdk/state-paths";
46
47
  import { buildCodexUserMcpServersThreadConfigPatchForRun } from "openclaw/plugin-sdk/codex-mcp-projection";
47
- import { registerRetainedNativeHookRelayForBundledRuntime } from "openclaw/plugin-sdk/native-hook-relay-runtime";
48
+ import { registerNativeHookRelayForBundledRuntime } from "openclaw/plugin-sdk/native-hook-relay-runtime";
48
49
  import { isDiagnosticFlagEnabled } from "openclaw/plugin-sdk/diagnostic-flags";
49
50
  import { listRegisteredPluginAgentPromptGuidance } from "openclaw/plugin-sdk/plugin-runtime";
50
51
  import { buildHostnameAllowlistPolicyFromSuffixAllowlist } from "openclaw/plugin-sdk/ssrf-policy";
@@ -106,7 +107,7 @@ function collectCodexPluginOwnedAppIds(inventory) {
106
107
  return Array.from(new Set(inventory.records.flatMap((record) => record.ownedAppIds).filter(Boolean))).toSorted();
107
108
  }
108
109
  function collectCodexReservedPluginAppIds(params) {
109
- const reserved = new Set(params.inventory.records.flatMap((record) => record.appOwnership === "proven" ? record.ownedAppIds : []));
110
+ const reserved = new Set(params.inventory.records.flatMap((record) => record.appOwnership === "proven" ? record.ownedAppIds : []).map(codexAppIdentityKey));
110
111
  const recordsByConfigKey = new Map(params.inventory.records.map((record) => [record.policy.configKey, record]));
111
112
  const configuredOwnerNames = new Set(params.policy.pluginPolicies.flatMap((policy) => {
112
113
  const record = recordsByConfigKey.get(policy.configKey);
@@ -117,7 +118,7 @@ function collectCodexReservedPluginAppIds(params) {
117
118
  record?.summary.id
118
119
  ].filter((name) => Boolean(name)).map(normalizeCodexPluginOwnerName);
119
120
  }));
120
- for (const app of params.accountApps) if (app.pluginDisplayNames.some((name) => configuredOwnerNames.has(normalizeCodexPluginOwnerName(name)))) reserved.add(app.id);
121
+ for (const app of params.accountApps) if (app.pluginDisplayNames.some((name) => configuredOwnerNames.has(normalizeCodexPluginOwnerName(name)))) reserved.add(codexAppIdentityKey(app.id));
121
122
  return reserved;
122
123
  }
123
124
  function normalizeCodexPluginOwnerName(name) {
@@ -199,8 +200,8 @@ async function readCodexConfigForAppAdmission(params) {
199
200
  function resolveCodexExplicitAppEnablement(layersHighestPrecedenceFirst, appId) {
200
201
  for (const layer of layersHighestPrecedenceFirst) {
201
202
  const apps = layer.apps;
202
- const app = isJsonObject(apps) ? apps[appId] : void 0;
203
- if (isJsonObject(app) && Object.hasOwn(app, "enabled")) return app.enabled === true;
203
+ const values = isJsonObject(apps) ? Object.entries(apps).filter(([id, app]) => codexAppIdentityKey(id) === codexAppIdentityKey(appId) && isJsonObject(app) && Object.hasOwn(app, "enabled")).map(([, app]) => isJsonObject(app) && app.enabled === true) : [];
204
+ if (values.length > 0) return values.every(Boolean);
204
205
  }
205
206
  }
206
207
  function shouldForceRefreshCodexNotReadyPluginApps(params, policy, inventory) {
@@ -213,7 +214,7 @@ function shouldForceRefreshCodexNotReadyPluginApps(params, policy, inventory) {
213
214
  * Builds Codex thread config patches that expose only policy-approved apps
214
215
  * for native Codex turns.
215
216
  */
216
- const CODEX_PLUGIN_THREAD_CONFIG_INPUT_FINGERPRINT_VERSION = 6;
217
+ const CODEX_PLUGIN_THREAD_CONFIG_INPUT_FINGERPRINT_VERSION = 7;
217
218
  const CODEX_PLUGIN_THREAD_CONFIG_FINGERPRINT_VERSION = 2;
218
219
  /** Returns true when plugin config exists and thread config may need app patches. */
219
220
  function shouldBuildCodexPluginThreadConfig(pluginConfig) {
@@ -419,7 +420,7 @@ async function buildCodexPluginThreadConfig(params) {
419
420
  }
420
421
  }
421
422
  for (const app of unresolvedDisabledPluginOwnership ? [] : accountAppsResult.apps) {
422
- if (pluginOwnedAppIds.has(app.id)) continue;
423
+ if (pluginOwnedAppIds.has(codexAppIdentityKey(app.id))) continue;
423
424
  const admissionConfig = await getAdmissionConfig();
424
425
  if (resolveCodexExplicitAppEnablement(admissionConfig.layers, app.id) === false) continue;
425
426
  const accountApp = toCodexPluginOwnedAccountApp(app);
@@ -638,8 +639,34 @@ const CODEX_TURN_START_TEXT_INPUT_MAX_CHARS = 1 << 20;
638
639
  const DEFAULT_CODEX_PROJECTION_RESERVE_TOKENS = 2e4;
639
640
  const MIN_PROMPT_BUDGET_RATIO = .5;
640
641
  const MIN_PROMPT_BUDGET_TOKENS = 8e3;
642
+ const CODEX_CONTEXT_SENDER_FIELD_MAX_CHARS = 256;
643
+ /**
644
+ * This projection has no access to agent-core's private compaction helper, but
645
+ * must keep the same attribution contract: a stable ID is identity; display
646
+ * labels are optional metadata, never provenance on their own.
647
+ */
648
+ function formatCodexContextSenderSuffix(message) {
649
+ if (message.role !== "user") return "";
650
+ const metadata = Reflect.get(message, "__openclaw");
651
+ if (!metadata || typeof metadata !== "object") return "";
652
+ const normalize = (value) => {
653
+ if (typeof value !== "string") return;
654
+ const normalized = value.replaceAll("\0", "").trim();
655
+ return normalized ? truncateUtf16Safe(normalized, CODEX_CONTEXT_SENDER_FIELD_MAX_CHARS) : void 0;
656
+ };
657
+ const record = metadata;
658
+ const id = normalize(record.senderId);
659
+ if (!id) return "";
660
+ const name = normalize(record.senderName);
661
+ const username = normalize(record.senderUsername);
662
+ return ` sender=${JSON.stringify({
663
+ id,
664
+ ...name ? { name } : {},
665
+ ...username ? { username } : {}
666
+ })}`;
667
+ }
641
668
  function neutralizeCodexExplicitMentionSigils(text) {
642
- return text.replace(/\$(?=[A-Za-z0-9_:-])/gu, "$").replace(/\[@(?=[A-Za-z0-9_:-]+\]\()/gu, "[@");
669
+ return text.replace(/\$(?=[A-Za-z0-9_:-])/gu, "$").replace(/\[@(?=[A-Za-z0-9_:-]+\]\s*\()/gu, "[@");
643
670
  }
644
671
  /** Hidden durable notes are context; transient runtime carriers are current-turn only. */
645
672
  function isCodexDurableCustomMessage(message) {
@@ -675,7 +702,11 @@ async function projectContextEngineAssemblyForCodex(params) {
675
702
  ...promptContextRange ? { promptContextRange } : {},
676
703
  assembledMessages: params.assembledMessages,
677
704
  prePromptMessageCount: params.originalHistoryMessages.length,
678
- ...context.images.length ? { images: context.images } : {}
705
+ ...context.imageGroups.length && promptPrefix ? { imageGroups: context.imageGroups.map((group) => ({
706
+ images: group.images,
707
+ start: group.start + promptPrefix.length,
708
+ end: group.end + promptPrefix.length
709
+ })) } : {}
679
710
  };
680
711
  }
681
712
  /** Resolves rendered context size from a token budget and reserve. */
@@ -719,32 +750,61 @@ function resolveCodexContinuityProjectionMaxChars(params) {
719
750
  }
720
751
  /** Fits projected context prompts under Codex app-server turn/start text limits. */
721
752
  function fitCodexProjectedContextForTurnStart(params) {
753
+ const slice = (start, end, budget = end - start) => {
754
+ const retained = truncateOlderContext(params.promptText.slice(start, end), budget);
755
+ return {
756
+ ...retained,
757
+ sourceStart: start + retained.retainedStart,
758
+ sourceEnd: end
759
+ };
760
+ };
761
+ const finish = (...parts) => {
762
+ const imageGroups = [];
763
+ let offset = 0;
764
+ for (const part of parts) {
765
+ for (const group of params.imageGroups ?? []) if (group.start >= part.sourceStart && group.end <= part.sourceEnd) {
766
+ const shift = offset + part.prefixLength - part.sourceStart;
767
+ imageGroups.push({
768
+ ...group,
769
+ start: group.start + shift,
770
+ end: group.end + shift
771
+ });
772
+ }
773
+ offset += part.text.length;
774
+ }
775
+ return {
776
+ promptText: parts.map((part) => part.text).join(""),
777
+ ...imageGroups.length ? { imageGroups } : {}
778
+ };
779
+ };
722
780
  const maxChars = typeof params.maxChars === "number" && Number.isFinite(params.maxChars) ? Math.max(0, Math.floor(params.maxChars)) : CODEX_TURN_START_TEXT_INPUT_MAX_CHARS;
723
- if (params.promptText.length <= maxChars) return params.promptText;
781
+ if (params.promptText.length <= maxChars) return finish(slice(0, params.promptText.length));
724
782
  const range = normalizeProjectedContextRange(params.contextRange, params.promptText.length);
725
783
  if (!range) {
726
784
  const preservedRange = normalizeProjectedContextRange(params.preservedRange, params.promptText.length);
727
- if (!preservedRange) return params.promptText;
785
+ if (!preservedRange) return finish(slice(0, params.promptText.length));
728
786
  const preservedText = params.promptText.slice(preservedRange.start, preservedRange.end);
729
- if (!preservedText) return truncateOlderContext(params.promptText, maxChars);
730
- if (preservedText.length >= maxChars) return truncateOlderContext(preservedText, maxChars);
731
- return `${truncateOlderContext(params.promptText.slice(0, preservedRange.start), maxChars - preservedText.length)}${preservedText}`;
787
+ if (!preservedText) return finish(slice(0, params.promptText.length, maxChars));
788
+ if (preservedText.length >= maxChars) return finish(slice(preservedRange.start, preservedRange.end, maxChars));
789
+ return finish(slice(0, preservedRange.start, maxChars - preservedText.length), slice(preservedRange.start, preservedRange.end));
732
790
  }
733
791
  const beforeContext = params.promptText.slice(0, range.start);
734
- const context = params.promptText.slice(range.start, range.end);
735
792
  const afterContext = params.promptText.slice(range.end);
736
793
  const requestRange = normalizeProjectedContextRange(params.requestRange, params.promptText.length);
737
794
  if (requestRange && requestRange.start >= range.end && requestRange.end < params.promptText.length) {
738
795
  const request = params.promptText.slice(requestRange.start, requestRange.end);
739
- if (request.length >= maxChars) return truncateOlderContext(request, maxChars);
740
- const fittedAppendedContext = truncateOlderContext(params.promptText.slice(requestRange.end), maxChars - request.length);
741
- const fittedContext = truncateOlderContext(context, maxChars - request.length - fittedAppendedContext.length);
742
- return `${truncateOlderContext(beforeContext, maxChars - fittedContext.length - request.length - fittedAppendedContext.length)}${fittedContext}${request}${fittedAppendedContext}`;
796
+ if (request.length >= maxChars) return finish(slice(requestRange.start, requestRange.end, maxChars));
797
+ const fittedAppendedContext = slice(requestRange.end, params.promptText.length, maxChars - request.length);
798
+ const contextBudget = maxChars - request.length - fittedAppendedContext.text.length;
799
+ const fittedContext = slice(range.start, range.end, contextBudget);
800
+ const beforeContextBudget = maxChars - fittedContext.text.length - request.length - fittedAppendedContext.text.length;
801
+ return finish(slice(0, range.start, beforeContextBudget), fittedContext, slice(requestRange.start, requestRange.end), fittedAppendedContext);
743
802
  }
744
803
  const contextBudget = maxChars - beforeContext.length - afterContext.length;
745
- if (contextBudget > 0) return `${beforeContext}${truncateOlderContext(context, contextBudget)}${afterContext}`;
746
- const afterContextText = truncateOlderContext(afterContext, maxChars);
747
- return `${truncateOlderContext(context, maxChars - afterContextText.length)}${afterContextText}`;
804
+ if (contextBudget > 0) return finish(slice(0, range.start), slice(range.start, range.end, contextBudget), slice(range.end, params.promptText.length));
805
+ const afterContextText = slice(range.end, params.promptText.length, maxChars);
806
+ const contextBudgetAfterRequest = maxChars - afterContextText.text.length;
807
+ return finish(slice(range.start, range.end, contextBudgetAfterRequest), afterContextText);
748
808
  }
749
809
  function normalizeProjectedContextRange(range, textLength) {
750
810
  if (!range) return;
@@ -765,7 +825,6 @@ function resolveProjectionPromptBudgetTokens(params) {
765
825
  }
766
826
  async function renderMessagesForCodexContext(messages, options) {
767
827
  const tail = [];
768
- const images = [];
769
828
  let retainedImageChars = 0;
770
829
  let totalChars = 0;
771
830
  let retainedChars = 0;
@@ -786,19 +845,38 @@ async function renderMessagesForCodexContext(messages, options) {
786
845
  imageChars > 0 && !imagesFit ? "[Attachment images omitted: context budget exceeded]" : void 0
787
846
  ].filter(Boolean).join("\n\n");
788
847
  if (!text && acceptedImageChars === 0) continue;
789
- const chunk = `[${message.role}]\n${text}${totalChars > 0 ? "\n\n" : ""}`;
848
+ const separator = totalChars > 0 ? "\n\n" : "";
849
+ const chunk = `[${message.role}${formatCodexContextSenderSuffix(message)}]\n${text}${separator}`;
790
850
  totalChars += chunk.length;
791
851
  if (remaining > 0) {
792
852
  const retained = neutralizeCodexExplicitMentionSigils(chunk).slice(-(remaining - acceptedImageChars));
793
- tail.push(retained);
853
+ tail.push({
854
+ text: retained,
855
+ separatorLength: separator.length,
856
+ ...imagesFit && files?.images.length && retained.length === chunk.length ? { images: files.images } : {}
857
+ });
794
858
  retainedChars += retained.length + acceptedImageChars;
795
859
  retainedImageChars += acceptedImageChars;
796
- if (imagesFit && files?.images.length) images.unshift(...files.images);
797
860
  }
798
861
  }
862
+ const ordered = tail.toReversed();
863
+ const fitted = truncateOlderContext(ordered.map((entry) => entry.text).join(""), options.maxRenderedContextChars - retainedImageChars, totalChars);
864
+ const imageGroups = [];
865
+ let offset = 0;
866
+ for (const entry of ordered) {
867
+ if (entry.images && offset >= fitted.retainedStart) {
868
+ const start = offset - fitted.retainedStart + fitted.prefixLength;
869
+ imageGroups.push({
870
+ start,
871
+ end: start + entry.text.length - entry.separatorLength,
872
+ images: entry.images
873
+ });
874
+ }
875
+ offset += entry.text.length;
876
+ }
799
877
  return {
800
- text: truncateOlderContext(tail.toReversed().join(""), options.maxRenderedContextChars - retainedImageChars, totalChars),
801
- images
878
+ text: fitted.text,
879
+ imageGroups
802
880
  };
803
881
  }
804
882
  function renderMessageBody(message, options) {
@@ -873,8 +951,12 @@ function summarizeToolInputShape(value, seen = /* @__PURE__ */ new WeakSet()) {
873
951
  return `[${typeof value}]`;
874
952
  }
875
953
  function redactPreservedToolValue(key, value, seen = /* @__PURE__ */ new WeakSet()) {
876
- if (typeof value === "string") return redactSensitiveFieldValue(key, redactToolPayloadText(value));
877
- if (value === null || value === void 0 || typeof value === "number" || typeof value === "boolean") return value;
954
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
955
+ const text = String(value);
956
+ const redacted = redactSensitiveFieldValue(key, redactToolPayloadText(text));
957
+ return redacted === text ? value : redacted;
958
+ }
959
+ if (value === null || value === void 0) return value;
878
960
  if (Array.isArray(value)) {
879
961
  if (seen.has(value)) return "[Circular]";
880
962
  seen.add(value);
@@ -912,15 +994,32 @@ function truncateText(text, maxChars) {
912
994
  return `${truncated}\n[truncated ${text.length - truncated.length} chars]`;
913
995
  }
914
996
  function truncateOlderContext(text, maxChars, totalChars = text.length) {
915
- if (totalChars <= maxChars) return text;
916
- if (maxChars <= 0) return "";
997
+ if (totalChars <= maxChars) return {
998
+ text,
999
+ retainedStart: 0,
1000
+ prefixLength: 0
1001
+ };
1002
+ if (maxChars <= 0) return {
1003
+ text: "",
1004
+ retainedStart: text.length,
1005
+ prefixLength: 0
1006
+ };
917
1007
  const buildMarker = (omittedChars) => `[truncated ${omittedChars} chars from older context]\n`;
918
1008
  let marker = buildMarker(totalChars - maxChars);
919
1009
  let tailChars = Math.max(0, maxChars - marker.length);
920
1010
  marker = buildMarker(totalChars - tailChars);
921
- if (marker.length >= maxChars) return marker.slice(0, maxChars);
1011
+ if (marker.length >= maxChars) return {
1012
+ text: marker.slice(0, maxChars),
1013
+ retainedStart: text.length,
1014
+ prefixLength: maxChars
1015
+ };
922
1016
  tailChars = maxChars - marker.length;
923
- return `${marker}${sliceUtf16Safe(text, -tailChars).trimStart()}`;
1017
+ const tail = sliceUtf16Safe(text, -tailChars).trimStart();
1018
+ return {
1019
+ text: `${marker}${tail}`,
1020
+ retainedStart: text.length - tail.length,
1021
+ prefixLength: marker.length
1022
+ };
924
1023
  }
925
1024
  //#endregion
926
1025
  //#region extensions/codex/src/app-server/thread-context-engine.ts
@@ -1577,30 +1676,6 @@ async function discardUnattestedCodexPluginThread(params) {
1577
1676
  }
1578
1677
  }
1579
1678
  //#endregion
1580
- //#region extensions/codex/src/app-server/native-hook-relay-state.ts
1581
- const pending = /* @__PURE__ */ new Set();
1582
- /** Owns delayed hook-relay cleanup across runtime scheduling and test teardown. */
1583
- const nativeHookRelayUnregisterQueue = {
1584
- add(entry) {
1585
- pending.add(entry);
1586
- },
1587
- delete(entry) {
1588
- return pending.delete(entry);
1589
- },
1590
- flush() {
1591
- while (pending.size > 0) {
1592
- const entry = pending.values().next().value;
1593
- if (!entry) return;
1594
- clearTimeout(entry.timeout);
1595
- entry.unregister();
1596
- }
1597
- },
1598
- clear() {
1599
- for (const entry of pending) clearTimeout(entry.timeout);
1600
- pending.clear();
1601
- }
1602
- };
1603
- //#endregion
1604
1679
  //#region extensions/codex/src/app-server/native-hook-relay.ts
1605
1680
  /**
1606
1681
  * Bridges Codex native hook callbacks into OpenClaw's native hook relay so
@@ -1666,6 +1741,7 @@ function scheduleCodexNativeHookRelayUnregister(params) {
1666
1741
  pending = void 0;
1667
1742
  if (!nativeHookRelayUnregisterQueue.delete(current)) return;
1668
1743
  params.relay.unregister();
1744
+ nativeHookRelayUnregisterQueue.track(params.relay.drain());
1669
1745
  };
1670
1746
  const timeout = setTimeout(unregister, resolveCodexNativeHookRelayUnregisterGraceMs(params.hookTimeoutSec));
1671
1747
  pending = {
@@ -1708,7 +1784,7 @@ function createCodexNativeHookRelay(params) {
1708
1784
  for (const pending of pendingDirectChildAdmissions.values()) pending.reject(new Error(reason));
1709
1785
  pendingDirectChildAdmissions.clear();
1710
1786
  };
1711
- const relay = registerRetainedNativeHookRelayForBundledRuntime({
1787
+ const relay = registerNativeHookRelayForBundledRuntime({
1712
1788
  provider: "codex",
1713
1789
  relayId: buildCodexNativeHookRelayId({
1714
1790
  agentId: params.agentId,
@@ -1737,6 +1813,7 @@ function createCodexNativeHookRelay(params) {
1737
1813
  }),
1738
1814
  signal: params.signal,
1739
1815
  runBeforeToolCall: params.hostCapabilities.runBeforeToolCall,
1816
+ approvalHost: params.hostCapabilities,
1740
1817
  assertActive: () => {
1741
1818
  params.hostCapabilities.assertActive();
1742
1819
  params.assertCurrent?.();
@@ -1745,20 +1822,32 @@ function createCodexNativeHookRelay(params) {
1745
1822
  readClaim: readCodexNativeChildThreadId,
1746
1823
  shouldRetainAfterForegroundClose: () => successfulYieldRetentionAuthorized && directChildClaims.size > 0,
1747
1824
  allowPreToolUse: (childThreadId) => directChildClaims.has(childThreadId),
1748
- awaitForegroundAdmission: (childThreadId) => {
1825
+ awaitForegroundAdmission: (childThreadId, signal) => {
1749
1826
  if (foregroundClosed) return Promise.reject(/* @__PURE__ */ new Error("native hook relay foreground admission unavailable"));
1750
1827
  const existingClaim = directChildClaims.get(childThreadId);
1751
1828
  if (existingClaim) return Promise.resolve(assertClaim(childThreadId, existingClaim));
1752
- const existingPending = pendingDirectChildAdmissions.get(childThreadId);
1753
- if (existingPending) return existingPending.promise.then((claim) => assertClaim(childThreadId, claim));
1754
- if (pendingDirectChildAdmissions.size >= MAX_PENDING_DIRECT_CHILD_ADMISSIONS) return Promise.reject(/* @__PURE__ */ new Error("native hook relay foreground admission capacity reached"));
1755
- const { promise, resolve, reject } = createDeferred();
1756
- pendingDirectChildAdmissions.set(childThreadId, {
1757
- promise,
1758
- resolve,
1759
- reject
1829
+ let pending = pendingDirectChildAdmissions.get(childThreadId);
1830
+ if (!pending) {
1831
+ if (pendingDirectChildAdmissions.size >= MAX_PENDING_DIRECT_CHILD_ADMISSIONS) return Promise.reject(/* @__PURE__ */ new Error("native hook relay foreground admission capacity reached"));
1832
+ pending = {
1833
+ ...createDeferred(),
1834
+ waiters: 0
1835
+ };
1836
+ pendingDirectChildAdmissions.set(childThreadId, pending);
1837
+ }
1838
+ const admission = pending;
1839
+ admission.waiters++;
1840
+ let onAbort;
1841
+ return new Promise((resolve, reject) => {
1842
+ admission.promise.then(resolve, reject);
1843
+ onAbort = () => reject(toErrorObject(signal?.reason, "native hook relay admission aborted"));
1844
+ signal?.addEventListener("abort", onAbort, { once: true });
1845
+ if (signal?.aborted) onAbort();
1846
+ }).then((claim) => assertClaim(childThreadId, claim)).finally(() => {
1847
+ if (onAbort) signal?.removeEventListener("abort", onAbort);
1848
+ admission.waiters--;
1849
+ if (admission.waiters === 0 && pendingDirectChildAdmissions.get(childThreadId) === admission) pendingDirectChildAdmissions.delete(childThreadId);
1760
1850
  });
1761
- return promise.then((claim) => assertClaim(childThreadId, claim));
1762
1851
  },
1763
1852
  onDispose: () => {
1764
1853
  foregroundClosed = true;
@@ -1805,7 +1894,10 @@ function createCodexNativeHookRelay(params) {
1805
1894
  released = true;
1806
1895
  if (directChildClaims.get(threadId) !== claim) return;
1807
1896
  directChildClaims.delete(threadId);
1808
- if (foregroundClosed && directChildClaims.size === 0) relay.unregister();
1897
+ if (foregroundClosed && directChildClaims.size === 0) {
1898
+ relay.unregister();
1899
+ nativeHookRelayUnregisterQueue.track(relay.drain());
1900
+ }
1809
1901
  };
1810
1902
  }
1811
1903
  };
@@ -2056,6 +2148,7 @@ function resolveCodexAppServerModelProvider(params) {
2056
2148
  //#region extensions/codex/src/app-server/thread-prompt.ts
2057
2149
  function buildDeveloperInstructions(params, options = {}) {
2058
2150
  const deferredToolNames = /* @__PURE__ */ new Set();
2151
+ let screenToolName;
2059
2152
  let showWidgetToolName;
2060
2153
  let dashboardToolName;
2061
2154
  let portalToolName;
@@ -2074,6 +2167,7 @@ function buildDeveloperInstructions(params, options = {}) {
2074
2167
  const name = tool.name.trim();
2075
2168
  const qualifiedName = spec.type === "namespace" ? `${spec.name}.${name}` : name;
2076
2169
  if (tool.deferLoading === true && name) deferredToolNames.add(name);
2170
+ if (name === "screen") screenToolName ??= qualifiedName;
2077
2171
  if (name === "show_widget") showWidgetToolName ??= qualifiedName;
2078
2172
  if (name === "dashboard") dashboardToolName ??= qualifiedName;
2079
2173
  if (name === "portal") portalToolName ??= qualifiedName;
@@ -2117,6 +2211,7 @@ function buildDeveloperInstructions(params, options = {}) {
2117
2211
  hasSessionsSend
2118
2212
  }).join("\n") : void 0,
2119
2213
  params.disableTools !== true && params.promptMode !== "minimal" && params.promptMode !== "none" ? buildUiPresentationPrompt({
2214
+ screenToolName,
2120
2215
  showWidgetToolName,
2121
2216
  dashboardToolName,
2122
2217
  portalToolName,
@@ -2357,6 +2452,7 @@ function buildThreadStartParams(params, options) {
2357
2452
  ...(options.hostSystemAgentActive ?? isHostScopedAgentToolActive("openclaw")) && isSystemAgentOnlyCodexDynamicToolAllowlist(params.toolsAllow) ? { baseInstructions: "" } : {},
2358
2453
  personality: CODEX_NATIVE_PERSONALITY_NONE,
2359
2454
  serviceName: "OpenClaw",
2455
+ threadSource: "openclaw",
2360
2456
  ...resolveCodexThreadEnvironmentSelection(options),
2361
2457
  dynamicTools: [...options.dynamicTools],
2362
2458
  experimentalRawEvents: true,
@@ -2998,7 +3094,7 @@ async function prepareCodexThreadLifecyclePreflight(params) {
2998
3094
  warn: (message) => embeddedAgentLog.warn(message),
2999
3095
  onServerUnavailable: (serverName, error) => embeddedAgentLog.warn("skipping unavailable MCP OAuth server", {
3000
3096
  serverName,
3001
- error: formatErrorMessage(error)
3097
+ error: formatErrorMessage$1(error)
3002
3098
  })
3003
3099
  });
3004
3100
  const nativeSkillIsolation = await lifecycleTiming.measure("native-skill-isolation", () => resolveCodexNativeSkillIsolation({
@@ -3085,8 +3181,14 @@ async function resumeExistingCodexThread(params, context) {
3085
3181
  disposeConfiguration = configuration.dispose;
3086
3182
  await context.releaseRetainedThread(configuration.assertCurrent);
3087
3183
  configuration.assertCurrent();
3184
+ const clientBoundThread = ringZeroClientInstanceId !== void 0 || resumeBinding.ringZeroClientInstanceId !== void 0 || resumeBinding.ringZeroConfigFingerprint !== void 0 || context.ringZeroActive;
3185
+ const sharedEntry = getCurrentSharedClientEntry(params.client);
3186
+ if (configuration.settledSystemError && !clientBoundThread && resumeBinding.connectionScope !== "supervision" && (!sharedEntry || sharedEntry.activeLeases <= 1 && sharedEntry.pendingAcquires === 0) && !hasCodexAppServerSiblingThreadWork(params.client, resumeBinding.threadId) && !hasCodexAppServerSiblingRouteWork(params.client, resumeBinding.threadId)) {
3187
+ await abandonClient();
3188
+ throw new CodexThreadClientReplacementError();
3189
+ }
3088
3190
  const authProfileId = resumeBinding.connectionScope === "supervision" ? void 0 : params.params.authProfileId ?? resumeBinding.authProfileId;
3089
- const finalConfigPatch = context.prebuiltFinalConfigPatch ?? params.buildFinalConfigPatch?.({
3191
+ const finalConfigPatch = context.prebuiltFinalConfigPatch ?? await params.buildFinalConfigPatch?.({
3090
3192
  action: "resume",
3091
3193
  binding: resumeBinding
3092
3194
  }) ?? {
@@ -3261,7 +3363,7 @@ async function startFreshCodexThread(params, context) {
3261
3363
  const clientId = resolveCodexAppServerClientInstanceId(params.client);
3262
3364
  const { bindingIdentity, startModelSelection, startModelProvider, userMcpServersConfigPatch, dynamicToolsFingerprint, dynamicToolsContainDeferred, webSearchThreadConfigFingerprint, nativeSkillIsolationFingerprint, userMcpServersFingerprint, ringZeroConfigFingerprint, ringZeroClientInstanceId, networkProxyConfigFingerprint, contextEngineBinding, environmentSelectionFingerprint, hostSystemAgentActive, restrictedToolSurface, restrictedToolSurfaceInheritedMcpServerNames, nativeSkillIsolation, lifecycleTiming, normalizeBindingModelProvider, throwIfAborted, prebuiltPluginThreadConfig, preserveExistingBinding, rotatedContextEngineBinding, replacementPredecessor } = context;
3263
3365
  const pluginThreadConfig = params.pluginThreadConfig?.enabled ? prebuiltPluginThreadConfig ?? await lifecycleTiming.measure("plugin-config-build", () => params.pluginThreadConfig?.build()) : void 0;
3264
- const finalConfigPatch = params.buildFinalConfigPatch?.({ action: "start" }) ?? {
3366
+ const finalConfigPatch = await params.buildFinalConfigPatch?.({ action: "start" }) ?? {
3265
3367
  configPatch: params.finalConfigPatch,
3266
3368
  nativeHookRelayGeneration: params.nativeHookRelayGeneration
3267
3369
  };
@@ -3496,7 +3598,7 @@ async function tryReuseCodexLiveThread(options) {
3496
3598
  const incognito = isIncognitoSessionKey(params.params.sessionKey);
3497
3599
  if (incognito && (binding.preserveNativeModel || binding.connectionScope === "supervision")) {
3498
3600
  if (binding.clientId === clientId && binding.clientId && ((await options.buildLoadedPluginThreadConfig(binding))?.fingerprint ?? binding.pluginAppsFingerprint) === binding.pluginAppsFingerprint) {
3499
- params.buildFinalConfigPatch?.({
3601
+ await params.buildFinalConfigPatch?.({
3500
3602
  action: "resume",
3501
3603
  binding
3502
3604
  });
@@ -3532,7 +3634,7 @@ async function tryReuseCodexLiveThread(options) {
3532
3634
  const pluginThreadConfig = await options.buildLoadedPluginThreadConfig(binding);
3533
3635
  assertWarmOwner();
3534
3636
  if (pluginThreadConfig && pluginThreadConfig.fingerprint !== binding.pluginAppsFingerprint) return { kind: "rotate" };
3535
- const prebuiltFinalConfigPatch = params.buildFinalConfigPatch?.({
3637
+ const prebuiltFinalConfigPatch = await params.buildFinalConfigPatch?.({
3536
3638
  action: "resume",
3537
3639
  binding
3538
3640
  }) ?? {
@@ -3767,7 +3869,8 @@ async function preparePendingCodexThreadResume(params, binding, dynamicToolsFing
3767
3869
  return {
3768
3870
  assertConfigured: observation.assertConfigured,
3769
3871
  assertCurrent,
3770
- dispose
3872
+ dispose,
3873
+ settledSystemError: observation.settledSystemError
3771
3874
  };
3772
3875
  } catch (error) {
3773
3876
  dispose();
@@ -3776,7 +3879,7 @@ async function preparePendingCodexThreadResume(params, binding, dynamicToolsFing
3776
3879
  }
3777
3880
  /** Observe teardown before release; a successful resume alone can acknowledge ignored overrides. */
3778
3881
  async function prepareCodexThreadResume(params, binding, context) {
3779
- const assertClient = captureCodexAppServerClientLifetime(params.client, binding.connectionScope === "supervision" ? "connection" : "native-process");
3882
+ const assertClient = captureCodexAppServerClientLifetime(params.client, binding.connectionScope === "supervision" ? "connection" : "thread-configuration");
3780
3883
  const assertCurrent = () => {
3781
3884
  params.params.hostCapabilities.assertActive();
3782
3885
  params.assertCurrent?.();
@@ -3802,11 +3905,13 @@ function isCodexThreadNonRunning(status) {
3802
3905
  }
3803
3906
  function observeCodexThreadConfiguration(params, thread, assertCurrent) {
3804
3907
  if (!isCodexThreadNonRunning(thread.status)) throw new CodexAdoptedThreadActiveError();
3908
+ const settledSystemError = thread.status.type === "systemError";
3805
3909
  let unloaded = thread.status.type === "notLoaded";
3806
3910
  return {
3807
3911
  dispose: params.client.addNotificationHandler((notification) => {
3808
3912
  if (notification.method === "thread/status/changed" && isJsonObject(notification.params) && notification.params.threadId === thread.id && isJsonObject(notification.params.status) && notification.params.status.type === "notLoaded") unloaded = true;
3809
3913
  }),
3914
+ settledSystemError,
3810
3915
  assertConfigured: () => {
3811
3916
  assertCurrent();
3812
3917
  if (!unloaded) throw new Error("Codex did not confirm unloading its previous configuration. The thread is preserved; stop competing native work and reconnect before retrying.");
@@ -4166,7 +4271,7 @@ async function archiveSupervisionArtifact(client, threadId) {
4166
4271
  await client.request("thread/archive", { threadId }, { timeoutMs: CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS });
4167
4272
  return true;
4168
4273
  } catch (error) {
4169
- const message = formatErrorMessage(error).toLowerCase();
4274
+ const message = formatErrorMessage$1(error).toLowerCase();
4170
4275
  if (message.includes("no rollout found for thread id") || message.includes("thread not found") || message.includes("already archived")) return true;
4171
4276
  await unsubscribeCodexThreadBestEffort(client, {
4172
4277
  threadId,
@@ -4247,7 +4352,7 @@ async function startOrResumeThread(input) {
4247
4352
  await releaseRetainedThread(binding.threadId);
4248
4353
  const pendingBinding = binding;
4249
4354
  const pluginThreadConfig = params.pluginThreadConfig?.enabled ? await lifecycleTiming.measure("plugin-config-build", () => params.pluginThreadConfig?.build()) : void 0;
4250
- const finalConfigPatch = params.buildFinalConfigPatch?.({ action: "start" }) ?? {
4355
+ const finalConfigPatch = await params.buildFinalConfigPatch?.({ action: "start" }) ?? {
4251
4356
  configPatch: params.finalConfigPatch,
4252
4357
  nativeHookRelayGeneration: params.nativeHookRelayGeneration
4253
4358
  };
@@ -4575,10 +4680,7 @@ const LEGACY_PRO_MODEL_ID_RE = /^gpt-5\.[45]-pro$/u;
4575
4680
  const MODERN_GPT_5_MODEL_ID_RE = /^gpt-5\.(?:[3-9]|[1-9]\d)(?:$|-)/u;
4576
4681
  /** Read reasoning metadata after the Codex app-server route has been selected. */
4577
4682
  function readCodexSupportedReasoningEfforts(compat) {
4578
- if (!compat || typeof compat !== "object" || Array.isArray(compat)) return;
4579
- const efforts = compat.supportedReasoningEfforts;
4580
- if (!Array.isArray(efforts)) return;
4581
- return efforts.filter((effort) => typeof effort === "string");
4683
+ return compat && "supportedReasoningEfforts" in compat ? compat.supportedReasoningEfforts : void 0;
4582
4684
  }
4583
4685
  function resolveSupportedReasoningEffort(params) {
4584
4686
  const declared = new Set(params.supportedReasoningEfforts.map((effort) => effort.trim().toLowerCase()));
@@ -4591,23 +4693,40 @@ function resolveCodexAppServerReasoningEffort(params) {
4591
4693
  if (params.thinkLevel === "ultra") return "ultra";
4592
4694
  if (params.thinkLevel === "off") return params.supportedReasoningEfforts?.includes("none") ? "none" : null;
4593
4695
  if (params.thinkLevel === "adaptive") return null;
4594
- if (params.supportedReasoningEfforts) return resolveSupportedReasoningEffort({
4595
- requested: params.thinkLevel,
4596
- supportedReasoningEfforts: params.supportedReasoningEfforts
4597
- }) ?? null;
4598
4696
  const modelId = params.modelId.trim().toLowerCase();
4599
- if (LEGACY_PRO_MODEL_ID_RE.test(modelId)) return resolveSupportedReasoningEffort({
4697
+ const supportedReasoningEfforts = params.supportedReasoningEfforts ?? (LEGACY_PRO_MODEL_ID_RE.test(modelId) ? LEGACY_PRO_REASONING_EFFORTS : void 0);
4698
+ if (supportedReasoningEfforts) return resolveSupportedReasoningEffort({
4600
4699
  requested: params.thinkLevel,
4601
- supportedReasoningEfforts: LEGACY_PRO_REASONING_EFFORTS
4700
+ supportedReasoningEfforts
4602
4701
  }) ?? null;
4603
4702
  if (params.thinkLevel === "minimal" && MODERN_GPT_5_MODEL_ID_RE.test(modelId)) return "low";
4604
- if (params.thinkLevel === "minimal" || params.thinkLevel === "low" || params.thinkLevel === "medium" || params.thinkLevel === "high" || params.thinkLevel === "xhigh") return params.thinkLevel;
4605
- return null;
4703
+ return params.thinkLevel === "max" ? null : params.thinkLevel;
4606
4704
  }
4607
4705
  //#endregion
4608
4706
  //#region extensions/codex/src/app-server/user-input.ts
4707
+ function prependHistoryProvenance(input, historyProvenancePrefix) {
4708
+ if (!historyProvenancePrefix) return input;
4709
+ const firstTextIndex = input.findIndex((item) => item.type === "text");
4710
+ if (firstTextIndex === -1) return [{
4711
+ type: "text",
4712
+ text: historyProvenancePrefix,
4713
+ text_elements: []
4714
+ }, ...input];
4715
+ return input.map((item, index) => index === firstTextIndex && item.type === "text" ? {
4716
+ ...item,
4717
+ text: `${historyProvenancePrefix}${item.text}`
4718
+ } : item);
4719
+ }
4609
4720
  /** Builds ordered Codex user input for both new turns and same-turn steering. */
4610
- function buildCodexUserInput(text, images) {
4721
+ function buildCodexUserInput(text, images, contextImageGroups, historyProvenancePrefix) {
4722
+ if (text !== void 0 && contextImageGroups?.length) {
4723
+ let offset = 0;
4724
+ return prependHistoryProvenance([...contextImageGroups.flatMap((group) => {
4725
+ const parts = buildCodexUserInput(text.slice(offset, group.end), group.images);
4726
+ offset = group.end;
4727
+ return parts;
4728
+ }), ...buildCodexUserInput(text.slice(offset), images)], historyProvenancePrefix);
4729
+ }
4611
4730
  const imageInputs = (images ?? []).map((image) => {
4612
4731
  const imageUrl = sanitizeInlineImageDataUrl(`data:${image.mimeType};base64,${image.data}`);
4613
4732
  return imageUrl ? {
@@ -4619,16 +4738,16 @@ function buildCodexUserInput(text, images) {
4619
4738
  text_elements: []
4620
4739
  };
4621
4740
  });
4622
- return [...text === void 0 ? [] : [{
4741
+ return prependHistoryProvenance([...text === void 0 ? [] : [{
4623
4742
  type: "text",
4624
4743
  text,
4625
4744
  text_elements: []
4626
- }], ...imageInputs];
4745
+ }], ...imageInputs], historyProvenancePrefix);
4627
4746
  }
4628
4747
  //#endregion
4629
4748
  //#region extensions/codex/src/app-server/turn-params.ts
4630
4749
  const CODEX_CURRENT_SENDER_FIELD_MAX_CHARS = 256;
4631
- function buildCodexCurrentSenderContextValue(params) {
4750
+ function readCodexCurrentSender(params) {
4632
4751
  const metadata = asOptionalRecord(asOptionalRecord(params.userTurnTranscriptRecorder?.message)?.["__openclaw"]);
4633
4752
  const recorded = [
4634
4753
  normalizeOptionalString(metadata?.["senderId"]),
@@ -4642,11 +4761,19 @@ function buildCodexCurrentSenderContextValue(params) {
4642
4761
  ];
4643
4762
  if (!id && !name && !username) return;
4644
4763
  const bound = (value) => truncateUtf16Safe(value, CODEX_CURRENT_SENDER_FIELD_MAX_CHARS);
4645
- return JSON.stringify({ sender: {
4764
+ return {
4646
4765
  ...id ? { id: bound(id) } : {},
4647
4766
  ...name ? { name: bound(name) } : {},
4648
4767
  ...username ? { username: bound(username) } : {}
4649
- } });
4768
+ };
4769
+ }
4770
+ function buildCodexCurrentSenderContextValue(params) {
4771
+ const sender = readCodexCurrentSender(params);
4772
+ return sender ? JSON.stringify({ sender }) : void 0;
4773
+ }
4774
+ function buildCodexHistoryProvenancePrefix(params) {
4775
+ const sender = readCodexCurrentSender(params);
4776
+ return sender?.id ? neutralizeCodexExplicitMentionSigils(`[OpenClaw conversation info: sender=${JSON.stringify(sender)}]\n`) : void 0;
4650
4777
  }
4651
4778
  function buildTurnStartParams(params, options) {
4652
4779
  const modelSelection = options.preserveNativeTurnSettings ? void 0 : resolveCodexAppServerRequestModelSelection({
@@ -4694,7 +4821,8 @@ function buildTurnStartParams(params, options) {
4694
4821
  };
4695
4822
  return {
4696
4823
  threadId: options.threadId,
4697
- input: [...buildCodexUserInput(options.promptText ?? params.prompt, params.images), ...options.explicitSkillInputs ?? []],
4824
+ ...params.trigger ? { turnTrigger: params.trigger } : {},
4825
+ input: [...buildCodexUserInput(options.promptText ?? params.prompt, params.images, options.contextImageGroups, options.historyProvenancePrefix ?? (params.trigger === "user" ? buildCodexHistoryProvenancePrefix(params) : void 0)), ...options.explicitSkillInputs ?? []],
4698
4826
  ...additionalContext ? { additionalContext } : {},
4699
4827
  cwd: options.cwd,
4700
4828
  ...options.appServer.sessionRoot ? { runtimeWorkspaceRoots: [options.appServer.sessionRoot] } : {},
@@ -4758,7 +4886,7 @@ function buildDefaultCollaborationInstructions() {
4758
4886
  "",
4759
4887
  "Use the `request_user_input` tool only when it is listed in the available tools for this turn.",
4760
4888
  "",
4761
- "In Default mode, strongly prefer making reasonable assumptions and executing the user's request rather than stopping to ask questions. If you absolutely must ask a question because the answer cannot be discovered from local context and a reasonable assumption would be risky, ask the user directly with a concise plain-text question. Never write a multiple choice question as a textual assistant message."
4889
+ "In Default mode, strongly prefer making reasonable assumptions and executing the user's request rather than stopping to ask questions. When a missing preference, constraint, or clarification warrants a question, use `request_user_input_async` if it is available and continue independent work. Answers arrive as ordinary user messages. A suggested or preselected answer is not consent; wait for explicit approval before dependent actions that require it. If neither question tool is available, ask a concise plain-text question. Never write a multiple choice question as a textual assistant message."
4762
4890
  ].join("\n");
4763
4891
  }
4764
4892
  function buildCronCollaborationInstructions() {
@@ -4773,4 +4901,4 @@ function joinPresentSections(...sections) {
4773
4901
  return sections.filter((section) => Boolean(section?.trim())).join("\n\n");
4774
4902
  }
4775
4903
  //#endregion
4776
- export { codexDynamicToolsFingerprint as $, readCodexMcpToolConnectorId as A, createCodexNativeHookRelay as B, resolveCodexWebSearchPlan as C, buildCodexPluginThreadConfigInputFingerprint as Ct, resolveCodexAppServerRequestModelSelection as D, refreshCodexPluginAppApprovalPolicy as Dt, resolveCodexAppServerModelProvider as E, mergeCodexThreadConfigs as Et, CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS as F, checkCodexThreadAppAvailability as G, resolveCodexNativeHookRelayEvents as H, assertCodexNativeHookRelayAllowed as I, loadCodexNativeToolCatalog as J, attestCodexRestrictedToolSurfaceMcpServersDisabled as K, buildCodexNativeHookRelayConfig as L, buildCodexProjectDocThreadConfig as M, isCodexAppServerProfilerEnabled as N, resolveCodexAppServerThreadModelSelection as O, shouldBuildCodexPluginThreadConfig as Ot, CODEX_NATIVE_HOOK_RELAY_EVENTS as P, areCodexDynamicToolFingerprintsCompatible as Q, buildCodexNativeHookRelayDisabledConfig as R, buildCodexNativeWebSearchThreadConfig as S, buildCodexPluginThreadConfig as St, CODEX_NATIVE_PERSONALITY_NONE as T, buildDisabledAppsConfigPatch as Tt, resolveCodexNativeHookRelayTtlMs as U, emitCodexNativePreToolUseFailureDiagnostic as V, scheduleCodexNativeHookRelayUnregister as W, applyCodexNativeSkillIsolation as X, parseCodexNativeToolCatalog as Y, resolveCodexNativeSkillIsolation as Z, assertCodexManagedRequirementsDoNotOverrideToolPolicy as _, neutralizeCodexExplicitMentionSigils as _t, buildCodexUserInput as a, isForcedPrivateQaCodexRuntime as at, buildCodexThreadConfiguration as b, resolveCodexContextEngineProjectionReserveTokens as bt, startOrResumeThread as c, normalizeCodexDynamicToolName as ct, buildScheduledCodexAppAuthorityInputFingerprint as d, buildContextEngineBinding as dt, codexLegacyDynamicToolsFingerprint as et, buildScheduledCodexAppServerConnectionIdentity as f, isContextEngineBindingCompatible as ft, resolveScheduledCodexAppCreatorCaptureDecision as g, isCodexDurableCustomMessage as gt, readCurrentCodexScheduledAppPolicy as h, fitCodexProjectedContextForTurnStart as ht, buildTurnStartParams as i, filterCodexDynamicToolsForDisabledNativeSurface as it, readCodexMcpToolUiVisibility as j, resolveCodexBindingModelProviderFallback as k, assertScheduledCodexAppAuthorityRuntime as l, resolveCodexDynamicToolsLoading as lt, intersectCodexPluginThreadConfigWithScheduledAuthority as m, buildCodexContinuityCalibration as mt, buildCodexTemporalAdditionalContext as n, fingerprintUserMcpServersConfigPatch as nt, readCodexSupportedReasoningEfforts as o, isMessageOnlyCodexSourceReply as ot, captureScheduledCodexAppAuthority as p, CodexContextAttachmentError as pt, hasCodexNativeToolCatalog as q, buildTurnCollaborationMode as r, filterCodexDynamicTools as rt, resolveCodexAppServerReasoningEffort as s, isSystemAgentOnlyCodexDynamicToolAllowlist as st, buildCodexParentLocalInstructions as t, fingerprintJsonObject as tt, buildLegacyScheduledCodexAppRecoveryPrompt as u, resolveCodexDynamicToolsLoadingForRuntime as ut, buildCodexRingZeroThreadConfigPatch as v, projectContextEngineAssemblyForCodex as vt, buildDeveloperInstructions as w, buildCodexPluginThreadConfigTimeoutFallback as wt, readCodexInheritedMcpServerNames as x, resolveCodexContinuityProjectionMaxChars as xt, buildCodexRuntimeThreadConfig as y, resolveCodexContextEngineProjectionMaxChars as yt, buildCodexNativeHookRelayId as z };
4904
+ export { areCodexDynamicToolFingerprintsCompatible as $, resolveCodexBindingModelProviderFallback as A, shouldBuildCodexPluginThreadConfig as At, buildCodexNativeHookRelayId as B, buildCodexNativeWebSearchThreadConfig as C, resolveCodexContinuityProjectionMaxChars as Ct, resolveCodexAppServerModelProvider as D, buildDisabledAppsConfigPatch as Dt, CODEX_NATIVE_PERSONALITY_NONE as E, buildCodexPluginThreadConfigTimeoutFallback as Et, CODEX_NATIVE_HOOK_RELAY_EVENTS as F, scheduleCodexNativeHookRelayUnregister as G, emitCodexNativePreToolUseFailureDiagnostic as H, CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS as I, hasCodexNativeToolCatalog as J, checkCodexThreadAppAvailability as K, assertCodexNativeHookRelayAllowed as L, readCodexMcpToolUiVisibility as M, buildCodexProjectDocThreadConfig as N, resolveCodexAppServerRequestModelSelection as O, mergeCodexThreadConfigs as Ot, isCodexAppServerProfilerEnabled as P, resolveCodexNativeSkillIsolation as Q, buildCodexNativeHookRelayConfig as R, readCodexInheritedMcpServerNames as S, resolveCodexContextEngineProjectionReserveTokens as St, buildDeveloperInstructions as T, buildCodexPluginThreadConfigInputFingerprint as Tt, resolveCodexNativeHookRelayEvents as U, createCodexNativeHookRelay as V, resolveCodexNativeHookRelayTtlMs as W, parseCodexNativeToolCatalog as X, loadCodexNativeToolCatalog as Y, applyCodexNativeSkillIsolation as Z, resolveScheduledCodexAppCreatorCaptureDecision as _, fitCodexProjectedContextForTurnStart as _t, buildTurnStartParams as a, filterCodexDynamicToolsForDisabledNativeSurface as at, buildCodexRuntimeThreadConfig as b, projectContextEngineAssemblyForCodex as bt, resolveCodexAppServerReasoningEffort as c, isSystemAgentOnlyCodexDynamicToolAllowlist as ct, buildLegacyScheduledCodexAppRecoveryPrompt as d, resolveCodexDynamicToolsLoadingForRuntime as dt, codexDynamicToolsFingerprint as et, buildScheduledCodexAppAuthorityInputFingerprint as f, buildContextEngineBinding as ft, readCurrentCodexScheduledAppPolicy as g, buildCodexContinuityCalibration as gt, intersectCodexPluginThreadConfigWithScheduledAuthority as h, CodexContextAttachmentError as ht, buildTurnCollaborationMode as i, filterCodexDynamicTools as it, readCodexMcpToolConnectorId as j, resolveCodexAppServerThreadModelSelection as k, refreshCodexPluginAppApprovalPolicy as kt, startOrResumeThread as l, normalizeCodexDynamicToolName as lt, captureScheduledCodexAppAuthority as m, CODEX_TURN_START_TEXT_INPUT_MAX_CHARS as mt, buildCodexParentLocalInstructions as n, fingerprintJsonObject as nt, buildCodexUserInput as o, isForcedPrivateQaCodexRuntime as ot, buildScheduledCodexAppServerConnectionIdentity as p, isContextEngineBindingCompatible as pt, attestCodexRestrictedToolSurfaceMcpServersDisabled as q, buildCodexTemporalAdditionalContext as r, fingerprintUserMcpServersConfigPatch as rt, readCodexSupportedReasoningEfforts as s, isMessageOnlyCodexSourceReply as st, buildCodexHistoryProvenancePrefix as t, codexLegacyDynamicToolsFingerprint as tt, assertScheduledCodexAppAuthorityRuntime as u, resolveCodexDynamicToolsLoading as ut, assertCodexManagedRequirementsDoNotOverrideToolPolicy as v, isCodexDurableCustomMessage as vt, resolveCodexWebSearchPlan as w, buildCodexPluginThreadConfig as wt, buildCodexThreadConfiguration as x, resolveCodexContextEngineProjectionMaxChars as xt, buildCodexRingZeroThreadConfigPatch as y, neutralizeCodexExplicitMentionSigils as yt, buildCodexNativeHookRelayDisabledConfig as z };