@openclaw/codex 2026.9.4 → 2026.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/assets/activity.svg +30 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/.setup/account-usage-runtime-Eem_WGqY.mjs +75 -0
  4. package/dist/{apply-CvT8tW5i.js → .setup/apply-DDOi8uNx.mjs} +24 -30
  5. package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
  6. package/dist/{attempt-client-cleanup-DKHzbwt5.js → .setup/attempt-client-cleanup-CEv1cKwF.mjs} +79 -49
  7. package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
  8. package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +331 -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-B2mpaI9D.mjs} +9 -81
  11. package/dist/{auth-profile-CwzO4_RG.js → .setup/auth-profile-WqZtZfXN.mjs} +1 -1
  12. package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
  13. package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
  14. package/dist/.setup/binding-connection-ThoatDcb.mjs +50 -0
  15. package/dist/.setup/binding-connection.runtime-yoHrABt-.mjs +48 -0
  16. package/dist/{bounded-turn-C_Hneydj.js → .setup/bounded-turn-B2HScEgT.mjs} +143 -32
  17. package/dist/{build-state-BCmg9-5p.js → .setup/build-state-C7EnDVgr.mjs} +1 -1
  18. package/dist/{capabilities-8vx68WLH.js → .setup/capabilities-CDXOOFdZ.mjs} +1 -1
  19. package/dist/{client-B57KWPQx.js → .setup/client-Cs08OXVQ.mjs} +705 -512
  20. package/dist/.setup/client-catalog-response-BMgt_4q4.mjs +285 -0
  21. package/dist/{command-dispatch-BpduNGVf.js → .setup/command-dispatch-B4JuOsOk.mjs} +8 -4
  22. package/dist/{command-formatters-lxlkNZgU.js → .setup/command-formatters-Bmqvr9tO.mjs} +8 -4
  23. package/dist/{command-handlers-tiL9iWj7.js → .setup/command-handlers-DW7Lx9oH.mjs} +137 -186
  24. package/dist/{command-rpc-CR5EOEZX.js → .setup/command-rpc-DixIj3HW.mjs} +47 -23
  25. package/dist/{compact-B_H3AOd7.js → .setup/compact-Du5UvtxA.mjs} +29 -51
  26. package/dist/{config-oIORaQ5T.js → .setup/config-BoTP_mrL.mjs} +5 -4
  27. package/dist/{config-options-CXMq1T-C.js → .setup/config-options-BvaRs51b.mjs} +50 -446
  28. package/dist/{protocol-5bh1G-H7.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
  29. package/dist/{config-runtime-D0zGNIHu.js → .setup/config-runtime-C8Rw1m1m.mjs} +2 -2
  30. package/dist/.setup/config-security-BEReZ6go.mjs +380 -0
  31. package/dist/{conversation-binding-DsB4-O7U.js → .setup/conversation-binding-DP-gMrBP.mjs} +29 -38
  32. package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
  33. package/dist/{conversation-control-CtUu1b3m.js → .setup/conversation-control-uK9Jomlc.mjs} +32 -67
  34. package/dist/.setup/cyber-failover-DYwbmf1o.mjs +123 -0
  35. package/dist/.setup/cyber-failover-notice-e9G3J9-e.mjs +17 -0
  36. package/dist/{dynamic-tools-CmN5RAip.js → .setup/dynamic-tools-BDXl-8Cw.mjs} +936 -620
  37. package/dist/{effective-mcp-catalog-Bd73bqA8.js → .setup/effective-mcp-catalog-CvnvnGIe.mjs} +3 -3
  38. package/dist/{ephemeral-turn-D78_VmzO.js → .setup/ephemeral-turn-poidXgek.mjs} +9 -7
  39. package/dist/{event-projector-assistant-message-BmBM4qBV.js → .setup/event-projector-assistant-message-BsruvNrH.mjs} +8 -7
  40. package/dist/{event-projector-items-5VhsECCO.js → .setup/event-projector-items-C6L_5ZiT.mjs} +42 -8
  41. package/dist/{attempt-notifications-C9XufG6l.js → .setup/event-projector-usage-CnBS8Wa3.mjs} +102 -9
  42. package/dist/{harness-C7rRa7bm.js → .setup/harness-a_MsE4-_.mjs} +81 -21
  43. package/dist/{inference-context-Dr_mzvk4.js → .setup/inference-context-D96l9-ew.mjs} +1 -1
  44. package/dist/.setup/inference-proxy-b-aJMSxm.mjs +601 -0
  45. package/dist/{isolated-completion-DWVb5U2J.js → .setup/isolated-completion-BIZFhTNG.mjs} +18 -11
  46. package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
  47. package/dist/{managed-binary-D22rNEcR.js → .setup/managed-binary-BnshlFag.mjs} +14 -3
  48. package/dist/{managed-thread-store-D1t5jh3G.js → .setup/managed-thread-store-BMqgThVL.mjs} +48 -14
  49. package/dist/{model-catalog-Dq2n8f_p.js → .setup/model-catalog-CfXJf9Ay.mjs} +36 -12
  50. package/dist/{models-PCKOim-h.js → .setup/models-KnqBv0hE.mjs} +3 -3
  51. package/dist/.setup/native-auth-rWbGbMn3.mjs +57 -0
  52. package/dist/{native-subagent-history-DjtPloaU.js → .setup/native-subagent-history-0nYYgo0k.mjs} +43 -35
  53. package/dist/.setup/native-subagent-monitor-D3filLY2.mjs +4859 -0
  54. package/dist/{native-subagent-task-ids-BzTdT0Uw.js → .setup/native-subagent-task-ids-wb8CKZGN.mjs} +98 -44
  55. package/dist/{node-cli-sessions-DKaOmVUh.js → .setup/node-cli-sessions-r3avj02l.mjs} +86 -68
  56. package/dist/.setup/node-exec-server.runtime-BDwWXVpK.mjs +247 -0
  57. package/dist/{plan-7uG-Fp36.js → .setup/plan-CN3VwfNU.mjs} +133 -119
  58. package/dist/{plugin-activation-BYQculil.js → .setup/plugin-activation-DT3MNtqj.mjs} +7 -16
  59. package/dist/{plugin-app-cache-key-d0eKxy7b.js → .setup/plugin-app-cache-key-B2CsSdnV.mjs} +32 -44
  60. package/dist/{plugin-approval-roundtrip-Bz3FT8W5.js → .setup/plugin-approval-roundtrip-C0MZzCuP.mjs} +1 -1
  61. package/dist/{plugin-inventory-oL4Na1ZG.js → .setup/plugin-inventory-BoRei8Z4.mjs} +21 -11
  62. package/dist/{plugin-marketplace-discovery-P-Vndfqq.js → .setup/plugin-marketplace-discovery-CDOi8IFs.mjs} +4 -1
  63. package/dist/{plugin-metadata-cache-ClPJpRio.js → .setup/plugin-metadata-cache-Ctmo83k_.mjs} +226 -141
  64. package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
  65. package/dist/{provider-MQ8PVkuE.js → .setup/provider-BOsxQHOM.mjs} +9 -5
  66. package/dist/{provider-capabilities-BvCUL69A.js → .setup/provider-capabilities-BfE88FZ5.mjs} +31 -3
  67. package/dist/{rate-limits-CBMmWBr9.js → .setup/rate-limits-CMU3DUD0.mjs} +174 -151
  68. package/dist/{request-B7hEkBGq.js → .setup/request-D2L0zMrq.mjs} +130 -42
  69. package/dist/{run-attempt-CvsAAGa0.js → .setup/run-attempt-BHu11r7h.mjs} +1628 -966
  70. package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
  71. package/dist/{runtime-artifact-BJ0rXBZ_.js → .setup/runtime-artifact-CLZ8udh-.mjs} +29 -45
  72. package/dist/{sandbox-guard-BxgyoM8M.js → .setup/sandbox-guard-C2sRMOEY.mjs} +3 -3
  73. package/dist/{session-binding-CI8UuilT.js → .setup/session-binding-Cm0apEbd.mjs} +36 -83
  74. package/dist/{session-binding-record-Bcvslnhf.js → .setup/session-binding-record-BGoz8wOK.mjs} +202 -5
  75. package/dist/.setup/session-binding-sidecars-BlB5EvIS.mjs +546 -0
  76. package/dist/.setup/session-catalog-Pno1xGcl.mjs +2764 -0
  77. package/dist/{session-catalog-adoption-tcZi1IfX.js → .setup/session-catalog-adoption-BI6UTDZT.mjs} +58 -26
  78. package/dist/{session-catalog-archive-CwKg8Xz2.js → .setup/session-catalog-archive-lHBqzhaO.mjs} +6 -6
  79. package/dist/.setup/session-catalog-events-Bj6j94E_.mjs +347 -0
  80. package/dist/.setup/session-catalog-index-B9_VQIUz.mjs +1170 -0
  81. package/dist/.setup/session-catalog-index-order-hcdz07yN.mjs +48 -0
  82. package/dist/.setup/session-catalog-index-state-Dgh8ORJm.mjs +183 -0
  83. package/dist/{thread-history-page-D0JIp48V.js → .setup/session-catalog-native-projection-DowriLid.mjs} +223 -95
  84. package/dist/{session-catalog-node-adoption-B1tgDW-m.js → .setup/session-catalog-node-adoption-ITddWx_X.mjs} +25 -13
  85. package/dist/{session-catalog-node-continue-Ci-DXyJP.js → .setup/session-catalog-node-continue-6g6qi4A9.mjs} +24 -15
  86. package/dist/.setup/session-catalog-projection-zK_PUsiE.mjs +422 -0
  87. package/dist/{session-cli-DNN_jhGc.js → .setup/session-cli-irrD-uo7.mjs} +3 -3
  88. package/dist/{session-history-Cz-tOOYj.js → .setup/session-history-BrqhSCf9.mjs} +19 -19
  89. package/dist/{session-history-import-DwyijFI6.js → .setup/session-history-import-D-3wAgOP.mjs} +4 -4
  90. package/dist/{session-history-read-cxPUxyVV.js → .setup/session-history-read-B3ZfSUbF.mjs} +2 -2
  91. package/dist/{session-history.worker-BeK1YOyT.js → .setup/session-history.worker-CaCh0xF_.mjs} +10 -24
  92. package/dist/{session-initialization-Ct0_Hzmg.js → .setup/session-initialization-rcgbZiid.mjs} +2 -2
  93. package/dist/{session-permission-policy-BBmXA8Eg.js → .setup/session-permission-policy-BI1QK_98.mjs} +2 -2
  94. package/dist/{session-retirement-B2YfbAAT.js → .setup/session-retirement-BH-S6qkJ.mjs} +26 -7
  95. package/dist/{settled-turn-context-Du6gdUDd.js → .setup/settled-turn-context-fmwouT5I.mjs} +2 -2
  96. package/dist/{settled-turn-finalizer-Dn91stmc.js → .setup/settled-turn-finalizer-DiAi6Kx6.mjs} +12 -12
  97. package/dist/{shared-client-CscigXXL.js → .setup/shared-client-DA4VR4Eb.mjs} +332 -221
  98. package/dist/{side-question-BGMJQf4U.js → .setup/side-question-BJ1wSDcB.mjs} +183 -230
  99. package/dist/{source-CElXU0Oy.js → .setup/source-CUzJq5WN.mjs} +11 -10
  100. package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
  101. package/dist/{thread-archive-guard-DfpBr-Sz.js → .setup/thread-archive-guard-C9frICzX.mjs} +10 -3
  102. package/dist/.setup/thread-history-page-DoVpnHim.mjs +83 -0
  103. package/dist/{thread-lifecycle-DXl1-I6b.js → .setup/thread-lifecycle-B3mfz1TG.mjs} +347 -2318
  104. package/dist/{thread-ownership-BsDRTsyp.js → .setup/thread-ownership-DcTtAcXj.mjs} +6 -4
  105. package/dist/{thread-policy-BuEQfE0g.js → .setup/thread-policy-DGuQsuFC.mjs} +19 -3
  106. package/dist/.setup/thread-requests-BLvGkP2R.mjs +2205 -0
  107. package/dist/{thread-resume-DsDOZpFg.js → .setup/thread-resume-DIBXwOpE.mjs} +8 -5
  108. package/dist/.setup/timeout-C910MdAB.mjs +80 -0
  109. package/dist/{transcript-history-projection-v17wXgdK.js → .setup/transcript-history-projection-ZZpkFkJ_.mjs} +96 -61
  110. package/dist/{transcript-mirror-C5CKgNy6.js → .setup/transcript-mirror-BtHDBp1G.mjs} +224 -195
  111. package/dist/{transcript-mirror-attestation-DibE0krH.js → .setup/transcript-mirror-attestation-CzM-94NC.mjs} +4 -1
  112. package/dist/{transport-stdio-BGjHoYLr.js → .setup/transport-stdio-h2VHOskC.mjs} +274 -89
  113. package/dist/{upstream-session-fork-BZerMte_.js → .setup/upstream-session-fork-BUr4OUbC.mjs} +51 -42
  114. package/dist/{usage-tCk-mg_x.js → .setup/usage-BML0r-ua.mjs} +5 -4
  115. package/dist/.setup/usage-limit-error-DUMbefVY.mjs +166 -0
  116. package/dist/{web-search-provider.runtime-B7bGbGWq.js → .setup/web-search-provider.runtime-CDKlN-Rv.mjs} +4 -3
  117. package/dist/api.js +23 -12
  118. package/dist/catalog-page-worker-entrypoint.js +12 -0
  119. package/dist/catalog-page.worker.js +9 -0
  120. package/dist/cli-metadata.js +1 -1
  121. package/dist/doctor-contract-api.js +8 -528
  122. package/dist/harness.js +1 -1
  123. package/dist/index.js +306 -215
  124. package/dist/media-understanding-provider.js +3 -3
  125. package/dist/migration-provider-api.js +1 -1
  126. package/dist/native-tool-policy.js +12 -0
  127. package/dist/provider-discovery.js +18 -0
  128. package/dist/session-history-worker-runtime.js +36 -35
  129. package/dist/session-history.worker.js +2 -2
  130. package/dist/web-search-contract-api.js +1 -1
  131. package/openclaw.plugin.json +354 -69
  132. package/package.json +14 -8
  133. package/dist/attempt-context-D44yeDII.js +0 -636
  134. package/dist/binding-connection-D3udKbIE.js +0 -60
  135. package/dist/event-projector-usage-BfXmpOec.js +0 -102
  136. package/dist/inference-proxy-HGXKUIre.js +0 -311
  137. package/dist/launch-args-RXQwn8zV.js +0 -90
  138. package/dist/native-subagent-history-owner-Pcp7JuVF.js +0 -34
  139. package/dist/native-subagent-monitor-fQ7eIXEf.js +0 -2978
  140. package/dist/node-exec-server.runtime-Cl2vapEi.js +0 -226
  141. package/dist/rpc-error-ttN_QjEm.js +0 -30
  142. package/dist/session-catalog-ct-AH01I.js +0 -1477
  143. package/dist/session-catalog-home-id-CwhLdC03.js +0 -18
  144. package/dist/session-catalog-provenance-D-dIfRAH.js +0 -96
  145. package/dist/timeout-BVw8aaM1.js +0 -33
  146. package/dist/version-omm6IPI3.js +0 -12
  147. /package/dist/{auth-profile-selection-DFu9e167.js → .setup/auth-profile-selection-DFu9e167.mjs} +0 -0
  148. /package/dist/{config-utils-DujwEnhg.js → .setup/config-utils-DujwEnhg.mjs} +0 -0
  149. /package/dist/{context-compaction-activity-CMla5FPJ.js → .setup/context-compaction-activity-CMla5FPJ.mjs} +0 -0
  150. /package/dist/{elicitation-input-DPoK8F7w.js → .setup/elicitation-input-DPoK8F7w.mjs} +0 -0
  151. /package/dist/{history-rejection-B4nOXNXF.js → .setup/history-rejection-B4nOXNXF.mjs} +0 -0
  152. /package/dist/{image-payload-sanitizer-tupAr-2o.js → .setup/image-payload-sanitizer-tupAr-2o.mjs} +0 -0
  153. /package/dist/{incognito-session-uhrBF6wJ.js → .setup/incognito-session-uhrBF6wJ.mjs} +0 -0
  154. /package/dist/{local-runtime-attribution-B_2mnqhb.js → .setup/local-runtime-attribution-B_2mnqhb.mjs} +0 -0
  155. /package/dist/{native-execution-policy-umd0tgh4.js → .setup/native-execution-policy-umd0tgh4.mjs} +0 -0
  156. /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
  157. /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
  158. /package/dist/{session-upstream-marker-D15C9NHp.js → .setup/session-upstream-marker-D15C9NHp.mjs} +0 -0
  159. /package/dist/{upstream-prompt-provenance-LphB8slG.js → .setup/upstream-prompt-provenance-LphB8slG.mjs} +0 -0
  160. /package/dist/{web-search-provider.shared-BrZmlqyR.js → .setup/web-search-provider.shared-BrZmlqyR.mjs} +0 -0
@@ -1,12 +1,11 @@
1
- import { n as isCodexFastServiceTier } from "./config-utils-DujwEnhg.js";
2
- import { r as bindingStoreKey } from "./session-binding-record-Bcvslnhf.js";
3
- import { o as formatCodexDisplayText } from "./command-formatters-lxlkNZgU.js";
4
- import "./config-oIORaQ5T.js";
5
- import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-D3udKbIE.js";
6
- import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-CwzO4_RG.js";
7
- import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-CscigXXL.js";
8
- import { D as resolveCodexAppServerRequestModelSelection, k as resolveCodexBindingModelProviderFallback } from "./thread-lifecycle-DXl1-I6b.js";
9
- import "./session-binding-CI8UuilT.js";
1
+ import { n as isCodexFastServiceTier } from "./config-utils-DujwEnhg.mjs";
2
+ import { r as bindingStoreKey } from "./session-binding-record-BGoz8wOK.mjs";
3
+ import { o as formatCodexDisplayText } from "./command-formatters-Bmqvr9tO.mjs";
4
+ import "./config-BoTP_mrL.mjs";
5
+ import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-WqZtZfXN.mjs";
6
+ import { _ as resolveCodexAppServerRequestModelSelection, y as resolveCodexBindingModelProviderFallback } from "./thread-requests-BLvGkP2R.mjs";
7
+ import "./thread-lifecycle-B3mfz1TG.mjs";
8
+ import "./session-binding-Cm0apEbd.mjs";
10
9
  import { resolveAgentDir } from "openclaw/plugin-sdk/agent-runtime";
11
10
  import { getSessionEntry, patchSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
12
11
  import { ModelSelectionLockedError, applyModelOverrideWithAuthProfileCompatibility } from "openclaw/plugin-sdk/model-session-runtime";
@@ -34,35 +33,17 @@ async function stopCodexConversationTurn(params) {
34
33
  stopped: false,
35
34
  message: "No active Codex run to stop."
36
35
  };
37
- const lookup = buildBindingLookup(params);
38
- const binding = params.binding;
39
- if (binding?.threadId !== active.threadId) return {
36
+ if (params.binding?.threadId !== active.threadId) return {
40
37
  stopped: false,
41
38
  message: "The active Codex run no longer matches this session binding."
42
39
  };
43
- const connection = resolveCodexBindingAppServerConnection({
44
- binding,
45
- authProfileId: binding?.authProfileId,
46
- pluginConfig: params.pluginConfig
47
- });
48
- const runtime = connection.appServer;
49
- const client = active.client ?? await getLeasedSharedCodexAppServerClient({
50
- startOptions: runtime.start,
51
- timeoutMs: runtime.requestTimeoutMs,
52
- authProfileId: connection.clientAuthProfileId,
53
- ...lookup
40
+ await active.client.request("turn/interrupt", {
41
+ threadId: active.threadId,
42
+ turnId: active.turnId
43
+ }, {
44
+ timeoutMs: active.requestTimeoutMs,
45
+ assertCurrent: params.assertCurrent
54
46
  });
55
- try {
56
- await client.request("turn/interrupt", {
57
- threadId: active.threadId,
58
- turnId: active.turnId
59
- }, {
60
- timeoutMs: runtime.requestTimeoutMs,
61
- assertCurrent: params.assertCurrent
62
- });
63
- } finally {
64
- if (!active.client) releaseLeasedSharedCodexAppServerClient(client);
65
- }
66
47
  return {
67
48
  stopped: true,
68
49
  message: "Codex stop requested."
@@ -79,50 +60,34 @@ async function steerCodexConversationTurn(params) {
79
60
  steered: false,
80
61
  message: "No active Codex run to steer."
81
62
  };
82
- const lookup = buildBindingLookup(params);
83
- const binding = params.binding;
84
- if (binding?.threadId !== active.threadId) return {
63
+ if (params.binding?.threadId !== active.threadId) return {
85
64
  steered: false,
86
65
  message: "The active Codex run no longer matches this session binding."
87
66
  };
88
- const connection = resolveCodexBindingAppServerConnection({
89
- binding,
90
- authProfileId: binding?.authProfileId,
91
- pluginConfig: params.pluginConfig
92
- });
93
- const runtime = connection.appServer;
94
- const client = active.client ?? await getLeasedSharedCodexAppServerClient({
95
- startOptions: runtime.start,
96
- timeoutMs: runtime.requestTimeoutMs,
97
- authProfileId: connection.clientAuthProfileId,
98
- ...lookup
67
+ await active.client.request("turn/steer", {
68
+ threadId: active.threadId,
69
+ expectedTurnId: active.turnId,
70
+ input: [{
71
+ type: "text",
72
+ text,
73
+ text_elements: []
74
+ }]
75
+ }, {
76
+ timeoutMs: active.requestTimeoutMs,
77
+ assertCurrent: params.assertCurrent
99
78
  });
100
- try {
101
- await client.request("turn/steer", {
102
- threadId: active.threadId,
103
- expectedTurnId: active.turnId,
104
- input: [{
105
- type: "text",
106
- text,
107
- text_elements: []
108
- }]
109
- }, {
110
- timeoutMs: runtime.requestTimeoutMs,
111
- assertCurrent: params.assertCurrent
112
- });
113
- } finally {
114
- if (!active.client) releaseLeasedSharedCodexAppServerClient(client);
115
- }
116
79
  return {
117
80
  steered: true,
118
81
  message: "Sent steer message to Codex."
119
82
  };
120
83
  }
121
- async function setCodexConversationModel(params) {
84
+ async function setCodexConversationModel(input) {
85
+ const params = { ...input };
122
86
  const model = params.model.trim();
123
87
  if (!model) return "Usage: /codex model <model>";
124
88
  const lookup = buildBindingLookup(params);
125
89
  params.assertCurrent();
90
+ const assertCommitAllowed = params.assertCommitAllowed ?? params.assertCurrent;
126
91
  const binding = requirePreparedThreadBinding(params.binding);
127
92
  if (binding.connectionScope === "supervision") throw new ModelSelectionLockedError();
128
93
  const modelProvider = resolveConversationControlModelProvider({
@@ -157,7 +122,7 @@ async function setCodexConversationModel(params) {
157
122
  sessionKey: identity.sessionKey,
158
123
  requireWriteSuccess: true,
159
124
  replaceEntry: true,
160
- assertCommitAllowed: params.assertCurrent,
125
+ assertCommitAllowed,
161
126
  update: (entry) => {
162
127
  if (entry.sessionId !== identity.sessionId) throw new Error("Codex session changed while applying the model selection.");
163
128
  applyModelOverrideWithAuthProfileCompatibility({
@@ -179,7 +144,7 @@ async function setCodexConversationModel(params) {
179
144
  model: nextModel,
180
145
  modelProvider: nextModelProvider,
181
146
  ...projectionPatch
182
- }, params.assertCurrent);
147
+ }, assertCommitAllowed);
183
148
  return `Codex model set to ${formatCodexDisplayText(nextModel)}.`;
184
149
  }
185
150
  async function setCodexConversationFastMode(params) {
@@ -0,0 +1,123 @@
1
+ import { d as readCodexPluginConfig } from "./config-parsing-CcB9iPoq.mjs";
2
+ import { t as attemptTerminal } from "./attempt-terminal-gZrxQ35N.mjs";
3
+ //#region extensions/codex/src/app-server/cyber-failover.ts
4
+ /**
5
+ * Automatic Daybreak escalation for OpenAI cyber-policy refusals.
6
+ *
7
+ * OpenAI refuses some defensive-cyber work on its general models and directs
8
+ * approved workspaces to a Daybreak model instead. When a turn is refused, the
9
+ * harness retries it once on the configured Daybreak model so the refused work
10
+ * reaches the tier allowed to answer it. Only a refused turn is ever routed
11
+ * there, and the retry never changes the session's stored model selection.
12
+ *
13
+ * Authorization stays server-owned. `model/list` advertises Daybreak to every
14
+ * client, but an unentitled workspace still gets 401/403 on use, and each such
15
+ * attempt costs the transport's full five-try reconnect ladder. Entitlement is
16
+ * therefore only ever observed from an actual attempt, and a failure is
17
+ * remembered per workspace so siblings do not each pay for it.
18
+ */
19
+ const DEFAULT_CYBER_FAILOVER = {
20
+ mode: "auto",
21
+ model: "gpt-daybreak-blue-latest",
22
+ cooloffMs: 6e5
23
+ };
24
+ function resolveCodexCyberFailoverConfig(pluginConfig) {
25
+ const configured = readCodexPluginConfig(pluginConfig).appServer?.cyberFailover;
26
+ if (!configured) return DEFAULT_CYBER_FAILOVER;
27
+ return {
28
+ mode: configured.mode ?? DEFAULT_CYBER_FAILOVER.mode,
29
+ model: configured.model ?? DEFAULT_CYBER_FAILOVER.model,
30
+ cooloffMs: configured.cooloffMs ?? DEFAULT_CYBER_FAILOVER.cooloffMs
31
+ };
32
+ }
33
+ const unavailableTargets = /* @__PURE__ */ new Map();
34
+ const MAX_UNAVAILABLE_TARGETS = 256;
35
+ const inFlightProbes = /* @__PURE__ */ new Set();
36
+ function targetKey(model, workspace) {
37
+ const normalized = model.trim().toLowerCase();
38
+ const slashIndex = normalized.lastIndexOf("/");
39
+ return [
40
+ workspace?.agentId?.trim().toLowerCase() ?? "",
41
+ workspace?.authProfileId?.trim().toLowerCase() ?? "",
42
+ slashIndex >= 0 ? normalized.slice(slashIndex + 1) : normalized
43
+ ].join("\0");
44
+ }
45
+ /** Marks a workspace/target probe in flight; the returned handle releases it. */
46
+ function reserveCodexCyberProbe(params) {
47
+ const key = targetKey(params.model, params.workspace);
48
+ inFlightProbes.add(key);
49
+ return () => {
50
+ inFlightProbes.delete(key);
51
+ };
52
+ }
53
+ /** Remembers that this workspace cannot use the target for `cooloffMs`. */
54
+ function recordCodexCyberTargetUnavailable(params) {
55
+ if (params.cooloffMs <= 0) return;
56
+ const now = params.now ?? Date.now();
57
+ for (const [key, expiresAt] of unavailableTargets) if (expiresAt <= now) unavailableTargets.delete(key);
58
+ while (unavailableTargets.size >= MAX_UNAVAILABLE_TARGETS) {
59
+ const oldest = unavailableTargets.keys().next();
60
+ if (oldest.done) break;
61
+ unavailableTargets.delete(oldest.value);
62
+ }
63
+ unavailableTargets.set(targetKey(params.model, params.workspace), now + params.cooloffMs);
64
+ }
65
+ /** Decides whether a refused turn may be retried on Daybreak. */
66
+ function planCodexCyberEscalation(params) {
67
+ const { config } = params;
68
+ if (config.mode !== "auto") return {
69
+ kind: "skip",
70
+ reason: "disabled"
71
+ };
72
+ if (!params.replaySafe) return {
73
+ kind: "skip",
74
+ reason: "not_replay_safe"
75
+ };
76
+ if (!config.model.trim()) return {
77
+ kind: "skip",
78
+ reason: "no_target"
79
+ };
80
+ const key = targetKey(config.model, params.workspace);
81
+ if (params.currentModel && targetKey(params.currentModel, params.workspace) === key) return {
82
+ kind: "skip",
83
+ reason: "already_daybreak"
84
+ };
85
+ const now = params.now ?? Date.now();
86
+ const expiresAt = unavailableTargets.get(key);
87
+ if (expiresAt !== void 0 && expiresAt <= now) unavailableTargets.delete(key);
88
+ else if (expiresAt !== void 0) return {
89
+ kind: "skip",
90
+ reason: "target_unavailable"
91
+ };
92
+ if (inFlightProbes.has(key)) return {
93
+ kind: "skip",
94
+ reason: "probe_in_flight"
95
+ };
96
+ return {
97
+ kind: "escalate",
98
+ model: config.model
99
+ };
100
+ }
101
+ const AUTHORIZATION_FAILURE_RE = /\b(401|403)\b|unauthorized|not authorized|forbidden/i;
102
+ /** Everything the escalation decision needs from one attempt outcome. */
103
+ function readCodexCyberAttemptVerdict(result) {
104
+ const message = result?.currentAttemptAssistant;
105
+ const refusals = message?.role === "assistant" ? message.diagnostics ?? [] : [];
106
+ const cyberRefused = result?.terminal.kind === "ok" && refusals.some((d) => d.type === "provider_refusal" && d.details?.category === "cyber" && d.details?.provider === "openai");
107
+ const promptError = result ? attemptTerminal.project(result.terminal).promptError : void 0;
108
+ const answered = !(promptError !== void 0 && promptError !== null) && message?.role === "assistant" && !refusals.some((d) => d.type === "provider_refusal") && message.stopReason !== "error" && message.stopReason !== "aborted";
109
+ const errorTexts = [
110
+ typeof promptError === "string" ? promptError : void 0,
111
+ promptError instanceof Error ? promptError.message : void 0,
112
+ result?.lastAssistant?.errorMessage,
113
+ message?.errorMessage
114
+ ];
115
+ return {
116
+ cyberRefused,
117
+ replaySafe: result?.replayMetadata?.replaySafe === true && result.runtimeContinuationStarted !== true,
118
+ answered,
119
+ unavailable: errorTexts.some((t) => t !== void 0 && AUTHORIZATION_FAILURE_RE.test(t))
120
+ };
121
+ }
122
+ //#endregion
123
+ export { planCodexCyberEscalation, readCodexCyberAttemptVerdict, recordCodexCyberTargetUnavailable, reserveCodexCyberProbe, resolveCodexCyberFailoverConfig };
@@ -0,0 +1,17 @@
1
+ import { t as emitCodexAppServerEvent } from "./run-attempt-lifecycle-B7JbY4-F.mjs";
2
+ //#region extensions/codex/src/app-server/cyber-failover-notice.ts
3
+ async function emitCodexCyberNotice(params, notice) {
4
+ await emitCodexAppServerEvent(params, {
5
+ stream: "notice",
6
+ data: {
7
+ phase: "provider_policy",
8
+ category: "cyber",
9
+ state: notice.state,
10
+ provider: "openai",
11
+ ...notice.model ? { model: notice.model } : {},
12
+ fallbackModel: notice.fallbackModel
13
+ }
14
+ });
15
+ }
16
+ //#endregion
17
+ export { emitCodexCyberNotice };