@openclaw/codex 2026.10.5-beta.4 → 2026.10.10-beta.1
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/README.md +10 -3
- package/dist/.setup/{account-usage-runtime-CoVpNIlD.mjs → account-usage-runtime-DDCDkvtl.mjs} +15 -9
- package/dist/.setup/{app-server-policy-D_zv8J7V.mjs → app-server-policy-Cog6mm2i.mjs} +1 -1
- package/dist/.setup/{apply-BXDMd05l.mjs → apply-BVSXYkTV.mjs} +11 -11
- package/dist/.setup/{attempt-client-cleanup-zNuNTKVr.mjs → attempt-client-cleanup-6OcbMH46.mjs} +14 -8
- package/dist/.setup/attempt-terminal-sZutF0WY.mjs +1 -0
- package/dist/.setup/{attempt-workspace-context-CcwP3DA3.mjs → attempt-workspace-context-GYPLawX6.mjs} +2 -2
- package/dist/.setup/{auth-binding-BaxlhaNx.mjs → auth-binding-830RLAJW.mjs} +2 -2
- package/dist/.setup/{auth-cache-key-f8ODJ_OX.mjs → auth-cache-key-CVcYw8HD.mjs} +92 -80
- package/dist/.setup/{auth-profile-CgHQ8Vot.mjs → auth-profile-auwzSwwy.mjs} +14 -8
- package/dist/.setup/{auth-profile-health-oHizqgye.mjs → auth-profile-health-BVPZU9I8.mjs} +15 -8
- package/dist/.setup/{auth-profile-selection-hr8ocLtz.mjs → auth-profile-selection-Bp5PDk3W.mjs} +24 -7
- package/dist/.setup/{binding-connection-B7HAAZSI.mjs → binding-connection-GTgUj9pi.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-DAXn7iFl.mjs → binding-connection.runtime-RcWR3vQu.mjs} +4 -3
- package/dist/.setup/{bounded-turn-isolation-BfDAo-qZ.mjs → bounded-turn-isolation-D8CDrAVX.mjs} +3 -3
- package/dist/.setup/{bounded-turn-DfIJtRlv.mjs → bounded-turn-mN_ekXYW.mjs} +18 -22
- package/dist/.setup/{build-state-Ds14X10-.mjs → build-state-VcujMRqP.mjs} +1 -1
- package/dist/.setup/{capabilities-DbOzOglY.mjs → capabilities-DAS-JX1z.mjs} +1 -1
- package/dist/.setup/{client-D93nbdB8.mjs → client-BS8X7HmG.mjs} +47 -317
- package/dist/.setup/{client-catalog-response-CuVLp4I0.mjs → client-catalog-response-jM38o5w1.mjs} +2 -2
- package/dist/.setup/client-initialize-CjgZcX61.mjs +165 -0
- package/dist/.setup/{command-dispatch-DxdH5a9-.mjs → command-dispatch-DzXbHqCn.mjs} +3 -3
- package/dist/.setup/{command-formatters-xW9KpoSZ.mjs → command-formatters-B_7-QZ1c.mjs} +2 -2
- package/dist/.setup/{command-handlers-fiYvYYq0.mjs → command-handlers-tfb5Uq-O.mjs} +539 -406
- package/dist/.setup/command-rpc-SXqLQukR.mjs +296 -0
- package/dist/.setup/compact-M-JxLcbZ.mjs +823 -0
- package/dist/.setup/{computer-use-DL2v3Kxq.mjs → computer-use-FqQ-Flbl.mjs} +21 -68
- package/dist/.setup/{config-C1YVVLEA.mjs → config-BfrAlTMT.mjs} +3 -3
- package/dist/.setup/{config-options-DDzeNQ8m.mjs → config-options-DMFZkd3X.mjs} +1 -1
- package/dist/.setup/{config-runtime-DWzK-k0n.mjs → config-runtime-BZRizyuG.mjs} +2 -2
- package/dist/.setup/{context-engine-projection-ps-yn_ci.mjs → context-engine-projection-PIeLSnR-.mjs} +16 -30
- package/dist/.setup/{conversation-binding-BieJZRRV.mjs → conversation-binding-C7MZy-Cx.mjs} +228 -116
- package/dist/.setup/{conversation-binding-data-UgLuTSQT.mjs → conversation-binding-data-khgW0n-o.mjs} +4 -2
- package/dist/.setup/{conversation-control-GXM3unE4.mjs → conversation-control-B2EpVZEb.mjs} +53 -23
- package/dist/.setup/{cyber-failover-D4dgNfFf.mjs → cyber-failover-CqEZoQsj.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-ljgGGL0s.mjs → cyber-failover-notice-poL3Advd.mjs} +1 -1
- package/dist/.setup/{doctor-start-options-JjTAl-q_.mjs → doctor-start-options-8uIBXIzR.mjs} +8 -5
- package/dist/.setup/{dynamic-tool-build-DcaPmBlE.mjs → dynamic-tool-build-BjFAIG-f.mjs} +208 -218
- package/dist/.setup/{dynamic-tools-CnQFnNKH.mjs → dynamic-tools-XqWsVjcC.mjs} +344 -118
- package/dist/.setup/{effective-mcp-catalog-B5HKFZNK.mjs → effective-mcp-catalog-C3ta5hHc.mjs} +11 -9
- package/dist/.setup/{ephemeral-turn-De3qb8EQ.mjs → ephemeral-turn-1ZF17fUR.mjs} +5 -4
- package/dist/.setup/{event-projector-assistant-message-CLMKN4x-.mjs → event-projector-assistant-message-ChOAY7rW.mjs} +16 -11
- package/dist/.setup/{event-projector-usage-BpKfdoTm.mjs → event-projector-usage-CBY0Hkga.mjs} +2 -2
- package/dist/.setup/{event-projector-values-CLvG1Hil.mjs → event-projector-values-yf4us9Pf.mjs} +1 -1
- package/dist/.setup/experimental-features-uGnVDtp-.mjs +19 -0
- package/dist/.setup/inference-context-mv_dBpAL.mjs +209 -0
- package/dist/.setup/{inference-dispatch-CO6tTs4q.mjs → inference-dispatch-C2zVSnrr.mjs} +2 -2
- package/dist/.setup/{inference-metadata-DCvcG_N_.mjs → inference-metadata-CYFWLHVk.mjs} +3 -1
- package/dist/.setup/{inference-proxy-BDWV0djM.mjs → inference-proxy-yd3hr2dr.mjs} +8 -8
- package/dist/.setup/installed-probe-lVC1X5ve.mjs +185 -0
- package/dist/.setup/{isolated-completion-BPJdvk5F.mjs → isolated-completion-P-r8NRE4.mjs} +7 -7
- package/dist/.setup/managed-binary-DbKvGXKl.mjs +395 -0
- package/dist/.setup/{mcp-app-session-preparation-Dz2GOwyE.mjs → mcp-app-session-preparation-fnsnCovu.mjs} +18 -14
- package/dist/.setup/{model-catalog-ZNwltCKl.mjs → model-catalog-Y_esgRPY.mjs} +28 -17
- package/dist/.setup/{models-BHpbAuz8.mjs → models-BWLEUo2E.mjs} +3 -3
- package/dist/.setup/{native-auth-esN5MdIv.mjs → native-auth-DpZIaY8N.mjs} +7 -4
- package/dist/.setup/native-execution-policy-D09tLP-u.mjs +152 -0
- package/dist/.setup/{native-hook-relay-wq7jrNLk.mjs → native-hook-relay-C7aaLJaP.mjs} +45 -10
- package/dist/.setup/{native-mcp-app-DX3nyTtc.mjs → native-mcp-app-CsWj-v_x.mjs} +5 -5
- package/dist/.setup/{native-skill-isolation-DSBeF-Yy.mjs → native-skill-isolation-CMimsKYy.mjs} +7 -7
- package/dist/.setup/{native-subagent-monitor-DOLEIf9r.mjs → native-subagent-monitor-CFE7b4oC.mjs} +485 -239
- package/dist/.setup/{native-subagent-pending-assignments-DmVhedNs.mjs → native-subagent-pending-assignments-CTinVtjo.mjs} +1 -1
- package/dist/.setup/{native-task-assignments-DimsQ9Qa.mjs → native-task-assignments-YJopbaVO.mjs} +9 -5
- package/dist/.setup/{node-cli-sessions-CzKg2nGq.mjs → node-cli-sessions-BuJnBnEq.mjs} +7 -4
- package/dist/.setup/{node-exec-server.runtime-BWkULhBM.mjs → node-exec-server.runtime-CP7RC1Nd.mjs} +3 -3
- package/dist/.setup/{plan-41-YOBMq.mjs → plan-B4cHgqNv.mjs} +7 -20
- package/dist/.setup/{plugin-activation-D7WkJMvU.mjs → plugin-activation-CXPWe-hl.mjs} +4 -4
- package/dist/.setup/{plugin-app-cache-key-Bg9DbDI6.mjs → plugin-app-cache-key-DRb-niJc.mjs} +17 -55
- package/dist/.setup/{plugin-approval-roundtrip-CD88q3yx.mjs → plugin-approval-roundtrip-DIZHLbAM.mjs} +1 -1
- package/dist/.setup/{plugin-inventory-CYgdo14P.mjs → plugin-inventory-DE9wcaeH.mjs} +2 -2
- package/dist/.setup/{plugin-metadata-cache-Bi8TAPwX.mjs → plugin-metadata-cache-BqC-a6Fb.mjs} +2 -15
- package/dist/.setup/{project-doc-thread-config-BVcvnps8.mjs → project-doc-thread-config-B0UI3f1D.mjs} +6 -6
- package/dist/.setup/protocol-CaPAVwe9.mjs +12 -0
- package/dist/.setup/{provider-capabilities-Dn2WwH4P.mjs → provider-capabilities-DjcKunHS.mjs} +1 -1
- package/dist/.setup/{provider-LWKll6dV.mjs → provider-wj_LFJH3.mjs} +4 -4
- package/dist/.setup/{rate-limits-CI8pTPqL.mjs → rate-limits-BpfURnuy.mjs} +1 -1
- package/dist/.setup/{request-Bo0kKABI.mjs → request-ePeNJrOd.mjs} +132 -136
- package/dist/.setup/{responses-oauth-twnuTaAa.mjs → responses-oauth-CCV7aVYF.mjs} +6 -6
- package/dist/.setup/{rpc-error-C98SHchT.mjs → rpc-error-DemqqaxE.mjs} +7 -3
- package/dist/.setup/{run-attempt-ClU8MxhZ.mjs → run-attempt-BcWArowv.mjs} +595 -426
- package/dist/.setup/{run-attempt-lifecycle-KN4oh-7O.mjs → run-attempt-lifecycle-DN-ATDp9.mjs} +1 -1
- package/dist/.setup/{runtime-artifact-C13pR7tD.mjs → runtime-artifact-CmLWeyJB.mjs} +3 -3
- package/dist/.setup/{runtime-artifact-connection-jS5DeCok.mjs → runtime-artifact-connection-DpWlZ02e.mjs} +3 -3
- package/dist/.setup/{sandbox-guard-DIImwCy1.mjs → sandbox-guard-DneAfNye.mjs} +70 -30
- package/dist/.setup/{session-binding-JEHNMPsr.mjs → session-binding-BgsWcbdY.mjs} +25 -23
- package/dist/.setup/{session-binding-record-DU_0biMD.mjs → session-binding-record-C_THntMe.mjs} +27 -12
- package/dist/.setup/{session-binding-record-codec-BpH8u_G9.mjs → session-binding-record-codec-DvmOI7g_.mjs} +1 -0
- package/dist/.setup/{session-binding-sidecars-DD-enC8w.mjs → session-binding-sidecars-BNSS6WL4.mjs} +55 -63
- package/dist/.setup/session-cancellation-DLBSJO5n.mjs +43 -0
- package/dist/.setup/{session-catalog-adoption-Ca3OYGYM.mjs → session-catalog-adoption-ppsLlVLB.mjs} +24 -38
- package/dist/.setup/{session-catalog-archive-Bv6gV7x9.mjs → session-catalog-archive-CqLRHJ6z.mjs} +11 -13
- package/dist/.setup/{session-catalog-events-kR2Ot6nX.mjs → session-catalog-events-DK0opVp3.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-CrnfVEnT.mjs → session-catalog-index-BfzfdtH7.mjs} +96 -271
- package/dist/.setup/{session-catalog-index-order-CTfoefow.mjs → session-catalog-index-order-0Zqng2u8.mjs} +1 -1
- package/dist/.setup/{session-catalog-limits-BynIoOYm.mjs → session-catalog-limits-Dc6E0BZz.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-D4MYNgDB.mjs → session-catalog-list-request-CAjoWjaH.mjs} +3 -4
- package/dist/.setup/{session-catalog-native-projection-CWqCU1I_.mjs → session-catalog-native-projection-G3lSDYYG.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-adoption-BdP9Zjqo.mjs → session-catalog-node-adoption-e9v8mGgx.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-continue-CNJibO4_.mjs → session-catalog-node-continue-H7nrzcUD.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-lookup-BH_DBGa9.mjs → session-catalog-node-lookup-BrZfDkA8.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-DkeoVn60.mjs → session-catalog-parsing-V6jyFg9g.mjs} +2 -2
- package/dist/.setup/{session-catalog-projection-BzHiV818.mjs → session-catalog-projection-BjWE414G.mjs} +8 -7
- package/dist/.setup/{session-catalog-provenance-CmsOE5mh.mjs → session-catalog-provenance-Dg9s12z-.mjs} +50 -30
- package/dist/.setup/{session-catalog-source-DGuRdGvM.mjs → session-catalog-source-DqyuNxCe.mjs} +2 -6
- package/dist/.setup/{session-cli-GwU0izn-.mjs → session-cli-CBGKiqdv.mjs} +1 -1
- package/dist/.setup/{session-history-BO6i_pfk.mjs → session-history-7W0cgTXF.mjs} +11 -9
- package/dist/.setup/{session-history-import-CaO8s6ta.mjs → session-history-import-BwPKwcNi.mjs} +4 -4
- package/dist/.setup/{session-initialization-Bi_2DKhc.mjs → session-initialization-Dn3vveGv.mjs} +2 -2
- package/dist/.setup/{session-retirement-B3U5hpGJ.mjs → session-retirement-Ci_JvOfH.mjs} +8 -8
- package/dist/.setup/{session-history.worker-DJQfek5p.mjs → settled-turn-evidence--tRW6fSm.mjs} +2 -18
- package/dist/.setup/{settled-turn-finalizer-CYCVpTv2.mjs → settled-turn-finalizer-D3-KXsbP.mjs} +8 -8
- package/dist/.setup/{shared-client-BCx1wbyA.mjs → shared-client-CE_uY0A1.mjs} +380 -557
- package/dist/.setup/side-question-OM18H9WJ.mjs +998 -0
- package/dist/.setup/{source-DipMO9hL.mjs → source-uGKgKWm8.mjs} +5 -5
- package/dist/.setup/{thread-archive-guard-LKdwQKyr.mjs → thread-archive-guard-BWjSsA92.mjs} +1 -1
- package/dist/.setup/{thread-lifecycle-run-C_aYiYqk.mjs → thread-lifecycle-run-mLueY6pH.mjs} +172 -75
- package/dist/.setup/{thread-model-selection-DcVebr8N.mjs → thread-model-selection-DxposL4X.mjs} +9 -9
- package/dist/.setup/{thread-ownership-BoUd0i6L.mjs → thread-ownership-t6Y9fLQS.mjs} +7 -7
- package/dist/.setup/{thread-policy-B3wBRNph.mjs → thread-policy-Cy301Or8.mjs} +6 -6
- package/dist/.setup/{thread-requests-BgzJwJtS.mjs → thread-requests-BjawdIVV.mjs} +14 -14
- package/dist/.setup/{thread-resume-D-3bsr1j.mjs → thread-resume-BUbsUfgF.mjs} +6 -6
- package/dist/.setup/{transcript-history-projection-DfKcoZCB.mjs → transcript-history-projection-i-FVpyha.mjs} +1 -1
- package/dist/.setup/{transcript-mirror-Bee2o6jj.mjs → transcript-mirror-CEQJZlF3.mjs} +6 -9
- package/dist/.setup/{transport-stdio-CRWTkKOn.mjs → transport-stdio-Bq160Dhv.mjs} +63 -64
- package/dist/.setup/{transport-websocket-DIyPfkHo.mjs → transport-websocket-0YqiI_MH.mjs} +1 -1
- package/dist/.setup/{turn-router-DBVMToGo.mjs → turn-router-Dbw17k3K.mjs} +2 -2
- package/dist/.setup/{upstream-session-fork-p5fwKi7w.mjs → upstream-session-fork-_LYkh0nZ.mjs} +46 -219
- package/dist/.setup/{usage-limit-error-BQX8RHAd.mjs → usage-limit-error-DcOSH3J4.mjs} +4 -4
- package/dist/.setup/{usage-C2Kq7oej.mjs → usage-w_93wnnR.mjs} +4 -4
- package/dist/.setup/{web-search-item-CvokaZOo.mjs → web-search-item-DHVuNSqk.mjs} +1 -1
- package/dist/.setup/{web-search-provider.runtime-D89djc7e.mjs → web-search-provider.runtime-DMHxve5v.mjs} +3 -3
- package/dist/.setup/{workspace-write-sandbox-probe-BDWO2Qkh.mjs → workspace-write-sandbox-probe-DJxOXcF3.mjs} +2 -2
- package/dist/api.js +7 -28
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/client-version-api.js +25 -0
- package/dist/doctor-contract-api.js +5 -5
- package/dist/harness.js +59 -36
- package/dist/index.js +259 -295
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -2
- package/dist/native-session-binding-api.js +1 -2
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-entrypoint.js +12 -0
- package/dist/session-history-worker-runtime.js +7 -18
- package/dist/session-history.worker.js +18 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +6 -6
- package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +0 -2
- package/dist/.setup/command-rpc-HIvsy3wS.mjs +0 -247
- package/dist/.setup/compact-ClZ7Ar7L.mjs +0 -808
- package/dist/.setup/inference-context-DNlGwzwy.mjs +0 -91
- package/dist/.setup/managed-binary-BtIjV7yN.mjs +0 -175
- package/dist/.setup/native-execution-policy-MXEe7PB3.mjs +0 -75
- package/dist/.setup/protocol-CANUwXJ3.mjs +0 -17
- package/dist/.setup/side-question-Bz2UQW0l.mjs +0 -826
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-
|
|
2
|
-
import { a as withCodexAppServerJsonClient } from "./request-
|
|
3
|
-
import { a as marketplaceRef, o as pluginReadParams, r as isOpenAiCuratedMarketplaceName, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-
|
|
4
|
-
import "./config-
|
|
5
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
1
|
+
import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-DRb-niJc.mjs";
|
|
2
|
+
import { a as withCodexAppServerJsonClient } from "./request-ePeNJrOd.mjs";
|
|
3
|
+
import { a as marketplaceRef, o as pluginReadParams, r as isOpenAiCuratedMarketplaceName, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-DE9wcaeH.mjs";
|
|
4
|
+
import "./config-BfrAlTMT.mjs";
|
|
5
|
+
import { t as __exportAll } from "./session-binding-sidecars-BNSS6WL4.mjs";
|
|
6
6
|
import { asNonArrayRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import os from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
2
2
|
import { normalizeBoundedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/thread-archive-guard.ts
|
|
4
4
|
const DESCENDANT_PAGE_LIMIT = 100;
|
|
@@ -1,49 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as matchesPendingSupervisionBranch } from "./session-binding-record-codec-
|
|
3
|
-
import {
|
|
1
|
+
import { n as flattenCodexDynamicToolFunctions, r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
2
|
+
import { n as matchesPendingSupervisionBranch } from "./session-binding-record-codec-DvmOI7g_.mjs";
|
|
3
|
+
import { g as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced } from "./session-binding-record-C_THntMe.mjs";
|
|
4
4
|
import { l as fingerprintCodexPolicy } from "./config-security-clxAZYWX.mjs";
|
|
5
5
|
import { f as resolveCodexPluginsPolicy } from "./config-parsing-DsWSCPHO.mjs";
|
|
6
6
|
import { n as resolveCodexAppServerLocalHomeDir, t as resolveCodexAppServerHomeDir } from "./auth-start-options-BPIPeEX8.mjs";
|
|
7
|
-
import { d as readCodexEffectiveConfig, s as assertCodexModelBackedReviewerEffectiveConfig, u as CODEX_SESSION_OVERRIDABLE_LAYER_TYPES } from "./config-options-
|
|
8
|
-
import {
|
|
7
|
+
import { d as readCodexEffectiveConfig, s as assertCodexModelBackedReviewerEffectiveConfig, u as CODEX_SESSION_OVERRIDABLE_LAYER_TYPES } from "./config-options-DMFZkd3X.mjs";
|
|
8
|
+
import { T as retainSharedCodexAppServerClientByInstanceId, f as getCurrentSharedClientEntry } from "./auth-cache-key-CVcYw8HD.mjs";
|
|
9
9
|
import { t as withCodexAppServerThreadMutation } from "./thread-ownership-queue-CeyYScUC.mjs";
|
|
10
|
-
import { o as isCodexAppServerOverloadError, r as CodexAppServerRpcError, s as isCodexThreadReadMissingError } from "./rpc-error-
|
|
10
|
+
import { i as CodexAppServerScopedRequestRejectedError, o as isCodexAppServerOverloadError, r as CodexAppServerRpcError, s as isCodexThreadReadMissingError } from "./rpc-error-DemqqaxE.mjs";
|
|
11
11
|
import { t as codexCatalogHomeId } from "./session-catalog-home-id-vlih0B_g.mjs";
|
|
12
12
|
import { r as withAbortableTimeout } from "./timeout-D0mEWSGG.mjs";
|
|
13
|
-
import { t as projectBoundedCodexThreadHistory } from "./transcript-history-projection-
|
|
14
|
-
import { a as defaultCodexAppInventoryCache, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-
|
|
15
|
-
import { n as readCodexSessionMeta } from "./session-catalog-provenance-
|
|
16
|
-
import { t as assertCodexSessionRuntimeOwnership } from "./binding-connection-
|
|
17
|
-
import {
|
|
18
|
-
import "./
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { C as
|
|
23
|
-
import
|
|
24
|
-
import { f as
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { i as
|
|
29
|
-
import { c as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
13
|
+
import { t as projectBoundedCodexThreadHistory } from "./transcript-history-projection-i-FVpyha.mjs";
|
|
14
|
+
import { a as defaultCodexAppInventoryCache, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-DRb-niJc.mjs";
|
|
15
|
+
import { n as readCodexSessionMeta } from "./session-catalog-provenance-Dg9s12z-.mjs";
|
|
16
|
+
import { t as assertCodexSessionRuntimeOwnership } from "./binding-connection-GTgUj9pi.mjs";
|
|
17
|
+
import { n as requestCodexAppServerClientJson } from "./request-ePeNJrOd.mjs";
|
|
18
|
+
import { c as resolveRecoverableCodexPluginConfigKeys } from "./plugin-inventory-DE9wcaeH.mjs";
|
|
19
|
+
import "./config-BfrAlTMT.mjs";
|
|
20
|
+
import { c as resolveCodexContextEngineProjectionMaxChars } from "./context-engine-projection-PIeLSnR-.mjs";
|
|
21
|
+
import { n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-auwzSwwy.mjs";
|
|
22
|
+
import { C as getCodexInferenceThread, D as consumeCodexAppServerLiveThread, H as unsubscribeCodexAppServerLiveThread, K as createCodexEphemeralThreadPolicy, M as isCodexAppServerClientRuntimeLive, N as isCodexAppServerLiveThreadClaimed, P as isCodexAppServerLiveThreadProtected, R as readCodexLiveThreadEphemeralPolicy, S as bindCodexInferenceThread, T as prepareCodexInferenceThreadConfig, _ as CodexThreadBindingConflictError, g as CodexAdoptedThreadActiveError, j as hasCodexAppServerSiblingThreadWork, q as recordCodexThreadForkSettings, t as captureCodexAppServerClientLifetime, v as CodexThreadClientReplacementError, w as getCodexInferenceThreadQualification, x as assertCodexInferenceRouteConfig, y as CodexThreadStartRequestError, z as releaseCodexAppServerLiveThread } from "./shared-client-CE_uY0A1.mjs";
|
|
23
|
+
import "./responses-oauth-CCV7aVYF.mjs";
|
|
24
|
+
import { M as getCodexAppServerClientInstanceId, P as resolveCodexAppServerClientInstanceId, S as resolveCodexThreadRolloutPath, _ as assertExactSupervisionModelSelection, f as assertCodexThreadAcceptsDirectInput, h as assertCodexThreadStartResponse, p as assertCodexThreadForkResponse, s as isCodexAppServerRequestTimeoutError, x as readSupervisionResponseThreadId } from "./client-BS8X7HmG.mjs";
|
|
25
|
+
import { r as hasCodexAppServerSiblingRouteWork } from "./turn-router-Dbw17k3K.mjs";
|
|
26
|
+
import { f as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, n as CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS, o as closeCodexStartupClientBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-6OcbMH46.mjs";
|
|
27
|
+
import { n as listAllCodexAppServerModels } from "./models-BWLEUo2E.mjs";
|
|
28
|
+
import { a as buildCodexPluginThreadConfigInputFingerprint, c as buildPluginAppPolicyContext, d as mergeCodexThreadConfigs, i as buildCodexPluginThreadConfig, l as disableUnlistedCodexApps, m as buildCodexAppApprovalOverrides, n as mergeCodexNativeProjectDocThreadConfig, o as buildCodexPluginThreadConfigTimeoutFallback, p as shouldBuildCodexPluginThreadConfig, r as buildCodexPluginAppsConfigPatchFromPolicyContext, u as isCodexPluginThreadBindingStale } from "./project-doc-thread-config-B0UI3f1D.mjs";
|
|
29
|
+
import { A as isTransientWebSearchRestriction, C as fingerprintEnvironmentSelection, D as readActiveCodexTurnIdsFromResume, E as legacyFingerprintUserMcpServersConfigPatch, I as isMessageOnlyCodexSourceReply, L as isSystemAgentOnlyCodexDynamicToolAllowlist, M as shouldRotateCodexAppServerBindingForRuntime, N as shouldRotateCodexGpt56MultiAgentBinding, O as shouldStartTransientNoToolThread, S as fingerprintCodexThreadConfig, T as fingerprintUserMcpServersConfigPatch, _ as buildDeveloperInstructions, b as codexDynamicToolsFingerprint, c as codexThreadSandboxOrPermissions, d as readCodexManagedRequirementsFingerprint, f as resolveCodexThreadApprovalsReviewer, g as mergeCodexNativeShellEnvironment, h as resolveCodexWebSearchPlan, i as buildCodexRuntimeThreadConfigForRun, j as shouldRecheckRecoverablePluginBinding, n as buildCodexRingZeroThreadConfigPatch, o as buildThreadResumeParams, p as attestCodexRestrictedToolSurfaceMcpServersDisabled, s as buildThreadStartParams, t as assertCodexManagedRequirementsDoNotOverrideToolPolicy, u as readCodexInheritedMcpServerNames, v as areCodexDynamicToolFingerprintsCompatible, w as fingerprintJsonObject, x as codexLegacyDynamicToolsFingerprint, y as areUserMcpServersFingerprintsCompatible } from "./thread-requests-BjawdIVV.mjs";
|
|
30
|
+
import { i as resolveCodexSessionBinding, o as hashCodexAppServerBindingFingerprint } from "./session-binding-BgsWcbdY.mjs";
|
|
31
|
+
import { i as resolveCodexAppServerThreadModelSelection, n as resolveCodexAppServerModelProvider } from "./thread-model-selection-DxposL4X.mjs";
|
|
32
|
+
import { c as withExclusiveCodexAppServerThread, r as retainCodexAppServerBindingSubscription, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-t6Y9fLQS.mjs";
|
|
33
|
+
import { a as refreshCodexThreadInstructions, i as assertCodexSupervisionThreadLineage, n as CodexThreadPolicyHandoffError, o as refreshCodexThreadPolicy, r as assertAdoptedCodexThreadResumeAllowed, t as CodexIncognitoPolicyChangeError } from "./thread-policy-Cy301Or8.mjs";
|
|
34
|
+
import { t as resumeCodexAppServerThread } from "./thread-resume-BUbsUfgF.mjs";
|
|
32
35
|
import { r as readCodexMcpToolConnectorId } from "./mcp-tool-metadata-DW41snf3.mjs";
|
|
33
|
-
import { n as disableCodexPluginThreadConfig } from "./dynamic-tool-build-
|
|
34
|
-
import { n as CodexManagedHooksOnlyError, r as assertCodexNativeHookRelayAllowed } from "./native-hook-relay-
|
|
35
|
-
import { t as defaultCodexPluginMetadataCache } from "./plugin-metadata-cache-
|
|
36
|
-
import { a as discardUnattestedCodexPluginThread, i as checkCodexThreadAppAvailability, n as resolveCodexNativeSkillIsolation, o as hasCodexNativeToolCatalog, r as attestCodexThreadToolSurface, s as loadCodexNativeToolCatalog, t as applyCodexNativeSkillIsolation } from "./native-skill-isolation-
|
|
36
|
+
import { n as disableCodexPluginThreadConfig } from "./dynamic-tool-build-BjFAIG-f.mjs";
|
|
37
|
+
import { n as CodexManagedHooksOnlyError, r as assertCodexNativeHookRelayAllowed } from "./native-hook-relay-C7aaLJaP.mjs";
|
|
38
|
+
import { t as defaultCodexPluginMetadataCache } from "./plugin-metadata-cache-BqC-a6Fb.mjs";
|
|
39
|
+
import { a as discardUnattestedCodexPluginThread, i as checkCodexThreadAppAvailability, n as resolveCodexNativeSkillIsolation, o as hasCodexNativeToolCatalog, r as attestCodexThreadToolSurface, s as loadCodexNativeToolCatalog, t as applyCodexNativeSkillIsolation } from "./native-skill-isolation-CMimsKYy.mjs";
|
|
37
40
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
38
41
|
import crypto from "node:crypto";
|
|
39
42
|
import { isDeepStrictEqual } from "node:util";
|
|
40
43
|
import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
41
44
|
import path from "node:path";
|
|
42
|
-
import { isIncognitoSessionKey } from "openclaw/plugin-sdk/session-key-runtime";
|
|
43
45
|
import { createStageTimingTracker, formatStageTimings, racePromiseWithAbortSignal } from "openclaw/plugin-sdk/time-runtime";
|
|
46
|
+
import { isIncognitoSessionKey } from "openclaw/plugin-sdk/session-key-runtime";
|
|
44
47
|
import { resolveAgentDir as resolveAgentDir$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
45
48
|
import { AgentHarnessPreflightError, embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, isHostScopedAgentToolActive } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
46
49
|
import { buildCodexUserMcpServersThreadConfigPatchForRun } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
50
|
+
import { resolveModelServiceTierContextTokens } from "openclaw/plugin-sdk/provider-model-metadata";
|
|
47
51
|
import { isDiagnosticFlagEnabled } from "openclaw/plugin-sdk/diagnostic-flags";
|
|
48
52
|
//#region extensions/codex/src/app-server/scheduled-app-tool-policy.ts
|
|
49
53
|
function normalizeAppToolApprovalMode(value) {
|
|
@@ -588,6 +592,40 @@ function isCodexAppServerProfilerEnabled(config, env = process.env) {
|
|
|
588
592
|
return PROFILER_FLAGS.some((flag) => isDiagnosticFlagEnabled(flag, config, env));
|
|
589
593
|
}
|
|
590
594
|
//#endregion
|
|
595
|
+
//#region extensions/codex/src/app-server/service-tier.ts
|
|
596
|
+
/** Validate an explicit Ultrafast selection against this turn's native model and client. */
|
|
597
|
+
async function resolveCodexUltrafastServiceTier(params) {
|
|
598
|
+
if (!params.enabled || params.modelProvider !== "openai" && params.modelProvider !== "openclaw_token_sharing" || !params.model) return params.serviceTier;
|
|
599
|
+
params.signal.throwIfAborted();
|
|
600
|
+
params.assertCurrent();
|
|
601
|
+
const deadline = performance.now() + params.timeoutMs;
|
|
602
|
+
try {
|
|
603
|
+
const catalog = await listAllCodexAppServerModels({
|
|
604
|
+
includeHidden: true,
|
|
605
|
+
request: (request) => {
|
|
606
|
+
const timeoutMs = deadline - performance.now();
|
|
607
|
+
if (timeoutMs <= 0) throw new Error("Codex Ultrafast catalog deadline exceeded");
|
|
608
|
+
return requestCodexAppServerClientJson({
|
|
609
|
+
...request,
|
|
610
|
+
client: params.client,
|
|
611
|
+
signal: params.signal,
|
|
612
|
+
assertCurrent: params.assertCurrent,
|
|
613
|
+
timeoutMs,
|
|
614
|
+
config: params.config
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
params.signal.throwIfAborted();
|
|
619
|
+
params.assertCurrent();
|
|
620
|
+
return catalog.models.find((entry) => entry.model === params.model)?.serviceTiers?.includes("ultrafast") ? "ultrafast" : params.serviceTier;
|
|
621
|
+
} catch (error) {
|
|
622
|
+
params.signal.throwIfAborted();
|
|
623
|
+
params.assertCurrent();
|
|
624
|
+
if (error instanceof CodexAppServerScopedRequestRejectedError) throw error;
|
|
625
|
+
return params.serviceTier;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
//#endregion
|
|
591
629
|
//#region extensions/codex/src/app-server/thread-lifecycle-timing.ts
|
|
592
630
|
function createCodexThreadLifecycleTimingTracker(options = {}) {
|
|
593
631
|
const log = options.log ?? embeddedAgentLog;
|
|
@@ -641,7 +679,7 @@ function assertCodexThreadInferenceAuthority(params, modelPolicyEnforced) {
|
|
|
641
679
|
}
|
|
642
680
|
/** Preserve the selected provider when only its physical thread must be replaced. */
|
|
643
681
|
async function prepareCodexThreadRequestContext(params, options) {
|
|
644
|
-
const startModelSelection = resolveCodexAppServerThreadModelSelection({
|
|
682
|
+
const startModelSelection = await resolveCodexAppServerThreadModelSelection({
|
|
645
683
|
homeScope: params.appServer.start.homeScope,
|
|
646
684
|
provider: params.params.provider,
|
|
647
685
|
model: params.runtimeModelId ?? params.params.modelId,
|
|
@@ -652,6 +690,28 @@ async function prepareCodexThreadRequestContext(params, options) {
|
|
|
652
690
|
config: params.params.config
|
|
653
691
|
});
|
|
654
692
|
const startModelProvider = startModelSelection.modelProvider;
|
|
693
|
+
const nativeProvider = options.preflight.effectiveConfig.config.model_provider;
|
|
694
|
+
const fastMode = typeof params.params.fastMode === "function" ? params.params.fastMode() : params.params.fastMode;
|
|
695
|
+
const preservedNativeBinding = options.selectionBinding?.preserveNativeModel || options.selectionBinding?.connectionScope === "supervision" ? options.selectionBinding : void 0;
|
|
696
|
+
const admittedNativeThread = fastMode === "ultrafast" && preservedNativeBinding ? await assertAdoptedCodexThreadResumeAllowed(params, preservedNativeBinding.threadId, {
|
|
697
|
+
...options.preflight,
|
|
698
|
+
throwIfAborted: options.throwIfAborted
|
|
699
|
+
}, options.assertCurrent) : void 0;
|
|
700
|
+
const serviceTier = options.serviceTierAdmission ? options.serviceTierAdmission.tier : await resolveCodexUltrafastServiceTier({
|
|
701
|
+
enabled: fastMode === "ultrafast" && params.appServer.enableUltrafast !== false,
|
|
702
|
+
serviceTier: params.appServer.serviceTier === "ultrafast" ? "priority" : params.appServer.serviceTier,
|
|
703
|
+
model: admittedNativeThread?.model ?? preservedNativeBinding?.model ?? startModelSelection.model,
|
|
704
|
+
modelProvider: admittedNativeThread?.modelProvider ?? preservedNativeBinding?.modelProvider ?? startModelProvider ?? options.selectionBinding?.modelProvider ?? (typeof nativeProvider === "string" ? nativeProvider : params.params.provider === "codex" ? "openai" : params.params.provider),
|
|
705
|
+
client: params.client,
|
|
706
|
+
timeoutMs: Math.min(params.appServer.requestTimeoutMs, 2500),
|
|
707
|
+
signal: params.signal ?? new AbortController().signal,
|
|
708
|
+
assertCurrent: options.assertCurrent,
|
|
709
|
+
config: params.params.config
|
|
710
|
+
});
|
|
711
|
+
params.appServer = {
|
|
712
|
+
...params.appServer,
|
|
713
|
+
serviceTier
|
|
714
|
+
};
|
|
655
715
|
const source = params.params.hostCapabilities.retainSourceAuthority?.();
|
|
656
716
|
const modelPolicyEnforced = params.nativeModelAdmission === void 0 || options.preflight.nativeModelInputTools !== void 0;
|
|
657
717
|
let inference;
|
|
@@ -675,6 +735,15 @@ async function prepareCodexThreadRequestContext(params, options) {
|
|
|
675
735
|
source?.release();
|
|
676
736
|
}
|
|
677
737
|
params.config = inference?.config ?? options.config;
|
|
738
|
+
const contextTokenCap = resolveModelServiceTierContextTokens("openai", serviceTier ?? void 0);
|
|
739
|
+
if (contextTokenCap !== void 0) {
|
|
740
|
+
const configuredLimit = params.config?.model_auto_compact_token_limit ?? options.preflight.effectiveConfig.config.model_auto_compact_token_limit;
|
|
741
|
+
params.config = {
|
|
742
|
+
...params.config,
|
|
743
|
+
model_auto_compact_token_limit: typeof configuredLimit === "number" ? Math.min(configuredLimit, contextTokenCap) : contextTokenCap,
|
|
744
|
+
model_auto_compact_token_limit_scope: "total"
|
|
745
|
+
};
|
|
746
|
+
}
|
|
678
747
|
params.inferenceRoute = inference?.route;
|
|
679
748
|
params.inferenceProviderRoutes = inference?.providers;
|
|
680
749
|
params.assertCurrent = () => {
|
|
@@ -685,10 +754,12 @@ async function prepareCodexThreadRequestContext(params, options) {
|
|
|
685
754
|
params.assertCurrent();
|
|
686
755
|
return {
|
|
687
756
|
...options.preflight,
|
|
757
|
+
admittedNativeThread,
|
|
758
|
+
serviceTierAdmission: options.serviceTierAdmission ?? { tier: serviceTier },
|
|
688
759
|
bindingIdentity: options.bindingIdentity,
|
|
689
760
|
startModelSelection,
|
|
690
761
|
startModelProvider,
|
|
691
|
-
normalizeBindingModelProvider: (authProfileId, modelProvider) => normalizeCodexAppServerBindingModelProvider({
|
|
762
|
+
normalizeBindingModelProvider: async (authProfileId, modelProvider) => await normalizeCodexAppServerBindingModelProvider({
|
|
692
763
|
authProfileId,
|
|
693
764
|
modelProvider,
|
|
694
765
|
authProfileStore: params.params.authProfileStore,
|
|
@@ -696,7 +767,7 @@ async function prepareCodexThreadRequestContext(params, options) {
|
|
|
696
767
|
config: params.params.config
|
|
697
768
|
}),
|
|
698
769
|
assertInferenceConfig: (config, modelProvider) => assertCodexInferenceRouteConfig(params.client, params.inferenceRoute, config, modelProvider, params.inferenceProviderRoutes),
|
|
699
|
-
buildResumeParams: (binding, authProfileId, config) => buildThreadResumeParams(params.params, {
|
|
770
|
+
buildResumeParams: async (binding, authProfileId, config) => await buildThreadResumeParams(params.params, {
|
|
700
771
|
...params,
|
|
701
772
|
threadId: binding.threadId,
|
|
702
773
|
authProfileId,
|
|
@@ -718,7 +789,10 @@ async function publishCodexThreadInferenceBinding(params, binding, reusedConfigu
|
|
|
718
789
|
if (reusedConfiguration) {
|
|
719
790
|
if (getCodexInferenceThread(params.client, binding.threadId) !== params.inferenceRoute) throw new Error("Codex inference thread configuration changed before reuse");
|
|
720
791
|
} else bindCodexInferenceThread(params.client, binding.threadId, params.inferenceRoute, params.inferenceProviderRoutes);
|
|
721
|
-
return
|
|
792
|
+
return {
|
|
793
|
+
...binding,
|
|
794
|
+
preparedServiceTier: params.appServer.serviceTier
|
|
795
|
+
};
|
|
722
796
|
};
|
|
723
797
|
return params.authority ? await params.authority.withCurrent(publish) : publish();
|
|
724
798
|
}
|
|
@@ -912,7 +986,7 @@ async function resumeExistingCodexThread(params, context) {
|
|
|
912
986
|
const finalConfigPatch = context.prebuiltFinalConfigPatch ?? await prepareCodexThreadFinalConfigPatch(params, context.nativeModelInputTools, resumeBinding);
|
|
913
987
|
const pluginThreadConfig = context.prebuiltPluginThreadConfig ?? (params.pluginThreadConfig?.enabled ? await lifecycleTiming.measure("plugin-config-build", () => params.pluginThreadConfig?.build()) : void 0);
|
|
914
988
|
const resumeConfig = buildCodexThreadRequestConfig(params, context, pluginThreadConfig?.configPatch, finalConfigPatch.configPatch);
|
|
915
|
-
const resumeParams = lifecycleTiming.
|
|
989
|
+
const resumeParams = await lifecycleTiming.measure("thread-resume-params", () => context.buildResumeParams(resumeBinding, authProfileId, resumeConfig));
|
|
916
990
|
const requestModelProvider = typeof resumeParams.modelProvider === "string" && resumeParams.modelProvider.trim() ? resumeParams.modelProvider : void 0;
|
|
917
991
|
throwIfAborted();
|
|
918
992
|
resumeReservation = params.reserveResumeThread?.(resumeBinding.threadId);
|
|
@@ -928,6 +1002,7 @@ async function resumeExistingCodexThread(params, context) {
|
|
|
928
1002
|
}
|
|
929
1003
|
}));
|
|
930
1004
|
acceptedConfiguration = configuration;
|
|
1005
|
+
recordCodexThreadForkSettings(params.client, resumeBinding.threadId, resumeParams);
|
|
931
1006
|
assertCodexThreadAcceptsDirectInput(response.thread);
|
|
932
1007
|
configuration.assertConfigured();
|
|
933
1008
|
if (requestModelProvider && response.modelProvider !== requestModelProvider) throw new Error("Codex resumed a different model provider than the one selected for this turn");
|
|
@@ -969,7 +1044,7 @@ async function resumeExistingCodexThread(params, context) {
|
|
|
969
1044
|
authProfileId,
|
|
970
1045
|
model: resumeParams.model ?? response.model ?? params.params.modelId,
|
|
971
1046
|
preserveNativeModel: resumeBinding.preserveNativeModel === true ? true : void 0,
|
|
972
|
-
modelProvider: normalizeBindingModelProvider(authProfileId, response.modelProvider ?? requestModelProvider ?? startModelProvider),
|
|
1047
|
+
modelProvider: await normalizeBindingModelProvider(authProfileId, response.modelProvider ?? requestModelProvider ?? startModelProvider),
|
|
973
1048
|
...buildCodexThreadBindingPolicy(params, context),
|
|
974
1049
|
webSearchThreadConfigFingerprint,
|
|
975
1050
|
mcpServersFingerprint: params.mcpServersFingerprintEvaluated === true ? params.mcpServersFingerprint : resumeBinding.mcpServersFingerprint,
|
|
@@ -1039,7 +1114,7 @@ async function startFreshCodexThread(params, context) {
|
|
|
1039
1114
|
const pluginThreadConfig = params.pluginThreadConfig?.enabled ? prebuiltPluginThreadConfig ?? await lifecycleTiming.measure("plugin-config-build", () => params.pluginThreadConfig?.build()) : void 0;
|
|
1040
1115
|
const finalConfigPatch = await prepareCodexThreadFinalConfigPatch(params, context.nativeModelInputTools);
|
|
1041
1116
|
const config = lifecycleTiming.measureSync("merge-thread-config", () => buildCodexThreadRequestConfig(params, context, pluginThreadConfig?.configPatch, finalConfigPatch.configPatch));
|
|
1042
|
-
const startParams = lifecycleTiming.
|
|
1117
|
+
const startParams = await lifecycleTiming.measure("thread-start-params", async () => await buildThreadStartParams(params.params, {
|
|
1043
1118
|
...params,
|
|
1044
1119
|
config,
|
|
1045
1120
|
model: startModelSelection.model,
|
|
@@ -1071,6 +1146,7 @@ async function startFreshCodexThread(params, context) {
|
|
|
1071
1146
|
}
|
|
1072
1147
|
});
|
|
1073
1148
|
const response = assertCodexThreadStartResponse(threadStartResponse);
|
|
1149
|
+
recordCodexThreadForkSettings(params.client, response.thread.id, startParams);
|
|
1074
1150
|
const provisionalAppIds = pluginThreadConfig?.provisionalAppIds;
|
|
1075
1151
|
const rejectUncommittedThread = async (cause) => {
|
|
1076
1152
|
if (!await discardUnattestedCodexPluginThread({
|
|
@@ -1100,7 +1176,7 @@ async function startFreshCodexThread(params, context) {
|
|
|
1100
1176
|
return await rejectUncommittedThread(error);
|
|
1101
1177
|
}
|
|
1102
1178
|
const rolloutPath = resolveCodexThreadRolloutPath(response.thread);
|
|
1103
|
-
const modelProvider = resolveCodexAppServerModelProvider({
|
|
1179
|
+
const modelProvider = await resolveCodexAppServerModelProvider({
|
|
1104
1180
|
homeScope: params.appServer.start.homeScope,
|
|
1105
1181
|
provider: params.params.provider,
|
|
1106
1182
|
authProfileId: params.params.authProfileId,
|
|
@@ -1108,7 +1184,7 @@ async function startFreshCodexThread(params, context) {
|
|
|
1108
1184
|
agentDir: params.params.agentDir,
|
|
1109
1185
|
config: params.params.config
|
|
1110
1186
|
});
|
|
1111
|
-
const bindingModelProvider = normalizeBindingModelProvider(params.params.authProfileId, response.modelProvider ?? requestModelProvider ?? startModelProvider ?? modelProvider);
|
|
1187
|
+
const bindingModelProvider = await normalizeBindingModelProvider(params.params.authProfileId, response.modelProvider ?? requestModelProvider ?? startModelProvider ?? modelProvider);
|
|
1112
1188
|
const nextMcpServersFingerprint = params.mcpServersFingerprintEvaluated === true ? params.mcpServersFingerprint : void 0;
|
|
1113
1189
|
const startedBinding = {
|
|
1114
1190
|
threadId: response.thread.id,
|
|
@@ -1164,7 +1240,10 @@ async function startFreshCodexThread(params, context) {
|
|
|
1164
1240
|
return {
|
|
1165
1241
|
...startedBinding,
|
|
1166
1242
|
modelProvider: response.modelProvider ?? requestModelProvider ?? startModelProvider ?? modelProvider,
|
|
1167
|
-
liveThreadEphemeralPolicy: startParams.ephemeral ? createCodexEphemeralThreadPolicy(
|
|
1243
|
+
liveThreadEphemeralPolicy: startParams.ephemeral ? createCodexEphemeralThreadPolicy({
|
|
1244
|
+
...params,
|
|
1245
|
+
config: startParams.config
|
|
1246
|
+
}, context.effectiveConfig.config) : void 0,
|
|
1168
1247
|
...!preserveExistingBinding ? { liveThreadConfigFingerprint: fingerprintCodexThreadConfig(startParams, params.params.authProfileId, dynamicToolsFingerprint, {
|
|
1169
1248
|
model: response.model,
|
|
1170
1249
|
modelProvider: bindingModelProvider ?? null
|
|
@@ -1216,7 +1295,10 @@ async function releaseCodexRetainedLiveThread(options) {
|
|
|
1216
1295
|
/** Release follows the physical owner across connection rotation, never a copied thread id. */
|
|
1217
1296
|
async function releaseCodexBoundLiveThread(options) {
|
|
1218
1297
|
const changedClient = options.ownerClientId && options.ownerClientId !== options.clientId;
|
|
1219
|
-
const previous = changedClient ? await retainSharedCodexAppServerClientByInstanceId(options.ownerClientId
|
|
1298
|
+
const previous = changedClient ? await retainSharedCodexAppServerClientByInstanceId(options.ownerClientId, {
|
|
1299
|
+
signal: options.signal,
|
|
1300
|
+
createAbortError: codexThreadLifecycleAbortError
|
|
1301
|
+
}) : void 0;
|
|
1220
1302
|
if (changedClient && !previous) return false;
|
|
1221
1303
|
const client = previous?.client ?? options.client;
|
|
1222
1304
|
try {
|
|
@@ -1240,8 +1322,15 @@ async function releaseCodexBoundLiveThread(options) {
|
|
|
1240
1322
|
async function tryReuseCodexLiveThread(options) {
|
|
1241
1323
|
const { params, binding, bindingIdentity, clientId, dynamicToolsFingerprint, environmentSelectionFingerprint, lifecycleTiming, ringZeroActive, restrictedToolSurface, startModelSelection, throwIfAborted } = options;
|
|
1242
1324
|
const incognito = isIncognitoSessionKey(params.params.sessionKey);
|
|
1325
|
+
const creationPolicy = incognito ? readCodexLiveThreadEphemeralPolicy(params.client, binding.threadId) : void 0;
|
|
1326
|
+
if (creationPolicy && options.admittedNativeThread?.status?.type !== "notLoaded") {
|
|
1327
|
+
const effectivePolicy = createCodexEphemeralThreadPolicy(params, options.effectiveConfig.config);
|
|
1328
|
+
if (creationPolicy.autoCompactTokenLimit !== effectivePolicy.autoCompactTokenLimit || creationPolicy.autoCompactTokenLimitScope !== effectivePolicy.autoCompactTokenLimitScope) throw new CodexIncognitoPolicyChangeError("compaction settings");
|
|
1329
|
+
}
|
|
1243
1330
|
if (incognito && (binding.preserveNativeModel || binding.connectionScope === "supervision")) {
|
|
1331
|
+
if (options.admittedNativeThread?.status?.type === "notLoaded") return { kind: "rotate" };
|
|
1244
1332
|
if (binding.clientId === clientId && binding.clientId && ((await options.buildLoadedPluginThreadConfig(binding))?.fingerprint ?? binding.pluginAppsFingerprint) === binding.pluginAppsFingerprint) {
|
|
1333
|
+
if (!creationPolicy && params.appServer.serviceTier === "ultrafast") throw new CodexIncognitoPolicyChangeError("compaction settings");
|
|
1245
1334
|
await params.buildFinalConfigPatch?.({
|
|
1246
1335
|
action: "resume",
|
|
1247
1336
|
binding,
|
|
@@ -1280,16 +1369,15 @@ async function tryReuseCodexLiveThread(options) {
|
|
|
1280
1369
|
let failure;
|
|
1281
1370
|
try {
|
|
1282
1371
|
let pendingRetention;
|
|
1283
|
-
if (retainSubscription) {
|
|
1372
|
+
if (retainSubscription) try {
|
|
1373
|
+
const currentBinding = await params.bindingStore.readAsync(bindingIdentity);
|
|
1284
1374
|
const retain = () => {
|
|
1285
1375
|
assertWarmOwner();
|
|
1286
|
-
if (isSameCodexAppServerThreadOwner(
|
|
1376
|
+
if (isSameCodexAppServerThreadOwner(currentBinding, binding)) pendingRetention = retainCodexAppServerBindingSubscription(params.client, binding.threadId, ownership);
|
|
1287
1377
|
};
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
} catch {}
|
|
1292
|
-
}
|
|
1378
|
+
if (params.authority) await params.authority.withCurrent(retain);
|
|
1379
|
+
else retain();
|
|
1380
|
+
} catch {}
|
|
1293
1381
|
if (pendingRetention) {
|
|
1294
1382
|
if (!await pendingRetention) failure = { cause: /* @__PURE__ */ new Error("Codex live thread ownership could not be returned to its session") };
|
|
1295
1383
|
} else await retainedThread.release(binding.threadId);
|
|
@@ -1307,10 +1395,12 @@ async function tryReuseCodexLiveThread(options) {
|
|
|
1307
1395
|
assertWarmOwner();
|
|
1308
1396
|
if (binding.preserveNativeModel || binding.connectionScope === "supervision") {
|
|
1309
1397
|
try {
|
|
1310
|
-
nativeThread = await assertAdoptedCodexThreadResumeAllowed(params, binding.threadId, options, assertWarmOwner);
|
|
1398
|
+
nativeThread = options.admittedNativeThread ?? await assertAdoptedCodexThreadResumeAllowed(params, binding.threadId, options, assertWarmOwner);
|
|
1311
1399
|
} catch (error) {
|
|
1312
1400
|
assertWarmOwner();
|
|
1313
|
-
|
|
1401
|
+
const currentBinding = await params.bindingStore.readAsync(bindingIdentity);
|
|
1402
|
+
assertWarmOwner();
|
|
1403
|
+
preserveSubscription = isSameCodexAppServerThreadOwner(currentBinding, binding);
|
|
1314
1404
|
throw error;
|
|
1315
1405
|
}
|
|
1316
1406
|
assertWarmOwner();
|
|
@@ -1329,7 +1419,7 @@ async function tryReuseCodexLiveThread(options) {
|
|
|
1329
1419
|
const pluginAppsConfigPatch = pluginThreadConfig?.configPatch ?? (params.pluginThreadConfig?.enabled && binding.pluginAppPolicyContext ? buildCodexPluginAppsConfigPatchFromPolicyContext(binding.pluginAppPolicyContext) : void 0);
|
|
1330
1420
|
const resumeAuthProfileId = binding.connectionScope === "supervision" ? void 0 : params.params.authProfileId ?? binding.authProfileId;
|
|
1331
1421
|
const resumeConfig = buildCodexThreadRequestConfig(params, options, pluginAppsConfigPatch, prebuiltFinalConfigPatch.configPatch);
|
|
1332
|
-
const resumeParams = lifecycleTiming.
|
|
1422
|
+
const resumeParams = await lifecycleTiming.measure("warm-thread-resume-params", () => options.buildResumeParams(binding, resumeAuthProfileId, resumeConfig));
|
|
1333
1423
|
options.assertInferenceConfig(resumeParams.config, resumeParams.modelProvider ?? (binding.preserveNativeModel ? nativeThread?.modelProvider?.trim() || binding.modelProvider : void 0));
|
|
1334
1424
|
const liveThreadConfigFingerprint = incognito ? retainedThread.configFingerprint : fingerprintCodexThreadConfig(resumeParams, resumeAuthProfileId, dynamicToolsFingerprint, binding);
|
|
1335
1425
|
const ephemeralPolicy = retainedThread.ephemeralPolicy;
|
|
@@ -1428,14 +1518,14 @@ async function tryReuseCodexLiveThread(options) {
|
|
|
1428
1518
|
//#endregion
|
|
1429
1519
|
//#region extensions/codex/src/app-server/thread-lifecycle-adoption.ts
|
|
1430
1520
|
/** All bound preparation follows attach's native-queue-before-binding-lease order. */
|
|
1431
|
-
async function withCodexThreadLifecycleBinding(params, run) {
|
|
1521
|
+
async function withCodexThreadLifecycleBinding(params, run, onFailure) {
|
|
1432
1522
|
const identity = sessionBindingIdentity({
|
|
1433
1523
|
sessionId: params.params.sessionId,
|
|
1434
1524
|
sessionKey: params.params.sessionKey,
|
|
1435
1525
|
agentId: params.agentId ?? params.params.agentId,
|
|
1436
1526
|
config: params.params.config
|
|
1437
1527
|
});
|
|
1438
|
-
const { binding: snapshot, authority } = await resolveCodexSessionBinding({
|
|
1528
|
+
const { binding: snapshot, authority, release } = await resolveCodexSessionBinding({
|
|
1439
1529
|
reclaimStale: true,
|
|
1440
1530
|
authority: params.authority,
|
|
1441
1531
|
bindingStore: params.bindingStore,
|
|
@@ -1449,9 +1539,10 @@ async function withCodexThreadLifecycleBinding(params, run) {
|
|
|
1449
1539
|
signal: params.signal,
|
|
1450
1540
|
assertBinding: params.params.expectedSessionRuntimeOwnership ? (binding) => assertCodexSessionRuntimeOwnership(binding, params.params.expectedSessionRuntimeOwnership) : void 0
|
|
1451
1541
|
});
|
|
1542
|
+
using _ = { [Symbol.dispose]: release };
|
|
1452
1543
|
const assertCurrent = authority.assertCurrent;
|
|
1453
1544
|
const runWithLease = () => params.bindingStore.withLease(identity, async () => {
|
|
1454
|
-
const binding = params.bindingStore.
|
|
1545
|
+
const binding = await params.bindingStore.readAsync(identity);
|
|
1455
1546
|
assertCodexSessionRuntimeOwnership(binding, params.params.expectedSessionRuntimeOwnership);
|
|
1456
1547
|
if (binding?.threadId !== snapshot?.threadId || binding?.clientId !== snapshot?.clientId) throw new CodexThreadBindingConflictError(binding?.threadId ?? snapshot?.threadId ?? params.params.sessionId, "acquiring thread lifecycle ownership");
|
|
1457
1548
|
assertCurrent();
|
|
@@ -1460,12 +1551,17 @@ async function withCodexThreadLifecycleBinding(params, run) {
|
|
|
1460
1551
|
assertCurrent,
|
|
1461
1552
|
authority
|
|
1462
1553
|
});
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1554
|
+
try {
|
|
1555
|
+
return snapshot?.pendingResumeConfiguration ? await withExclusiveCodexAppServerThread({
|
|
1556
|
+
bindingStore: params.bindingStore,
|
|
1557
|
+
identity,
|
|
1558
|
+
threadId: snapshot.threadId,
|
|
1559
|
+
run: runWithLease
|
|
1560
|
+
}) : snapshot ? await withCodexAppServerThreadMutation(snapshot.threadId, runWithLease) : await runWithLease();
|
|
1561
|
+
} catch (error) {
|
|
1562
|
+
if (onFailure) return await onFailure(error);
|
|
1563
|
+
throw error;
|
|
1564
|
+
}
|
|
1469
1565
|
}
|
|
1470
1566
|
/** Completes manual attachment only under the native queue and exact binding lease. */
|
|
1471
1567
|
async function resumePendingCodexThread(params, context) {
|
|
@@ -1622,7 +1718,7 @@ async function materializePendingSupervisionBranch(params) {
|
|
|
1622
1718
|
return await request();
|
|
1623
1719
|
} catch (error) {
|
|
1624
1720
|
if (error instanceof CodexAppServerRpcError) throw kind === "probe" ? error : new CodexThreadStartRequestError(error);
|
|
1625
|
-
throw new CodexAppServerUnsafeSubscriptionError(kind === "probe" ? "Codex model test fork may have materialized without a response" : "
|
|
1721
|
+
throw new CodexAppServerUnsafeSubscriptionError(kind === "probe" ? "Codex model test fork may have materialized without a response" : "Supervised Codex branch may have started without a response", { cause: error });
|
|
1626
1722
|
}
|
|
1627
1723
|
});
|
|
1628
1724
|
const attestRestrictedToolSurface = (threadId, config) => params.lifecycleTiming.measure("restricted-tool-surface-mcp-attestation", () => attestCodexRestrictedToolSurfaceMcpServersDisabled(params.client, threadId, config ?? void 0, params.signal));
|
|
@@ -1659,7 +1755,7 @@ async function materializePendingSupervisionBranch(params) {
|
|
|
1659
1755
|
});
|
|
1660
1756
|
} catch (error) {
|
|
1661
1757
|
try {
|
|
1662
|
-
const current = params.bindingStore.
|
|
1758
|
+
const current = await params.bindingStore.readAsync(params.bindingIdentity);
|
|
1663
1759
|
if (matchesPendingSupervisionState(current, pending)) cleanupExpected = pending;
|
|
1664
1760
|
else if (matchesPendingSupervisionState(current, expected)) cleanupExpected = expected;
|
|
1665
1761
|
else throw new CodexThreadBindingConflictError(pending.sourceThreadId, "verifying supervised Codex cleanup tracking");
|
|
@@ -1699,7 +1795,7 @@ async function materializePendingSupervisionBranch(params) {
|
|
|
1699
1795
|
...params.attempt,
|
|
1700
1796
|
modelId: nativeModel
|
|
1701
1797
|
};
|
|
1702
|
-
const startParams = buildThreadStartParams(nativeAttempt, {
|
|
1798
|
+
const startParams = await buildThreadStartParams(nativeAttempt, {
|
|
1703
1799
|
...params,
|
|
1704
1800
|
model: nativeModel,
|
|
1705
1801
|
modelProvider: nativeModelProvider
|
|
@@ -1714,7 +1810,7 @@ async function materializePendingSupervisionBranch(params) {
|
|
|
1714
1810
|
threadId: readSupervisionResponseThreadId(rawStartResponse),
|
|
1715
1811
|
sourceThreadId: pending.sourceThreadId,
|
|
1716
1812
|
otherThreadId: probeThreadId,
|
|
1717
|
-
role: "
|
|
1813
|
+
role: "supervised branch"
|
|
1718
1814
|
});
|
|
1719
1815
|
await trackPendingSupervisionArtifacts([finalThreadId]);
|
|
1720
1816
|
params.throwIfAborted();
|
|
@@ -1752,7 +1848,7 @@ async function materializePendingSupervisionBranch(params) {
|
|
|
1752
1848
|
params.throwIfAborted();
|
|
1753
1849
|
}
|
|
1754
1850
|
const historyCoveredThrough = (/* @__PURE__ */ new Date()).toISOString();
|
|
1755
|
-
const bindingModelProvider = params.normalizeBindingModelProvider(params.attempt.authProfileId, nativeModelProvider);
|
|
1851
|
+
const bindingModelProvider = await params.normalizeBindingModelProvider(params.attempt.authProfileId, nativeModelProvider);
|
|
1756
1852
|
let committed = false;
|
|
1757
1853
|
try {
|
|
1758
1854
|
committed = await params.bindingStore.mutate(params.bindingIdentity, {
|
|
@@ -1769,16 +1865,16 @@ async function materializePendingSupervisionBranch(params) {
|
|
|
1769
1865
|
} catch (error) {
|
|
1770
1866
|
let current;
|
|
1771
1867
|
try {
|
|
1772
|
-
current = params.bindingStore.
|
|
1868
|
+
current = await params.bindingStore.readAsync(params.bindingIdentity);
|
|
1773
1869
|
} catch (readError) {
|
|
1774
1870
|
provisionalCleanupSafe = false;
|
|
1775
|
-
throw new CodexAppServerUnsafeSubscriptionError(`
|
|
1871
|
+
throw new CodexAppServerUnsafeSubscriptionError(`Supervised Codex branch binding could not be verified: ${finalThreadId}`, { cause: new AggregateError([error, readError]) });
|
|
1776
1872
|
}
|
|
1777
1873
|
if (current?.threadId === finalThreadId && current.connectionScope === "supervision" && current.supervisionSourceThreadId === pending.sourceThreadId && current.appServerRuntimeFingerprint === connectionFingerprint && current.pendingSupervisionBranch === void 0 && current.model === nativeModel && current.modelProvider === bindingModelProvider && current.historyCoveredThrough === historyCoveredThrough) committed = true;
|
|
1778
1874
|
else {
|
|
1779
1875
|
if (!matchesPendingSupervisionState(current, pending)) {
|
|
1780
1876
|
provisionalCleanupSafe = false;
|
|
1781
|
-
throw new CodexAppServerUnsafeSubscriptionError(`
|
|
1877
|
+
throw new CodexAppServerUnsafeSubscriptionError(`Supervised Codex branch binding changed while commit was uncertain: ${finalThreadId}`, { cause: error });
|
|
1782
1878
|
}
|
|
1783
1879
|
throw error;
|
|
1784
1880
|
}
|
|
@@ -1890,7 +1986,7 @@ async function startOrResumeThread(input) {
|
|
|
1890
1986
|
const incognito = isIncognitoSessionKey(input.params.sessionKey);
|
|
1891
1987
|
const clientId = resolveCodexAppServerClientInstanceId(input.client);
|
|
1892
1988
|
let cleanupWarmBinding;
|
|
1893
|
-
const
|
|
1989
|
+
const prepare = async (bindingIdentity, saved, authority) => {
|
|
1894
1990
|
const assert = authority.assertCurrent;
|
|
1895
1991
|
const params = {
|
|
1896
1992
|
...input,
|
|
@@ -1912,7 +2008,7 @@ async function startOrResumeThread(input) {
|
|
|
1912
2008
|
assert();
|
|
1913
2009
|
}
|
|
1914
2010
|
});
|
|
1915
|
-
if (!isDeepStrictEqual(params.dynamicTools, nativeCatalog)) throw new Error("
|
|
2011
|
+
if (!isDeepStrictEqual(params.dynamicTools, nativeCatalog)) throw new Error("Saved Codex declarations changed after tool preparation; retry the turn on its preserved native thread.");
|
|
1916
2012
|
}
|
|
1917
2013
|
const preflight = await prepareCodexThreadLifecyclePreflight(params);
|
|
1918
2014
|
const callerConfig = params.config;
|
|
@@ -1921,6 +2017,7 @@ async function startOrResumeThread(input) {
|
|
|
1921
2017
|
const initialBoundThreadId = binding?.threadId;
|
|
1922
2018
|
const initialBoundClientId = binding?.clientId;
|
|
1923
2019
|
const throwIfAborted = () => throwIfCodexThreadLifecycleAborted(params.signal);
|
|
2020
|
+
let serviceTierAdmission;
|
|
1924
2021
|
const prepareRequestContext = async () => {
|
|
1925
2022
|
const context = await prepareCodexThreadRequestContext(params, {
|
|
1926
2023
|
binding,
|
|
@@ -1929,9 +2026,11 @@ async function startOrResumeThread(input) {
|
|
|
1929
2026
|
clientId,
|
|
1930
2027
|
config: callerConfig,
|
|
1931
2028
|
preflight,
|
|
2029
|
+
serviceTierAdmission,
|
|
1932
2030
|
assertCurrent: assert,
|
|
1933
2031
|
throwIfAborted
|
|
1934
2032
|
});
|
|
2033
|
+
serviceTierAdmission = context.serviceTierAdmission;
|
|
1935
2034
|
params.refreshableInstructions = params.inferenceRoute ? void 0 : input.refreshableInstructions;
|
|
1936
2035
|
return context;
|
|
1937
2036
|
};
|
|
@@ -2191,17 +2290,15 @@ async function startOrResumeThread(input) {
|
|
|
2191
2290
|
});
|
|
2192
2291
|
if (replacementPredecessor && !preserveExistingBinding && configuredMcpOwnershipChanged) await releaseRetainedThread(replacementPredecessor.threadId, replacementPredecessor.clientId);
|
|
2193
2292
|
return publishCodexThreadInferenceBinding(params, started);
|
|
2194
|
-
}
|
|
2195
|
-
|
|
2196
|
-
return await prep;
|
|
2197
|
-
} catch (error) {
|
|
2293
|
+
};
|
|
2294
|
+
return withCodexThreadLifecycleBinding(input, prepare, async (error) => {
|
|
2198
2295
|
if (cleanupWarmBinding) try {
|
|
2199
2296
|
await cleanupWarmBinding();
|
|
2200
2297
|
} catch (releaseError) {
|
|
2201
2298
|
throw new AggregateError([error, releaseError], "Codex warm thread preparation and subscription cleanup failed", { cause: releaseError });
|
|
2202
2299
|
}
|
|
2203
2300
|
throw error;
|
|
2204
|
-
}
|
|
2301
|
+
});
|
|
2205
2302
|
}
|
|
2206
2303
|
//#endregion
|
|
2207
2304
|
export { prepareCodexPluginThreadConfigStartupProvider as a, buildLegacyScheduledCodexAppRecoveryPrompt as c, resolveScheduledCodexAppCreatorCaptureDecision as d, isContextEngineBindingCompatible as i, buildScheduledCodexAppServerConnectionIdentity as l, isCodexAppServerProfilerEnabled as n, resolveCodexPluginThreadConfigStartupPolicy as o, buildContextEngineBinding as r, assertScheduledCodexAppAuthorityRuntime as s, startOrResumeThread as t, captureScheduledCodexAppAuthority as u };
|
package/dist/.setup/{thread-model-selection-DcVebr8N.mjs → thread-model-selection-DxposL4X.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as isCodexAppServerNativeAuthProfile } from "./auth-profile-
|
|
2
|
-
import { i as isCodexResponsesOAuthCredential, t as CODEX_RESPONSES_OAUTH_PROVIDER } from "./responses-oauth-
|
|
1
|
+
import { t as isCodexAppServerNativeAuthProfile } from "./auth-profile-auwzSwwy.mjs";
|
|
2
|
+
import { i as isCodexResponsesOAuthCredential, t as CODEX_RESPONSES_OAUTH_PROVIDER } from "./responses-oauth-CCV7aVYF.mjs";
|
|
3
3
|
//#region extensions/codex/src/app-server/thread-model-selection.ts
|
|
4
4
|
const CODEX_NATIVE_PERSONALITY_NONE = "none";
|
|
5
5
|
function resolveCodexBindingModelProviderFallback(params) {
|
|
@@ -11,9 +11,9 @@ function resolveCodexBindingModelProviderFallback(params) {
|
|
|
11
11
|
const slashIndex = currentModel?.indexOf("/") ?? -1;
|
|
12
12
|
return slashIndex > 0 && slashIndex < (currentModel?.length ?? 0) - 1 ? void 0 : params.bindingModelProvider;
|
|
13
13
|
}
|
|
14
|
-
function resolveCodexAppServerThreadModelSelection(params) {
|
|
14
|
+
async function resolveCodexAppServerThreadModelSelection(params) {
|
|
15
15
|
const authProfileId = params.inheritBindingAuthProfile === false ? params.authProfileId : params.authProfileId ?? params.binding?.authProfileId;
|
|
16
|
-
const explicitModelProvider = resolveCodexAppServerModelProvider({
|
|
16
|
+
const explicitModelProvider = await resolveCodexAppServerModelProvider({
|
|
17
17
|
...params,
|
|
18
18
|
authProfileId
|
|
19
19
|
});
|
|
@@ -23,14 +23,14 @@ function resolveCodexAppServerThreadModelSelection(params) {
|
|
|
23
23
|
bindingModel: params.binding.model,
|
|
24
24
|
bindingModelProvider: params.binding.modelProvider
|
|
25
25
|
}) : void 0;
|
|
26
|
-
return resolveCodexAppServerRequestModelSelection({
|
|
26
|
+
return await resolveCodexAppServerRequestModelSelection({
|
|
27
27
|
...params,
|
|
28
28
|
model: params.requestModel ?? params.model,
|
|
29
29
|
modelProvider: explicitModelProvider ?? bindingModelProvider,
|
|
30
30
|
authProfileId
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function resolveCodexAppServerRequestModelSelection(params) {
|
|
33
|
+
async function resolveCodexAppServerRequestModelSelection(params) {
|
|
34
34
|
const model = params.model.trim();
|
|
35
35
|
const modelProvider = params.modelProvider?.trim();
|
|
36
36
|
if (modelProvider) return {
|
|
@@ -40,7 +40,7 @@ function resolveCodexAppServerRequestModelSelection(params) {
|
|
|
40
40
|
const slashIndex = model.indexOf("/");
|
|
41
41
|
if (slashIndex <= 0 || slashIndex >= model.length - 1) return { model };
|
|
42
42
|
const inferredProvider = model.slice(0, slashIndex);
|
|
43
|
-
const inferredModelProvider = resolveCodexAppServerModelProvider({
|
|
43
|
+
const inferredModelProvider = await resolveCodexAppServerModelProvider({
|
|
44
44
|
...params,
|
|
45
45
|
provider: inferredProvider
|
|
46
46
|
});
|
|
@@ -49,12 +49,12 @@ function resolveCodexAppServerRequestModelSelection(params) {
|
|
|
49
49
|
...inferredModelProvider ? { modelProvider: inferredModelProvider } : {}
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function resolveCodexAppServerModelProvider(params) {
|
|
52
|
+
async function resolveCodexAppServerModelProvider(params) {
|
|
53
53
|
const normalized = params.provider.trim();
|
|
54
54
|
const normalizedLower = normalized.toLowerCase();
|
|
55
55
|
if (normalizedLower === "openai" && params.authProfileId && isCodexResponsesOAuthCredential(params.authProfileStore?.profiles[params.authProfileId])) return CODEX_RESPONSES_OAUTH_PROVIDER;
|
|
56
56
|
if (!normalized || normalizedLower === "codex") return;
|
|
57
|
-
if (normalizedLower === "openai" && (params.homeScope === "user" || isCodexAppServerNativeAuthProfile(params))) return;
|
|
57
|
+
if (normalizedLower === "openai" && (params.homeScope === "user" || await isCodexAppServerNativeAuthProfile(params))) return;
|
|
58
58
|
return normalizedLower === "openai" ? "openai" : normalized;
|
|
59
59
|
}
|
|
60
60
|
//#endregion
|