@openclaw/codex 2026.9.3 → 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.
- package/assets/activity.svg +30 -0
- package/assets/icon.png +0 -0
- package/dist/.setup/account-usage-runtime-C2MOIvfq.mjs +75 -0
- package/dist/{apply-B6el6hdO.js → .setup/apply-CJ0ZfmBG.mjs} +12 -13
- package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
- package/dist/{attempt-client-cleanup-D6cR54TV.js → .setup/attempt-client-cleanup-BpYKdTA0.mjs} +30 -211
- package/dist/{attempt-context-AO4DSjE0.js → .setup/attempt-context-VXVwTCfS.mjs} +6 -6
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
- package/dist/{auth-binding-Co2Vfcf_.js → .setup/auth-binding-DhLWa_7K.mjs} +2 -2
- package/dist/{auth-cache-key-Kq6oerr6.js → .setup/auth-cache-key-QirmgiCo.mjs} +3 -3
- package/dist/{auth-profile-CwzO4_RG.js → .setup/auth-profile-WqZtZfXN.mjs} +1 -1
- package/dist/.setup/binding-connection-Bm38niE8.mjs +50 -0
- package/dist/.setup/binding-connection.runtime-CnRMC0ta.mjs +48 -0
- package/dist/{bounded-turn-lRpmZHFv.js → .setup/bounded-turn-BtlZcivC.mjs} +19 -14
- package/dist/{build-state-6RL6qohz.js → .setup/build-state-Xx9ybZqa.mjs} +1 -1
- package/dist/{capabilities-BeqLPbtM.js → .setup/capabilities-_vXcZGSx.mjs} +1 -1
- package/dist/{client-BEKu4yDx.js → .setup/client-vXs2929Q.mjs} +355 -164
- package/dist/{command-dispatch-CisT9Jqq.js → .setup/command-dispatch-naHIZwwF.mjs} +3 -3
- package/dist/{command-formatters-DeTfrapr.js → .setup/command-formatters-CGEkdawF.mjs} +4 -3
- package/dist/{command-handlers-BfIsJEuA.js → .setup/command-handlers-BtAJEW1X.mjs} +812 -152
- package/dist/{command-rpc-BMqRQOFX.js → .setup/command-rpc-DHFpn4le.mjs} +37 -21
- package/dist/{compact-CGJZ2rlb.js → .setup/compact-C3i3qlzj.mjs} +28 -43
- package/dist/{config-JDfTI4VI.js → .setup/config-CedDWjM-.mjs} +5 -4
- package/dist/{config-options-jnIFvwxD.js → .setup/config-options-BsanJ8QG.mjs} +9 -421
- package/dist/{protocol-CAAcVIKF.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
- package/dist/{config-runtime-BWf6JLWG.js → .setup/config-runtime-CeAhl_h4.mjs} +2 -2
- package/dist/.setup/config-security-BRQ2mgW9.mjs +465 -0
- package/dist/{config-utils-C57JiJrU.js → .setup/config-utils-DujwEnhg.mjs} +2 -4
- package/dist/{conversation-binding-CxOlHiix.js → .setup/conversation-binding-DhzrpTM6.mjs} +60 -47
- package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
- package/dist/{conversation-control-CUCrSIQI.js → .setup/conversation-control-DN53ns41.mjs} +17 -13
- package/dist/.setup/cyber-failover-DYwbmf1o.mjs +123 -0
- package/dist/.setup/cyber-failover-notice-e9G3J9-e.mjs +17 -0
- package/dist/{dynamic-tools-D-JBoaLt.js → .setup/dynamic-tools-D16lOp67.mjs} +168 -61
- package/dist/{effective-mcp-catalog-J_5Ep5Um.js → .setup/effective-mcp-catalog-K6kLCN8X.mjs} +3 -3
- package/dist/{ephemeral-turn-DSwzP8YY.js → .setup/ephemeral-turn-R1gA8Sn6.mjs} +4 -5
- package/dist/{event-projector-assistant-message-BmBM4qBV.js → .setup/event-projector-assistant-message-DNUR1s0A.mjs} +6 -3
- package/dist/.setup/event-projector-items-DyTQ_XqL.mjs +200 -0
- package/dist/{attempt-notifications--H8zXR5-.js → .setup/event-projector-usage-C7Ntzs-f.mjs} +102 -9
- package/dist/{harness-FR6eQgyO.js → .setup/harness-rxaaoN-o.mjs} +90 -19
- package/dist/.setup/inference-context-fulhZuz8.mjs +94 -0
- package/dist/.setup/inference-proxy-CC15HuSi.mjs +311 -0
- package/dist/{isolated-completion-DHBefrzg.js → .setup/isolated-completion-B6srt48J.mjs} +7 -7
- package/dist/{launch-args-RXQwn8zV.js → .setup/launch-args-DnMak49W.mjs} +22 -1
- package/dist/{managed-binary-DrjjRRUD.js → .setup/managed-binary-DP6Rib3P.mjs} +11 -2
- package/dist/{managed-thread-store-D1t5jh3G.js → .setup/managed-thread-store-BMqgThVL.mjs} +48 -14
- package/dist/{model-catalog-B_6M04Wo.js → .setup/model-catalog-DkvUuBey.mjs} +35 -10
- package/dist/{models-P9k2qAof.js → .setup/models-BDFgm_G-.mjs} +3 -3
- package/dist/.setup/native-auth-BLZGqFjw.mjs +57 -0
- package/dist/.setup/native-subagent-history-YXaL6dMd.mjs +135 -0
- package/dist/.setup/native-subagent-monitor-B1hxzIOy.mjs +5031 -0
- package/dist/.setup/native-subagent-task-ids-DsuOonKv.mjs +411 -0
- package/dist/{node-cli-sessions-rj0ysJwM.js → .setup/node-cli-sessions-Cl8b2ZF3.mjs} +1 -1
- package/dist/{node-exec-server.runtime-BY_ctYnT.js → .setup/node-exec-server.runtime-BaViBKNz.mjs} +5 -5
- package/dist/{plan-BMJdMOEF.js → .setup/plan-xD7WKYTM.mjs} +331 -79
- package/dist/{plugin-activation-BQK-f5sV.js → .setup/plugin-activation-r8nq5Jzp.mjs} +24 -19
- package/dist/{plugin-app-cache-key-CdSQzWyX.js → .setup/plugin-app-cache-key-BOxKP7db.mjs} +29 -25
- package/dist/{plugin-approval-roundtrip-DeW95wB5.js → .setup/plugin-approval-roundtrip-CjfzafAZ.mjs} +1 -1
- package/dist/{plugin-inventory-CoRCzWW4.js → .setup/plugin-inventory-DUle8DLz.mjs} +12 -8
- package/dist/{plugin-marketplace-discovery-3akBizzF.js → .setup/plugin-marketplace-discovery-P-Vndfqq.mjs} +18 -15
- package/dist/{plugin-metadata-cache-DgNfRAGA.js → .setup/plugin-metadata-cache-DsS5buNa.mjs} +33 -14
- package/dist/{provider-capabilities-W4tfK5Y5.js → .setup/provider-capabilities-B8J4Dy-O.mjs} +2 -2
- package/dist/.setup/provider-fFh_-VR3.mjs +50 -0
- package/dist/{rate-limits-Bqnx1N4z.js → .setup/rate-limits-DOEGYRNs.mjs} +90 -46
- package/dist/.setup/request-BioXJLYa.mjs +292 -0
- package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
- package/dist/{run-attempt-DwKds3DN.js → .setup/run-attempt-rlA07pUv.mjs} +644 -491
- package/dist/{runtime-artifact-T-NwqeSH.js → .setup/runtime-artifact-Dy38Z5iU.mjs} +2 -2
- package/dist/{sandbox-guard-BcT66fWy.js → .setup/sandbox-guard-BBP-RbTf.mjs} +4 -3
- package/dist/{session-binding-CKSepwIC.js → .setup/session-binding-_0W_fHRr.mjs} +45 -63
- package/dist/{session-binding-record-CaZjYwNS.js → .setup/session-binding-record-TH3xA0zj.mjs} +181 -3
- package/dist/.setup/session-binding-sidecars-CKYEcfNn.mjs +543 -0
- package/dist/{session-catalog-adoption-BKLtSrwi.js → .setup/session-catalog-adoption-CR_whkEW.mjs} +6 -6
- package/dist/{session-catalog-archive-D0i2pGj2.js → .setup/session-catalog-archive-CwZaPacf.mjs} +6 -6
- package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +250 -0
- package/dist/.setup/session-catalog-fUdWDx-U.mjs +2464 -0
- package/dist/.setup/session-catalog-index-B141u15s.mjs +1070 -0
- package/dist/.setup/session-catalog-index-order-Cc5BzlQr.mjs +48 -0
- package/dist/.setup/session-catalog-index-state-BAuDztHN.mjs +180 -0
- package/dist/{session-catalog-parsing-CdD3JhdM.js → .setup/session-catalog-native-projection-ChV3cCtm.mjs} +213 -21
- package/dist/{session-catalog-node-adoption-BUuDYY8R.js → .setup/session-catalog-node-adoption-BVRsYOSh.mjs} +3 -3
- package/dist/{session-catalog-node-continue-CBtc4wkI.js → .setup/session-catalog-node-continue-Dowv8osw.mjs} +7 -7
- package/dist/.setup/session-catalog-projection-C1Bj9Jl-.mjs +414 -0
- package/dist/{session-cli-CbgaHh0f.js → .setup/session-cli-DIj-IE-E.mjs} +4 -4
- package/dist/{session-history-Cz-tOOYj.js → .setup/session-history-C--SrLI8.mjs} +10 -5
- package/dist/{session-history-import-DFN7sWRU.js → .setup/session-history-import-JHXT5Xfi.mjs} +4 -4
- package/dist/{session-history-read-cxPUxyVV.js → .setup/session-history-read-B3ZfSUbF.mjs} +2 -2
- package/dist/{session-history.worker-CNEvGaU5.js → .setup/session-history.worker-CpNj7H_P.mjs} +192 -89
- package/dist/{session-initialization-Jo86C60I.js → .setup/session-initialization-DH1z6fXn.mjs} +2 -2
- package/dist/{session-permission-policy-B22InTp_.js → .setup/session-permission-policy-DhurXY0l.mjs} +2 -2
- package/dist/{session-retirement-BSNG_mhf.js → .setup/session-retirement-CU87AOg9.mjs} +6 -6
- package/dist/{settled-turn-context-Du6gdUDd.js → .setup/settled-turn-context-fmwouT5I.mjs} +2 -2
- package/dist/{settled-turn-finalizer-BuLUrZl2.js → .setup/settled-turn-finalizer-CiY2bLFK.mjs} +10 -10
- package/dist/{shared-client-CVhez2Uo.js → .setup/shared-client-BpTtuLQ5.mjs} +495 -156
- package/dist/{side-question-DLbr2vUU.js → .setup/side-question-DSCZyoBD.mjs} +64 -47
- package/dist/{source-Da-h6f7e.js → .setup/source-Bjp4UQij.mjs} +15 -14
- package/dist/{thread-archive-guard-D1bP04Tf.js → .setup/thread-archive-guard-jmecf6OJ.mjs} +1 -1
- package/dist/.setup/thread-history-page-BTx-4xsg.mjs +83 -0
- package/dist/{thread-lifecycle-D1pzRwHB.js → .setup/thread-lifecycle-Cik28qWn.mjs} +330 -150
- package/dist/{thread-ownership-D6oASVRu.js → .setup/thread-ownership-skomxnIt.mjs} +4 -4
- package/dist/{thread-policy-D8kI7yAO.js → .setup/thread-policy-Cjs4B8xf.mjs} +3 -3
- package/dist/{thread-resume-T5cveyxA.js → .setup/thread-resume-BkNpj9Pz.mjs} +8 -5
- package/dist/.setup/timeout-DZF05XrR.mjs +63 -0
- package/dist/{session-catalog-home-id-D7-aLiNt.js → .setup/transcript-history-projection-DHNBDhCU.mjs} +73 -20
- package/dist/{transcript-mirror-t5TOccct.js → .setup/transcript-mirror-D4qp_leP.mjs} +15 -6
- package/dist/{transcript-mirror-attestation-DibE0krH.js → .setup/transcript-mirror-attestation-CzM-94NC.mjs} +4 -1
- package/dist/{transport-stdio-BGjHoYLr.js → .setup/transport-stdio-Cmx94Oiy.mjs} +149 -44
- package/dist/{upstream-session-fork-De-sLJ2r.js → .setup/upstream-session-fork-D3UKxgVD.mjs} +27 -26
- package/dist/{usage-CPPTmBvZ.js → .setup/usage-BOgBEKso.mjs} +4 -4
- package/dist/.setup/usage-limit-error-C0ow7DOc.mjs +166 -0
- package/dist/{version-omm6IPI3.js → .setup/version-CoqzXPgK.mjs} +1 -1
- package/dist/{web-search-provider.runtime-CSVgQL0w.js → .setup/web-search-provider.runtime-CTGuJt6i.mjs} +3 -3
- package/dist/api.js +28 -20
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +8 -528
- package/dist/harness.js +1 -1
- package/dist/index.js +130 -135
- package/dist/media-understanding-provider.js +3 -3
- package/dist/migration-provider-api.js +2 -0
- package/dist/native-tool-policy.js +12 -0
- package/dist/provider-discovery.js +18 -0
- package/dist/session-history-worker-runtime.js +23 -5
- package/dist/session-history.worker.js +2 -2
- package/dist/web-search-contract-api.js +1 -1
- package/openclaw.plugin.json +354 -68
- package/package.json +11 -8
- package/dist/binding-connection-QqgcPCgk.js +0 -60
- package/dist/event-projector-usage-CIyrYYid.js +0 -102
- package/dist/native-subagent-monitor-BbCUKRwC.js +0 -3350
- package/dist/request-CGvGOpeR.js +0 -198
- package/dist/session-catalog-HaDcp7Sv.js +0 -1533
- package/dist/session-catalog-provenance-DkJHo735.js +0 -124
- package/dist/timeout-BVw8aaM1.js +0 -33
- package/dist/{auth-profile-selection-DFu9e167.js → .setup/auth-profile-selection-DFu9e167.mjs} +0 -0
- package/dist/{context-compaction-activity-CMla5FPJ.js → .setup/context-compaction-activity-CMla5FPJ.mjs} +0 -0
- package/dist/{elicitation-input-DPoK8F7w.js → .setup/elicitation-input-DPoK8F7w.mjs} +0 -0
- package/dist/{history-rejection-B4nOXNXF.js → .setup/history-rejection-B4nOXNXF.mjs} +0 -0
- package/dist/{image-payload-sanitizer-tupAr-2o.js → .setup/image-payload-sanitizer-tupAr-2o.mjs} +0 -0
- package/dist/{incognito-session-uhrBF6wJ.js → .setup/incognito-session-uhrBF6wJ.mjs} +0 -0
- package/dist/{local-runtime-attribution-B_2mnqhb.js → .setup/local-runtime-attribution-B_2mnqhb.mjs} +0 -0
- package/dist/{native-execution-policy-umd0tgh4.js → .setup/native-execution-policy-YBMHSzC4.mjs} +1 -1
- /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
- /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
- /package/dist/{session-upstream-marker-D15C9NHp.js → .setup/session-upstream-marker-D15C9NHp.mjs} +0 -0
- /package/dist/{upstream-prompt-provenance-LphB8slG.js → .setup/upstream-prompt-provenance-LphB8slG.mjs} +0 -0
- /package/dist/{web-search-provider.shared-BrZmlqyR.js → .setup/web-search-provider.shared-BrZmlqyR.mjs} +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { _ as assertCodexThreadAcceptsDirectInput, b as assertCodexThreadStartResponse, l as isCodexAppServerOverloadError, m as CodexThreadDirectInputError, s as isCodexAppServerIndeterminateRequestCancellationError } from "./client-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
8
|
-
import { n as
|
|
9
|
-
import { n as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import "./session-binding-
|
|
15
|
-
import { t as resumeCodexAppServerThread } from "./thread-resume-
|
|
16
|
-
import { a as rollbackCodexAppServerBindingSubscription, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, s as withExclusiveCodexAppServerThread, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-
|
|
17
|
-
import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-
|
|
18
|
-
import { u as trackCodexConversationActiveTurn } from "./conversation-control-
|
|
1
|
+
import { n as assertCodexBindingMayBeReplaced, p as sessionBindingIdentity } from "./session-binding-record-TH3xA0zj.mjs";
|
|
2
|
+
import { E as readCodexRequirementsToml, m as isJsonObject } from "./config-security-BRQ2mgW9.mjs";
|
|
3
|
+
import { d as readCodexPluginConfig } from "./config-parsing-CcB9iPoq.mjs";
|
|
4
|
+
import { _ as assertCodexThreadAcceptsDirectInput, b as assertCodexThreadStartResponse, l as isCodexAppServerOverloadError, m as CodexThreadDirectInputError, s as isCodexAppServerIndeterminateRequestCancellationError } from "./client-vXs2929Q.mjs";
|
|
5
|
+
import { d as readCodexEffectiveConfig, n as codexSandboxPolicyForTurn } from "./config-options-BsanJ8QG.mjs";
|
|
6
|
+
import { o as resolveCodexDefaultWorkspaceDir } from "./conversation-binding-data-CrcyZk6O.mjs";
|
|
7
|
+
import { n as projectBoundedCodexVisibleSessionHistory } from "./transcript-history-projection-DHNBDhCU.mjs";
|
|
8
|
+
import { n as resolveOpenClawExecPolicyForCodexAppServer, t as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-CedDWjM-.mjs";
|
|
9
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-CeAhl_h4.mjs";
|
|
10
|
+
import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-WqZtZfXN.mjs";
|
|
11
|
+
import { I as hasCodexAppServerLiveThread, N as consumeCodexAppServerLiveThread, R as isCodexAppServerClientRuntimeLive, U as releaseCodexAppServerLiveThread, _ as retainSharedCodexAppServerClientByInstanceId, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, x as withLeasedCodexAppServerClientStartSelectionRetry, z as isCodexAppServerLiveThreadClaimed } from "./shared-client-BpTtuLQ5.mjs";
|
|
12
|
+
import { a as closeCodexStartupClientBestEffort, f as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, m as getCodexAppServerTurnRouter, o as interruptCodexTurnAndWaitBestEffort, s as isCodexAppServerUnsafeSubscriptionError, v as isCodexNotificationForTurn } from "./attempt-client-cleanup-BpYKdTA0.mjs";
|
|
13
|
+
import { Dt as buildDisabledAppsConfigPatch, E as CODEX_NATIVE_PERSONALITY_NONE, N as buildCodexProjectDocThreadConfig, O as resolveCodexAppServerRequestModelSelection, Ot as mergeCodexThreadConfigs } from "./thread-lifecycle-Cik28qWn.mjs";
|
|
14
|
+
import "./session-binding-_0W_fHRr.mjs";
|
|
15
|
+
import { t as resumeCodexAppServerThread } from "./thread-resume-BkNpj9Pz.mjs";
|
|
16
|
+
import { a as rollbackCodexAppServerBindingSubscription, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, s as withExclusiveCodexAppServerThread, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-skomxnIt.mjs";
|
|
17
|
+
import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-DhurXY0l.mjs";
|
|
18
|
+
import { u as trackCodexConversationActiveTurn } from "./conversation-control-DN53ns41.mjs";
|
|
19
19
|
import { asOptionalRecord, normalizeOptionalString, normalizeSingleOrTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
20
20
|
import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
21
21
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -157,7 +157,7 @@ async function resolveThreadBindingRuntime(params) {
|
|
|
157
157
|
clientOptions
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
function buildConversationThreadRequest(resolved, serviceTier) {
|
|
160
|
+
function buildConversationThreadRequest(resolved, serviceTier, effectiveNativeConfig) {
|
|
161
161
|
return {
|
|
162
162
|
cwd: resolved.workspaceDir,
|
|
163
163
|
...resolved.model ? { model: resolved.model } : {},
|
|
@@ -166,13 +166,18 @@ function buildConversationThreadRequest(resolved, serviceTier) {
|
|
|
166
166
|
approvalPolicy: resolved.runtime.approvalPolicy,
|
|
167
167
|
approvalsReviewer: resolved.runtime.approvalsReviewer,
|
|
168
168
|
...resolved.runtime.sessionRoot ? { runtimeWorkspaceRoots: [resolved.runtime.sessionRoot] } : {},
|
|
169
|
-
...codexConversationSandboxOrPermissions(resolved.runtime, resolved.runtime.sandbox),
|
|
169
|
+
...codexConversationSandboxOrPermissions(resolved.runtime, resolved.runtime.sandbox, effectiveNativeConfig),
|
|
170
170
|
...serviceTier ? { serviceTier } : {}
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
async function buildConversationThreadRequestForClient(client, resolved, serviceTier, requestOptions) {
|
|
174
|
+
const effectiveConfig = await readCodexEffectiveConfig(client, resolved.workspaceDir, requestOptions());
|
|
175
|
+
requestOptions();
|
|
176
|
+
return buildConversationThreadRequest(resolved, serviceTier, effectiveConfig);
|
|
177
|
+
}
|
|
178
|
+
function codexConversationSandboxOrPermissions(runtime, sandbox, effectiveNativeConfig) {
|
|
174
179
|
const networkProxy = runtime.networkProxy;
|
|
175
|
-
const config = buildCodexProjectDocThreadConfig(mergeCodexThreadConfigs(networkProxy?.configPatch, buildDisabledAppsConfigPatch()));
|
|
180
|
+
const config = buildCodexProjectDocThreadConfig(mergeCodexThreadConfigs(networkProxy?.configPatch, buildDisabledAppsConfigPatch()), effectiveNativeConfig);
|
|
176
181
|
return networkProxy ? { config } : {
|
|
177
182
|
sandbox,
|
|
178
183
|
config
|
|
@@ -233,7 +238,7 @@ async function bindThread(params, threadId) {
|
|
|
233
238
|
lease: clientLease,
|
|
234
239
|
options: resolved.clientOptions,
|
|
235
240
|
run: async (client, requestOptions) => {
|
|
236
|
-
const request =
|
|
241
|
+
const request = await buildConversationThreadRequestForClient(client, resolved, params.serviceTier ?? resolved.runtime.serviceTier, requestOptions);
|
|
237
242
|
let response;
|
|
238
243
|
if (threadId && !resolved.runtime.networkProxy) {
|
|
239
244
|
if (isCodexAppServerLiveThreadClaimed(client, threadId)) throw new Error(`Codex thread ${threadId} has an active run; stop it before binding its conversation.`);
|
|
@@ -457,8 +462,7 @@ function createCodexConversationTurnCollector(threadId) {
|
|
|
457
462
|
if (item?.type === "agentMessage") {
|
|
458
463
|
const itemId = normalizeOptionalString(item.id) ?? normalizeOptionalString(params.itemId) ?? "assistant";
|
|
459
464
|
assistantTextByItem.delete(itemId);
|
|
460
|
-
|
|
461
|
-
const text = readTextString(item, "text");
|
|
465
|
+
const text = readAssistantReplyText(item);
|
|
462
466
|
if (text?.trim()) assistantTextByItem.set(itemId, text);
|
|
463
467
|
}
|
|
464
468
|
return;
|
|
@@ -475,7 +479,7 @@ function createCodexConversationTurnCollector(threadId) {
|
|
|
475
479
|
if (!isJsonObject(item) || item.type !== "agentMessage") continue;
|
|
476
480
|
const itemId = normalizeOptionalString(item.id) ?? `assistant-${assistantTextByItem.size + 1}`;
|
|
477
481
|
assistantTextByItem.delete(itemId);
|
|
478
|
-
const text =
|
|
482
|
+
const text = readAssistantReplyText(item);
|
|
479
483
|
if (text?.trim()) assistantTextByItem.set(itemId, text);
|
|
480
484
|
}
|
|
481
485
|
}
|
|
@@ -502,6 +506,9 @@ function createCodexConversationTurnCollector(threadId) {
|
|
|
502
506
|
}
|
|
503
507
|
};
|
|
504
508
|
}
|
|
509
|
+
function readAssistantReplyText(item) {
|
|
510
|
+
return item.phase === "commentary" || item.delivery === "async" ? void 0 : readTextString(item, "text");
|
|
511
|
+
}
|
|
505
512
|
function readTextString(record, key) {
|
|
506
513
|
const value = record?.[key];
|
|
507
514
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
@@ -682,12 +689,15 @@ async function runBoundTurn(params) {
|
|
|
682
689
|
const response = assertCodexThreadStartResponse(await withLeasedCodexAppServerClientStartSelectionRetry({
|
|
683
690
|
lease: clientLease,
|
|
684
691
|
options: clientOptions,
|
|
685
|
-
run: async (requestClient, requestOptions) =>
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
692
|
+
run: async (requestClient, requestOptions) => {
|
|
693
|
+
const threadRequest = await buildConversationThreadRequestForClient(requestClient, threadRequestRuntime, serviceTier, requestOptions);
|
|
694
|
+
return await requestClient.request("thread/start", {
|
|
695
|
+
...threadRequest,
|
|
696
|
+
developerInstructions: CODEX_CONVERSATION_THREAD_DEVELOPER_INSTRUCTIONS,
|
|
697
|
+
experimentalRawEvents: true,
|
|
698
|
+
...params.incognito ? { ephemeral: true } : {}
|
|
699
|
+
}, requestOptions());
|
|
700
|
+
},
|
|
691
701
|
onClientChange: (nextClient) => {
|
|
692
702
|
client = nextClient;
|
|
693
703
|
}
|
|
@@ -733,21 +743,24 @@ async function runBoundTurn(params) {
|
|
|
733
743
|
const response = await withLeasedCodexAppServerClientStartSelectionRetry({
|
|
734
744
|
lease: clientLease,
|
|
735
745
|
options: clientOptions,
|
|
736
|
-
run: async (requestClient, requestOptions) =>
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
746
|
+
run: async (requestClient, requestOptions) => {
|
|
747
|
+
const threadRequest = await buildConversationThreadRequestForClient(requestClient, threadRequestRuntime, serviceTier, requestOptions);
|
|
748
|
+
return await resumeCodexAppServerThread({
|
|
749
|
+
client: requestClient,
|
|
750
|
+
onSubscriptionReleased: () => {
|
|
751
|
+
isolatedSubscriptionClient = requestClient;
|
|
752
|
+
},
|
|
753
|
+
abandonClient: async () => {
|
|
754
|
+
await closeCodexStartupClientBestEffort(requestClient);
|
|
755
|
+
isolatedSubscriptionClient = requestClient;
|
|
756
|
+
},
|
|
757
|
+
request: {
|
|
758
|
+
threadId,
|
|
759
|
+
...threadRequest
|
|
760
|
+
},
|
|
761
|
+
requestResume: (request) => requestClient.request("thread/resume", request, requestOptions())
|
|
762
|
+
});
|
|
763
|
+
},
|
|
751
764
|
onClientChange: (nextClient) => {
|
|
752
765
|
client = nextClient;
|
|
753
766
|
}
|
package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
2
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import process from "node:process";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { n as isCodexFastServiceTier } from "./config-utils-
|
|
2
|
-
import { r as bindingStoreKey } from "./session-binding-record-
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-
|
|
7
|
-
import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-
|
|
8
|
-
import {
|
|
9
|
-
import "./session-binding-
|
|
1
|
+
import { n as isCodexFastServiceTier } from "./config-utils-DujwEnhg.mjs";
|
|
2
|
+
import { r as bindingStoreKey } from "./session-binding-record-TH3xA0zj.mjs";
|
|
3
|
+
import { o as formatCodexDisplayText } from "./command-formatters-CGEkdawF.mjs";
|
|
4
|
+
import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-Bm38niE8.mjs";
|
|
5
|
+
import "./config-CedDWjM-.mjs";
|
|
6
|
+
import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-WqZtZfXN.mjs";
|
|
7
|
+
import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-BpTtuLQ5.mjs";
|
|
8
|
+
import { A as resolveCodexBindingModelProviderFallback, O as resolveCodexAppServerRequestModelSelection } from "./thread-lifecycle-Cik28qWn.mjs";
|
|
9
|
+
import "./session-binding-_0W_fHRr.mjs";
|
|
10
10
|
import { resolveAgentDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
11
11
|
import { getSessionEntry, patchSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
12
12
|
import { ModelSelectionLockedError, applyModelOverrideWithAuthProfileCompatibility } from "openclaw/plugin-sdk/model-session-runtime";
|
|
@@ -40,10 +40,12 @@ async function stopCodexConversationTurn(params) {
|
|
|
40
40
|
stopped: false,
|
|
41
41
|
message: "The active Codex run no longer matches this session binding."
|
|
42
42
|
};
|
|
43
|
-
const connection = resolveCodexBindingAppServerConnection({
|
|
43
|
+
const connection = await resolveCodexBindingAppServerConnection({
|
|
44
44
|
binding,
|
|
45
45
|
authProfileId: binding?.authProfileId,
|
|
46
|
-
pluginConfig: params.pluginConfig
|
|
46
|
+
pluginConfig: params.pluginConfig,
|
|
47
|
+
...lookup,
|
|
48
|
+
assertCurrent: params.assertCurrent
|
|
47
49
|
});
|
|
48
50
|
const runtime = connection.appServer;
|
|
49
51
|
const client = active.client ?? await getLeasedSharedCodexAppServerClient({
|
|
@@ -85,10 +87,12 @@ async function steerCodexConversationTurn(params) {
|
|
|
85
87
|
steered: false,
|
|
86
88
|
message: "The active Codex run no longer matches this session binding."
|
|
87
89
|
};
|
|
88
|
-
const connection = resolveCodexBindingAppServerConnection({
|
|
90
|
+
const connection = await resolveCodexBindingAppServerConnection({
|
|
89
91
|
binding,
|
|
90
92
|
authProfileId: binding?.authProfileId,
|
|
91
|
-
pluginConfig: params.pluginConfig
|
|
93
|
+
pluginConfig: params.pluginConfig,
|
|
94
|
+
...lookup,
|
|
95
|
+
assertCurrent: params.assertCurrent
|
|
92
96
|
});
|
|
93
97
|
const runtime = connection.appServer;
|
|
94
98
|
const client = active.client ?? await getLeasedSharedCodexAppServerClient({
|
|
@@ -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 };
|