@openclaw/codex 2026.8.1-beta.3 → 2026.9.1-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/dist/api.js +3 -3
- package/dist/{attempt-client-cleanup-URjUlCHg.js → attempt-client-cleanup-bfsmcQ6m.js} +21 -2
- package/dist/{binding-connection-DAvZwp96.js → binding-connection-BMvPX73o.js} +2 -2
- package/dist/{bounded-turn-4BjrZEwW.js → bounded-turn-B7iBUcuP.js} +8 -8
- package/dist/{capabilities-CH3K57v4.js → capabilities-BRMh0aIq.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-D0nZ3qtd.js → command-formatters-DEsIufkt.js} +2 -2
- package/dist/{command-handlers-DC86lgT4.js → command-handlers-D_-1_qRp.js} +43 -32
- package/dist/{command-rpc-xUIIonsO.js → command-rpc-CCeCkf_v.js} +4 -4
- package/dist/{compact-COqgBRny.js → compact-BglNFZrQ.js} +8 -8
- package/dist/{config-CpNeo5AE.js → config-giW8X0QA.js} +82 -28
- package/dist/doctor-contract-api.js +9 -8
- package/dist/{dynamic-tools-fJZhl4CE.js → dynamic-tools-Dnlfa--w.js} +108 -820
- package/dist/{effective-mcp-catalog-4YKn51aG.js → effective-mcp-catalog-CTeGrnfO.js} +2 -2
- package/dist/{event-projector-assistant-message-BwxV4d6N.js → event-projector-assistant-message-C5-Ds8mA.js} +18 -1
- package/dist/{event-projector-usage-CLwNEJqW.js → event-projector-usage-Bk1I90Bg.js} +3 -3
- package/dist/{harness-DoKQcF8n.js → harness-Csz0F-DK.js} +11 -11
- package/dist/harness.js +1 -1
- package/dist/index.js +130 -172
- package/dist/{isolated-completion-DPMtlH9r.js → isolated-completion-Cv6FqygM.js} +4 -4
- package/dist/{managed-binary-By4FZC6i.js → managed-binary-DFYK4DWq.js} +43 -7
- package/dist/media-understanding-provider.js +1 -1
- package/dist/{model-catalog-CmGoqVKB.js → model-catalog-i9rNBthX.js} +4 -4
- package/dist/{models-CZw1wClT.js → models-TS3HBU-q.js} +4 -3
- package/dist/{native-subagent-monitor-GGq3RnOo.js → native-subagent-monitor-4Mfq2HDs.js} +176 -19
- package/dist/{node-exec-server.runtime-Bsu1LdFZ.js → node-exec-server.runtime-BpWqJO1V.js} +2 -2
- package/dist/{plugin-app-cache-key-DMNQ8Zi8.js → plugin-app-cache-key-C1CAdfcP.js} +6 -3
- package/dist/{plugin-approval-roundtrip-C75Yiiwc.js → plugin-approval-roundtrip-bUm777tR.js} +1 -1
- package/dist/{plugin-marketplace-discovery-CSWDkMrP.js → plugin-marketplace-discovery-B9DvaAG-.js} +29 -38
- package/dist/{plugin-metadata-cache-BXH5NF-4.js → plugin-metadata-cache-CTCT3w5L.js} +162 -135
- package/dist/{protocol-validators-VAVyEnDp.js → protocol-validators-VeJxxJ0U.js} +25 -3
- package/dist/{rate-limits-BI1dMHDG.js → rate-limits-C5_D8Gmb.js} +1 -1
- package/dist/{request-DSK0W6YI.js → request-DXXGHko0.js} +2 -2
- package/dist/{run-attempt-BV3HzuCf.js → run-attempt-DYc0QCBF.js} +346 -267
- package/dist/{sandbox-guard-C1qEeZ5C.js → sandbox-guard-kuWTn9C5.js} +1 -1
- package/dist/{session-binding-BTrLf9Qm.js → session-binding-Bcynfd-_.js} +1 -1
- package/dist/{session-catalog-ezP_UcRM.js → session-catalog-DaLKVtpH.js} +17 -16
- package/dist/{session-cli-B1hKvfkI.js → session-cli-DMc4oS2w.js} +1 -1
- package/dist/session-permission-policy-BrNH1bjy.js +160 -0
- package/dist/{session-retirement-CE4iMiLh.js → session-retirement-CcNC3YSY.js} +3 -3
- package/dist/{session-upstream-marker-D_2npHlA.js → session-upstream-marker-BIkusb95.js} +1 -1
- package/dist/{settled-turn-finalizer-Dx1onIqg.js → settled-turn-finalizer-Dc3ApjU4.js} +4 -4
- package/dist/{shared-client-Dw-rzii0.js → shared-client-DKz23hHY.js} +1026 -248
- package/dist/{side-question-DbXkJZzg.js → side-question-DjA_jsNe.js} +65 -36
- package/dist/{thread-lifecycle-DKdrnTMX.js → thread-lifecycle-L7oEkTlq.js} +850 -35
- package/dist/{thread-ownership-i2NBwDUL.js → thread-ownership-DZeuKH1j.js} +2 -2
- package/dist/{thread-resume-CdJk2Ehf.js → thread-resume-BE9qNEW0.js} +3 -3
- package/dist/{transcript-mirror-BU0_LKAL.js → transcript-mirror-DsCMWBca.js} +91 -10
- package/dist/{upstream-session-fork-BDVJCLAD.js → upstream-session-fork-DlaHxSLC.js} +3 -3
- package/dist/{usage-9dKJCgcy.js → usage-ROIaW3wo.js} +3 -3
- package/dist/{web-search-provider.runtime-DCdx4DGu.js → web-search-provider.runtime-ClaNPV7N.js} +3 -3
- package/openclaw.plugin.json +18 -1
- package/package.json +8 -8
- package/dist/app-server-policy-bg5QPSVP.js +0 -25
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { registerCodexCliMetadata } from "./cli-metadata.js";
|
|
2
|
-
import { n as createCodexAppServerNativeCompaction, t as createCodexAppServerAgentHarness } from "./harness-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { n as createCodexAppServerNativeCompaction, t as createCodexAppServerAgentHarness } from "./harness-Csz0F-DK.js";
|
|
3
|
+
import { D as readCodexRequirementsToml, _ as CODEX_PLUGINS_MARKETPLACE_NAME, c as assertCodexAppServerConnectionSecurity, h as readCodexPluginConfig, i as resolveCodexAppServerRuntimeOptions, j as resolveOpenClawExecPolicyForCodexAppServer, n as codexSandboxPolicyForTurn, s as resolveCodexSupervisionAppServerRuntimeOptions, t as codexAppServerStartOptionsKey, x as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-giW8X0QA.js";
|
|
4
|
+
import { $ as releaseCodexAppServerLiveThread, C as createCodexDesktopGenerationService, H as isUnsupportedCodexAppServerVersionError, J as consumeCodexAppServerLiveThread, R as isCodexAppServerIndeterminateRequestCancellationError, X as isCodexAppServerClientRuntimeLive, Z as isCodexAppServerLiveThreadClaimed, ct as resolveCodexAppServerAuthAccountCacheKey, dt as resolveCodexAppServerFallbackApiKeyCacheKey, f as releaseCodexAppServerClientLease, h as retainSharedCodexAppServerClientByInstanceId, ht as CODEX_INTERACTIVE_THREAD_SOURCE_KINDS, i as clearSharedCodexAppServerClientIfCurrentAndWait, o as getLeasedSharedCodexAppServerClient, p as releaseLeasedSharedCodexAppServerClient, ut as resolveCodexAppServerAuthProfileIdForAgent, v as retireSharedCodexAppServerClientsBeforeDesktopGeneration, vt as isJsonObject, x as withLeasedCodexAppServerClientStartSelectionRetry } from "./shared-client-DKz23hHY.js";
|
|
5
|
+
import { i as setManagedCodexPluginRoot } from "./managed-binary-DFYK4DWq.js";
|
|
5
6
|
import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.js";
|
|
6
|
-
import { d as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as isCodexAppServerNativeAuthProfile, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { $ as ensureCodexPluginActivation, C as CODEX_MANAGED_THREAD_NAMESPACE, S as CODEX_MANAGED_THREAD_MAX_ENTRIES, Y as buildDisabledAppsConfigPatch, Z as mergeCodexThreadConfigs, _ as resolveCodexAppServerRequestModelSelection, h as CODEX_NATIVE_PERSONALITY_NONE, m as buildCodexProjectDocThreadConfig, rt as pluginReadParams, tt as isOpenAiCuratedMarketplace, w as createCodexManagedThreadStore } from "./thread-lifecycle-DKdrnTMX.js";
|
|
7
|
+
import { d as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as isCodexAppServerNativeAuthProfile, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-Bcynfd-_.js";
|
|
8
|
+
import { a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, h as isCodexNotificationForTurn, o as interruptCodexTurnAndWaitBestEffort, p as getCodexAppServerTurnRouter, u as retireUnsafeCodexTurnClientBestEffort } from "./attempt-client-cleanup-bfsmcQ6m.js";
|
|
9
|
+
import { s as isAssistantCommentaryCompletionNotification } from "./event-projector-usage-Bk1I90Bg.js";
|
|
10
|
+
import { a as assertCodexThreadStartResponse } from "./protocol-validators-VeJxxJ0U.js";
|
|
11
|
+
import { o as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-C1CAdfcP.js";
|
|
12
|
+
import { B as resolveCodexAppServerRequestModelSelection, Et as pluginReadParams, G as CODEX_MANAGED_THREAD_MAX_ENTRIES, K as CODEX_MANAGED_THREAD_NAMESPACE, L as buildCodexProjectDocThreadConfig, R as CODEX_NATIVE_PERSONALITY_NONE, St as ensureCodexPluginActivation, bt as mergeCodexThreadConfigs, q as createCodexManagedThreadStore, vt as buildDisabledAppsConfigPatch, wt as isOpenAiCuratedMarketplace } from "./thread-lifecycle-L7oEkTlq.js";
|
|
13
13
|
import { t as isIncognitoSessionKey } from "./incognito-session-ET_ufDH-.js";
|
|
14
|
-
import { t as resumeCodexAppServerThread } from "./thread-resume-
|
|
15
|
-
import { d as projectBoundedCodexVisibleSessionHistory } from "./transcript-mirror-
|
|
14
|
+
import { t as resumeCodexAppServerThread } from "./thread-resume-BE9qNEW0.js";
|
|
15
|
+
import { d as projectBoundedCodexVisibleSessionHistory } from "./transcript-mirror-DsCMWBca.js";
|
|
16
16
|
import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
17
|
-
import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-
|
|
18
|
-
import { r as formatCodexDisplayText } from "./command-formatters-
|
|
19
|
-
import {
|
|
20
|
-
import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-
|
|
21
|
-
import { a as rollbackCodexAppServerBindingSubscription, i as retireCodexConversationThreadBinding, n as releaseCodexAppServerBindingSubscription, o as withCodexConversationThreadActivity, r as retainCodexAppServerBindingSubscription, s as withExclusiveCodexAppServerThread, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-
|
|
22
|
-
import { f as trackCodexConversationActiveTurn,
|
|
17
|
+
import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-BRMh0aIq.js";
|
|
18
|
+
import { r as formatCodexDisplayText } from "./command-formatters-DEsIufkt.js";
|
|
19
|
+
import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-BrNH1bjy.js";
|
|
20
|
+
import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-kuWTn9C5.js";
|
|
21
|
+
import { a as rollbackCodexAppServerBindingSubscription, i as retireCodexConversationThreadBinding, n as releaseCodexAppServerBindingSubscription, o as withCodexConversationThreadActivity, r as retainCodexAppServerBindingSubscription, s as withExclusiveCodexAppServerThread, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-DZeuKH1j.js";
|
|
22
|
+
import { f as trackCodexConversationActiveTurn, g as canMutateCodexHost, h as CODEX_NATIVE_EXECUTION_AUTH_ERROR, t as discoverCodexMarketplacePlugins } from "./plugin-marketplace-discovery-B9DvaAG-.js";
|
|
23
23
|
import { a as readCodexConversationBindingDataRecord, i as readCodexConversationBindingData, o as resolveCodexDefaultWorkspaceDir, r as createCodexConversationBindingData } from "./conversation-binding-data-CW2GuupV.js";
|
|
24
|
-
import { n as resolveCodexBindingAppServerConnection } from "./binding-connection-
|
|
25
|
-
import { c as createCodexCliSessionNodeInvokePolicies, d as resolveCodexCliSessionForBindingOnNode, f as resumeCodexCliSessionOnNode, i as createCodexSessionCatalogNodeHostCommands, n as createCodexSessionCatalogNodeInvokePolicies, o as assertCodexArchiveDescendantsUnowned, r as createCodexSessionCatalogControl, s as createCodexCliSessionNodeHostCommands, t as codexSessionCatalogRuntime, u as listCodexCliSessionsOnNode } from "./session-catalog-
|
|
26
|
-
import { i as withCodexAppServerJsonClient, r as requestCodexAppServerJson } from "./request-
|
|
27
|
-
import { t as codexControlRequest } from "./command-rpc-
|
|
24
|
+
import { n as resolveCodexBindingAppServerConnection } from "./binding-connection-BMvPX73o.js";
|
|
25
|
+
import { c as createCodexCliSessionNodeInvokePolicies, d as resolveCodexCliSessionForBindingOnNode, f as resumeCodexCliSessionOnNode, i as createCodexSessionCatalogNodeHostCommands, n as createCodexSessionCatalogNodeInvokePolicies, o as assertCodexArchiveDescendantsUnowned, r as createCodexSessionCatalogControl, s as createCodexCliSessionNodeHostCommands, t as codexSessionCatalogRuntime, u as listCodexCliSessionsOnNode } from "./session-catalog-DaLKVtpH.js";
|
|
26
|
+
import { i as withCodexAppServerJsonClient, r as requestCodexAppServerJson } from "./request-DXXGHko0.js";
|
|
27
|
+
import { t as codexControlRequest } from "./command-rpc-CCeCkf_v.js";
|
|
28
28
|
import { t as createCodexWebSearchProviderBase } from "./web-search-provider.shared-BrZmlqyR.js";
|
|
29
29
|
import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
|
|
30
30
|
import { normalizePluginsConfig, resolveEffectiveEnableState, resolveLivePluginConfigObject, resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
@@ -37,14 +37,13 @@ import { embeddedAgentLog, formatErrorMessage, resolveActiveEmbeddedRunSessionId
|
|
|
37
37
|
import os from "node:os";
|
|
38
38
|
import { loadAuthProfileStoreWithoutExternalProfiles, resolveAgentConfig, resolveAgentWorkspaceDir, resolveDefaultAgentDir, resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime";
|
|
39
39
|
import { applyAuthProfileConfig, buildApiKeyCredential, buildOauthProviderAuthResult, buildOpenAICodexCredentialExtra, readCodexCliCredentialsCached, resolveOpenAICodexAuthIdentity, resolveOpenAICodexImportProfileName, updateAuthProfileStoreWithLock } from "openclaw/plugin-sdk/provider-auth";
|
|
40
|
-
import { resolveSessionAgentIds as resolveSessionAgentIds$2
|
|
40
|
+
import { resolveSessionAgentIds as resolveSessionAgentIds$2 } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
41
41
|
import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
42
42
|
import { extractErrorCode, pathExists } from "openclaw/plugin-sdk/security-runtime";
|
|
43
43
|
import { getSessionEntry, resolveStorePath, resolveTranscriptSessionKeyBySessionId } from "openclaw/plugin-sdk/session-store-runtime";
|
|
44
44
|
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
45
45
|
import { fileURLToPath } from "node:url";
|
|
46
46
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
47
|
-
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
48
47
|
import { canonicalPathFromExistingAncestor, isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
|
|
49
48
|
import { readVisibleSessionTranscriptMessageEntries } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
50
49
|
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
@@ -185,7 +184,7 @@ function waitForReconnect(delayMs, signal) {
|
|
|
185
184
|
/** Defers schema compilation and auth loading until the first binding operation. */
|
|
186
185
|
function createLazyCodexAppServerBindingStore(state, managedThreadState) {
|
|
187
186
|
let resolved;
|
|
188
|
-
const store = () => resolved ??= import("./session-binding-
|
|
187
|
+
const store = () => resolved ??= import("./session-binding-Bcynfd-_.js").then((n) => n.f).then(({ createCodexAppServerBindingStore }) => createCodexAppServerBindingStore(state));
|
|
189
188
|
const managedThreads = managedThreadState ? createCodexManagedThreadStore(managedThreadState) : void 0;
|
|
190
189
|
return {
|
|
191
190
|
...managedThreads ? { managedThreads } : {},
|
|
@@ -215,7 +214,7 @@ async function handleCodexCommand(ctx, options) {
|
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
216
|
async function loadDefaultCodexSubcommandHandler() {
|
|
218
|
-
const { handleCodexSubcommand } = await import("./command-handlers-
|
|
217
|
+
const { handleCodexSubcommand } = await import("./command-handlers-D_-1_qRp.js");
|
|
219
218
|
return handleCodexSubcommand;
|
|
220
219
|
}
|
|
221
220
|
//#endregion
|
|
@@ -416,26 +415,73 @@ function readLocalMediaPath(value) {
|
|
|
416
415
|
const DEFAULT_BOUND_TURN_TIMEOUT_MS = 20 * 6e4;
|
|
417
416
|
const NATIVE_CONVERSATION_INTERACTIVE_APPROVALS_UNAVAILABLE = "OpenClaw native Codex conversation binding cannot route interactive approvals yet; use the Codex harness or explicit /acp spawn codex for that workflow.";
|
|
418
417
|
async function resolveConversationAppServerRuntime(params) {
|
|
419
|
-
const
|
|
418
|
+
const source = params.source;
|
|
419
|
+
const agentId = source?.agentId ?? params.agentId ?? (params.config ? resolveSessionAgentIds$2({
|
|
420
|
+
sessionKey: params.sessionKey,
|
|
421
|
+
config: params.config
|
|
422
|
+
}).sessionAgentId : void 0);
|
|
423
|
+
const storePath = agentId && (source || params.sessionKey) ? resolveStorePath(params.config?.session?.store, { agentId }) : void 0;
|
|
424
|
+
const sessionKey = source ? source.sessionKey ?? (storePath ? resolveTranscriptSessionKeyBySessionId({
|
|
425
|
+
agentId: source.agentId,
|
|
426
|
+
sessionId: source.sessionId,
|
|
427
|
+
storePath
|
|
428
|
+
}) : void 0) : params.sessionKey;
|
|
429
|
+
const storedEntry = sessionKey && storePath ? getSessionEntry({
|
|
430
|
+
agentId,
|
|
431
|
+
storePath,
|
|
432
|
+
sessionKey,
|
|
433
|
+
readConsistency: "latest"
|
|
434
|
+
}) : void 0;
|
|
435
|
+
const entry = !source || storedEntry?.sessionId === source.sessionId ? storedEntry : void 0;
|
|
436
|
+
if (source && !entry) throw new Error("Codex conversation source session is missing or no longer current; rebind this conversation before retrying.");
|
|
437
|
+
const permissionMode = entry?.permissionMode;
|
|
438
|
+
const sessionRoot = permissionMode ? entry?.sessionRoot : void 0;
|
|
439
|
+
const agentWorkspaceDir = params.config && agentId ? resolveAgentWorkspaceDir(params.config, agentId) : resolveCodexDefaultWorkspaceDir(params.pluginConfig);
|
|
440
|
+
const execPolicy = resolveOpenClawExecPolicyForCodexAppServer({
|
|
420
441
|
config: params.config,
|
|
421
|
-
agentId
|
|
422
|
-
|
|
442
|
+
agentId,
|
|
443
|
+
permissionMode,
|
|
444
|
+
execOverrides: permissionMode ? { mode: CODEX_SESSION_PERMISSION_EXEC_MODES[permissionMode] } : void 0,
|
|
445
|
+
approvals: permissionMode === "full" ? void 0 : loadExecApprovals()
|
|
423
446
|
});
|
|
424
447
|
const sandboxForPolicy = execPolicy.touched && execPolicy.security === "full" && execPolicy.ask !== "off" ? await resolveSandboxContext({
|
|
425
448
|
config: params.config,
|
|
426
|
-
sessionKey
|
|
427
|
-
workspaceDir:
|
|
449
|
+
sessionKey,
|
|
450
|
+
workspaceDir: agentWorkspaceDir
|
|
428
451
|
}) : void 0;
|
|
429
|
-
|
|
452
|
+
const configuredRuntime = resolveCodexAppServerRuntimeOptions({
|
|
453
|
+
pluginConfig: params.pluginConfig,
|
|
430
454
|
execPolicy,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
455
|
+
modelProvider: params.modelProvider,
|
|
456
|
+
model: params.model,
|
|
457
|
+
config: params.config,
|
|
458
|
+
agentDir: params.agentDir,
|
|
459
|
+
openClawSandboxActive: Boolean(sandboxForPolicy?.enabled)
|
|
460
|
+
});
|
|
461
|
+
const canUseAutoReview = canUseCodexModelBackedApprovalsReviewerForModel({
|
|
462
|
+
modelProvider: params.modelProvider,
|
|
463
|
+
model: params.model,
|
|
464
|
+
config: params.config,
|
|
465
|
+
env: process.env,
|
|
466
|
+
agentDir: params.agentDir
|
|
467
|
+
});
|
|
468
|
+
return {
|
|
469
|
+
runtime: applyCodexSessionPermissionPolicy({
|
|
470
|
+
appServer: configuredRuntime,
|
|
471
|
+
permissionMode,
|
|
472
|
+
sessionRoot,
|
|
473
|
+
defaultRoot: agentWorkspaceDir,
|
|
474
|
+
pluginConfig: readCodexPluginConfig(params.pluginConfig),
|
|
475
|
+
canUseAutoReview,
|
|
476
|
+
requirementsToml: readCodexRequirementsToml({}),
|
|
477
|
+
execMode: execPolicy.mode
|
|
478
|
+
}),
|
|
479
|
+
workspaceDir: resolveCodexSessionPermissionCwd({
|
|
480
|
+
permissionMode,
|
|
481
|
+
sessionRoot,
|
|
482
|
+
defaultRoot: agentWorkspaceDir,
|
|
483
|
+
requestedCwd: params.workspaceDir,
|
|
484
|
+
fallbackCwd: params.workspaceDir
|
|
439
485
|
})
|
|
440
486
|
};
|
|
441
487
|
}
|
|
@@ -476,8 +522,6 @@ async function startCodexConversationThread(params) {
|
|
|
476
522
|
model: params.model,
|
|
477
523
|
modelProvider: params.modelProvider,
|
|
478
524
|
authProfileId,
|
|
479
|
-
approvalPolicy: params.approvalPolicy,
|
|
480
|
-
sandbox: params.sandbox,
|
|
481
525
|
serviceTier: params.serviceTier,
|
|
482
526
|
config: params.config,
|
|
483
527
|
sessionKey: params.sessionKey,
|
|
@@ -493,8 +537,6 @@ async function startCodexConversationThread(params) {
|
|
|
493
537
|
model: params.model,
|
|
494
538
|
modelProvider: params.modelProvider,
|
|
495
539
|
authProfileId,
|
|
496
|
-
approvalPolicy: params.approvalPolicy,
|
|
497
|
-
sandbox: params.sandbox,
|
|
498
540
|
serviceTier: params.serviceTier,
|
|
499
541
|
config: params.config,
|
|
500
542
|
sessionKey: params.sessionKey,
|
|
@@ -639,11 +681,12 @@ async function resolveThreadBindingRuntime(params) {
|
|
|
639
681
|
modelProvider: params.modelProvider,
|
|
640
682
|
...agentLookup
|
|
641
683
|
});
|
|
642
|
-
const {
|
|
684
|
+
const { runtime, workspaceDir } = await resolveConversationAppServerRuntime({
|
|
643
685
|
pluginConfig: params.pluginConfig,
|
|
644
686
|
config: params.config,
|
|
645
687
|
agentId: params.agentId,
|
|
646
688
|
sessionKey: params.sessionKey,
|
|
689
|
+
source: params.source,
|
|
647
690
|
workspaceDir: params.workspaceDir,
|
|
648
691
|
modelProvider: reviewerModelProvider,
|
|
649
692
|
model: params.model,
|
|
@@ -657,18 +700,7 @@ async function resolveThreadBindingRuntime(params) {
|
|
|
657
700
|
env: process.env,
|
|
658
701
|
agentDir: params.agentDir
|
|
659
702
|
});
|
|
660
|
-
assertNativeConversationApprovalPolicySupported(
|
|
661
|
-
execPolicy,
|
|
662
|
-
approvalPolicy: execPolicy?.touched ? modelScopedRuntime.approvalPolicy : params.approvalPolicy ?? modelScopedRuntime.approvalPolicy,
|
|
663
|
-
approvalsReviewer: modelScopedRuntime.approvalsReviewer,
|
|
664
|
-
modelBackedApprovalsReviewerUnavailable: !canUseCodexModelBackedApprovalsReviewerForModel({
|
|
665
|
-
modelProvider: reviewerModelProvider,
|
|
666
|
-
model: params.model,
|
|
667
|
-
config: params.config,
|
|
668
|
-
env: process.env,
|
|
669
|
-
agentDir: params.agentDir
|
|
670
|
-
})
|
|
671
|
-
});
|
|
703
|
+
assertNativeConversationApprovalPolicySupported(modelScopedRuntime);
|
|
672
704
|
const clientOptions = {
|
|
673
705
|
startOptions: runtime.start,
|
|
674
706
|
timeoutMs: runtime.requestTimeoutMs,
|
|
@@ -677,8 +709,8 @@ async function resolveThreadBindingRuntime(params) {
|
|
|
677
709
|
};
|
|
678
710
|
const client = await getLeasedSharedCodexAppServerClient(clientOptions);
|
|
679
711
|
return {
|
|
680
|
-
execPolicy,
|
|
681
712
|
runtime: modelScopedRuntime,
|
|
713
|
+
workspaceDir,
|
|
682
714
|
agentLookup,
|
|
683
715
|
model: modelSelection?.model,
|
|
684
716
|
modelProvider: modelSelection?.modelProvider ?? modelProvider,
|
|
@@ -689,11 +721,11 @@ async function resolveThreadBindingRuntime(params) {
|
|
|
689
721
|
}
|
|
690
722
|
function buildThreadRequestRuntimeOptions(params, resolved) {
|
|
691
723
|
const serviceTier = params.serviceTier ?? resolved.runtime.serviceTier;
|
|
692
|
-
const sandbox = resolved.execPolicy?.touched ? resolved.runtime.sandbox : params.sandbox ?? resolved.runtime.sandbox;
|
|
693
724
|
return {
|
|
694
|
-
approvalPolicy: resolved.
|
|
725
|
+
approvalPolicy: resolved.runtime.approvalPolicy,
|
|
695
726
|
approvalsReviewer: resolved.runtime.approvalsReviewer,
|
|
696
|
-
...
|
|
727
|
+
...resolved.runtime.sessionRoot ? { runtimeWorkspaceRoots: [resolved.runtime.sessionRoot] } : {},
|
|
728
|
+
...codexConversationSandboxOrPermissions(resolved.runtime, resolved.runtime.sandbox),
|
|
697
729
|
...serviceTier ? { serviceTier } : {}
|
|
698
730
|
};
|
|
699
731
|
}
|
|
@@ -711,7 +743,7 @@ async function requestNewConversationBindingThread(params, resolved) {
|
|
|
711
743
|
lease: resolved.clientLease,
|
|
712
744
|
options: resolved.clientOptions,
|
|
713
745
|
run: async (client, requestOptions) => await client.request("thread/start", {
|
|
714
|
-
cwd:
|
|
746
|
+
cwd: resolved.workspaceDir,
|
|
715
747
|
...resolved.model ? { model: resolved.model } : {},
|
|
716
748
|
...resolved.modelProvider ? { modelProvider: resolved.modelProvider } : {},
|
|
717
749
|
personality: CODEX_NATIVE_PERSONALITY_NONE,
|
|
@@ -728,7 +760,6 @@ async function requestNewConversationBindingThread(params, resolved) {
|
|
|
728
760
|
async function writeThreadBindingFromResponse(params, resolved, response) {
|
|
729
761
|
const current = await params.bindingStore.read(params.identity);
|
|
730
762
|
assertCodexBindingMayBeReplaced(current, "storing a conversation-bound Codex thread");
|
|
731
|
-
const runtimeApprovalPolicy = typeof resolved.runtime.approvalPolicy === "string" ? resolved.runtime.approvalPolicy : void 0;
|
|
732
763
|
const trackSubscription = !params.incognito && isCodexAppServerClientRuntimeLive(resolved.client);
|
|
733
764
|
const sameOwner = isSameCodexAppServerThreadOwner(current, {
|
|
734
765
|
threadId: response.thread.id,
|
|
@@ -746,7 +777,7 @@ async function writeThreadBindingFromResponse(params, resolved, response) {
|
|
|
746
777
|
binding: {
|
|
747
778
|
threadId: response.thread.id,
|
|
748
779
|
clientId: resolved.client.getInstanceId(),
|
|
749
|
-
cwd:
|
|
780
|
+
cwd: resolved.workspaceDir,
|
|
750
781
|
authProfileId: params.authProfileId,
|
|
751
782
|
model: response.model ?? resolved.model ?? params.model,
|
|
752
783
|
modelProvider: normalizeCodexAppServerBindingModelProvider({
|
|
@@ -754,8 +785,6 @@ async function writeThreadBindingFromResponse(params, resolved, response) {
|
|
|
754
785
|
modelProvider: response.modelProvider ?? resolved.modelProvider ?? params.modelProvider,
|
|
755
786
|
...resolved.agentLookup
|
|
756
787
|
}),
|
|
757
|
-
approvalPolicy: resolved.execPolicy?.touched ? runtimeApprovalPolicy : params.approvalPolicy ?? runtimeApprovalPolicy,
|
|
758
|
-
sandbox: resolved.execPolicy?.touched ? resolved.runtime.sandbox : params.sandbox ?? resolved.runtime.sandbox,
|
|
759
788
|
serviceTier: params.serviceTier ?? resolved.runtime.serviceTier ?? void 0,
|
|
760
789
|
networkProxyProfileName: resolved.runtime.networkProxy?.profileName,
|
|
761
790
|
networkProxyConfigFingerprint: resolved.runtime.networkProxy?.configFingerprint
|
|
@@ -784,6 +813,7 @@ async function attachExistingThread(params) {
|
|
|
784
813
|
if (isCodexAppServerLiveThreadClaimed(client, params.threadId)) throw new Error(`Codex thread ${params.threadId} has an active run; stop it before binding its conversation.`);
|
|
785
814
|
return await client.request(CODEX_CONTROL_METHODS.resumeThread, {
|
|
786
815
|
threadId: params.threadId,
|
|
816
|
+
cwd: resolved.workspaceDir,
|
|
787
817
|
...resolved.model ? { model: resolved.model } : {},
|
|
788
818
|
...resolved.modelProvider ? { modelProvider: resolved.modelProvider } : {},
|
|
789
819
|
personality: CODEX_NATIVE_PERSONALITY_NONE,
|
|
@@ -821,18 +851,19 @@ async function runBoundTurn(params) {
|
|
|
821
851
|
if (!binding?.threadId) throw new Error("bound Codex conversation has no thread binding");
|
|
822
852
|
assertCodexBindingMayBeReplaced(binding, "running a conversation-bound Codex thread");
|
|
823
853
|
let threadId = binding.threadId;
|
|
824
|
-
const
|
|
854
|
+
const requestedWorkspaceDir = binding.cwd || params.data.workspaceDir;
|
|
825
855
|
const reviewerModelProvider = resolveModelBackedReviewerPolicyProvider({
|
|
826
856
|
authProfileId: binding.authProfileId,
|
|
827
857
|
modelProvider: binding.modelProvider,
|
|
828
858
|
...agentLookup
|
|
829
859
|
});
|
|
830
|
-
const {
|
|
860
|
+
const { runtime, workspaceDir } = await resolveConversationAppServerRuntime({
|
|
831
861
|
pluginConfig: params.pluginConfig,
|
|
832
862
|
config: params.config,
|
|
833
|
-
agentId: params.data.agentId,
|
|
834
|
-
sessionKey: params.sessionKey,
|
|
835
|
-
|
|
863
|
+
agentId: params.data.source?.agentId ?? params.data.agentId,
|
|
864
|
+
sessionKey: params.data.legacyBinding ? params.sessionKey : params.data.source?.sessionKey,
|
|
865
|
+
source: params.data.source,
|
|
866
|
+
workspaceDir: requestedWorkspaceDir,
|
|
836
867
|
modelProvider: reviewerModelProvider,
|
|
837
868
|
model: binding.model,
|
|
838
869
|
agentDir: params.data.agentDir
|
|
@@ -845,27 +876,15 @@ async function runBoundTurn(params) {
|
|
|
845
876
|
env: process.env,
|
|
846
877
|
agentDir: params.data.agentDir
|
|
847
878
|
});
|
|
848
|
-
const
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
config: params.config,
|
|
852
|
-
env: process.env,
|
|
853
|
-
agentDir: params.data.agentDir
|
|
854
|
-
});
|
|
855
|
-
const useModelScopedPolicy = execPolicy?.touched === true || modelBackedApprovalsReviewerUnavailable;
|
|
856
|
-
const approvalPolicy = useModelScopedPolicy ? modelScopedRuntime.approvalPolicy : binding.approvalPolicy ?? modelScopedRuntime.approvalPolicy;
|
|
857
|
-
const sandbox = useModelScopedPolicy ? modelScopedRuntime.sandbox : binding.sandbox ?? modelScopedRuntime.sandbox;
|
|
879
|
+
const sessionRoot = modelScopedRuntime.sessionRoot;
|
|
880
|
+
const approvalPolicy = modelScopedRuntime.approvalPolicy;
|
|
881
|
+
const sandbox = modelScopedRuntime.sandbox;
|
|
858
882
|
const permissionProfile = modelScopedRuntime.networkProxy?.profileName;
|
|
859
883
|
const networkProxyConfigFingerprint = modelScopedRuntime.networkProxy?.configFingerprint;
|
|
860
884
|
const networkProxyBindingChanged = binding.networkProxyProfileName !== permissionProfile || binding.networkProxyConfigFingerprint !== networkProxyConfigFingerprint;
|
|
861
885
|
const serviceTier = binding.serviceTier ?? runtime.serviceTier;
|
|
862
886
|
let useStickyNetworkProfile = permissionProfile !== void 0 && binding.networkProxyProfileName === permissionProfile && binding.networkProxyConfigFingerprint === networkProxyConfigFingerprint;
|
|
863
|
-
assertNativeConversationApprovalPolicySupported(
|
|
864
|
-
execPolicy,
|
|
865
|
-
approvalPolicy,
|
|
866
|
-
approvalsReviewer: modelScopedRuntime.approvalsReviewer,
|
|
867
|
-
modelBackedApprovalsReviewerUnavailable
|
|
868
|
-
});
|
|
887
|
+
assertNativeConversationApprovalPolicySupported(modelScopedRuntime);
|
|
869
888
|
const modelSelection = binding.model ? resolveCodexAppServerRequestModelSelection({
|
|
870
889
|
model: binding.model,
|
|
871
890
|
modelProvider: binding.modelProvider,
|
|
@@ -905,6 +924,7 @@ async function runBoundTurn(params) {
|
|
|
905
924
|
options: clientOptions,
|
|
906
925
|
run: async (requestClient, requestOptions) => await requestClient.request("thread/start", {
|
|
907
926
|
cwd: workspaceDir,
|
|
927
|
+
...sessionRoot ? { runtimeWorkspaceRoots: [sessionRoot] } : {},
|
|
908
928
|
...modelSelection?.model ? { model: modelSelection.model } : {},
|
|
909
929
|
...modelSelection?.modelProvider ? { modelProvider: modelSelection.modelProvider } : {},
|
|
910
930
|
personality: CODEX_NATIVE_PERSONALITY_NONE,
|
|
@@ -946,8 +966,6 @@ async function runBoundTurn(params) {
|
|
|
946
966
|
modelProvider: response.modelProvider ?? modelSelection?.modelProvider ?? binding.modelProvider,
|
|
947
967
|
...agentLookup
|
|
948
968
|
}),
|
|
949
|
-
approvalPolicy: typeof approvalPolicy === "string" ? approvalPolicy : void 0,
|
|
950
|
-
sandbox,
|
|
951
969
|
serviceTier: serviceTier ?? void 0,
|
|
952
970
|
networkProxyProfileName: modelScopedRuntime.networkProxy?.profileName,
|
|
953
971
|
networkProxyConfigFingerprint: modelScopedRuntime.networkProxy?.configFingerprint,
|
|
@@ -969,6 +987,8 @@ async function runBoundTurn(params) {
|
|
|
969
987
|
},
|
|
970
988
|
request: {
|
|
971
989
|
threadId,
|
|
990
|
+
cwd: workspaceDir,
|
|
991
|
+
...sessionRoot ? { runtimeWorkspaceRoots: [sessionRoot] } : {},
|
|
972
992
|
...modelSelection?.model ? { model: modelSelection.model } : {},
|
|
973
993
|
...modelSelection?.modelProvider ? { modelProvider: modelSelection.modelProvider } : {},
|
|
974
994
|
personality: CODEX_NATIVE_PERSONALITY_NONE,
|
|
@@ -1017,9 +1037,10 @@ async function runBoundTurn(params) {
|
|
|
1017
1037
|
event: params.event
|
|
1018
1038
|
}),
|
|
1019
1039
|
cwd: workspaceDir,
|
|
1040
|
+
...sessionRoot ? { runtimeWorkspaceRoots: [sessionRoot] } : {},
|
|
1020
1041
|
approvalPolicy,
|
|
1021
1042
|
approvalsReviewer: modelScopedRuntime.approvalsReviewer,
|
|
1022
|
-
...useStickyNetworkProfile ? {} : { sandboxPolicy: codexSandboxPolicyForTurn(sandbox, workspaceDir) },
|
|
1043
|
+
...useStickyNetworkProfile ? {} : { sandboxPolicy: codexSandboxPolicyForTurn(sandbox, sessionRoot ?? workspaceDir) },
|
|
1023
1044
|
...modelSelection?.model ? { model: modelSelection.model } : {},
|
|
1024
1045
|
personality: CODEX_NATIVE_PERSONALITY_NONE,
|
|
1025
1046
|
...serviceTier ? { serviceTier } : {}
|
|
@@ -1087,8 +1108,8 @@ async function runBoundTurn(params) {
|
|
|
1087
1108
|
}
|
|
1088
1109
|
}
|
|
1089
1110
|
}
|
|
1090
|
-
function assertNativeConversationApprovalPolicySupported(
|
|
1091
|
-
if (
|
|
1111
|
+
function assertNativeConversationApprovalPolicySupported(runtime) {
|
|
1112
|
+
if (runtime.approvalPolicy !== "never" && runtime.approvalsReviewer === "user") throw new Error(NATIVE_CONVERSATION_INTERACTIVE_APPROVALS_UNAVAILABLE);
|
|
1092
1113
|
}
|
|
1093
1114
|
async function runBoundTurnWithMissingThreadRecovery(params) {
|
|
1094
1115
|
await prepareConversationBinding(params);
|
|
@@ -1116,11 +1137,6 @@ async function prepareConversationBinding(params, options = {}) {
|
|
|
1116
1137
|
assertCodexBindingMayBeReplaced(current, "initializing a conversation-bound Codex thread");
|
|
1117
1138
|
assertCodexBindingMayBeReplaced(sourceBinding, "transferring a session into a conversation-bound Codex thread");
|
|
1118
1139
|
const inherited = current ?? sourceBinding;
|
|
1119
|
-
const execPolicy = resolveConversationExecPolicy({
|
|
1120
|
-
config: params.config,
|
|
1121
|
-
agentId: params.data.agentId,
|
|
1122
|
-
sessionKey: params.sessionKey
|
|
1123
|
-
});
|
|
1124
1140
|
const agentLookup = buildAgentLookup({
|
|
1125
1141
|
agentDir: params.data.agentDir,
|
|
1126
1142
|
config: params.config
|
|
@@ -1134,13 +1150,12 @@ async function prepareConversationBinding(params, options = {}) {
|
|
|
1134
1150
|
model: requested?.model ?? inherited?.model,
|
|
1135
1151
|
modelProvider: requested?.modelProvider ?? inherited?.modelProvider,
|
|
1136
1152
|
authProfileId: requested?.authProfileId ?? inherited?.authProfileId,
|
|
1137
|
-
approvalPolicy: execPolicy.touched ? void 0 : inherited?.approvalPolicy,
|
|
1138
|
-
sandbox: execPolicy.touched ? void 0 : inherited?.sandbox,
|
|
1139
1153
|
serviceTier: inherited?.serviceTier,
|
|
1140
1154
|
config: params.config,
|
|
1141
|
-
sessionKey: params.sessionKey,
|
|
1155
|
+
sessionKey: params.data.legacyBinding ? params.sessionKey : params.data.source?.sessionKey,
|
|
1156
|
+
source: params.data.source,
|
|
1142
1157
|
incognito: params.incognito,
|
|
1143
|
-
agentId: params.data.agentId
|
|
1158
|
+
agentId: params.data.source?.agentId ?? params.data.agentId
|
|
1144
1159
|
};
|
|
1145
1160
|
const threadId = requested?.threadId;
|
|
1146
1161
|
if (threadId && !options.forceNew) await attachExistingThread({
|
|
@@ -1205,65 +1220,6 @@ async function projectConversationSourceHistory(source, target, config) {
|
|
|
1205
1220
|
clientLease.release();
|
|
1206
1221
|
}
|
|
1207
1222
|
}
|
|
1208
|
-
function resolveConversationExecPolicy(params) {
|
|
1209
|
-
const agentId = params.agentId ?? (params.config ? resolveSessionAgentIds$2({
|
|
1210
|
-
sessionKey: params.sessionKey,
|
|
1211
|
-
config: params.config
|
|
1212
|
-
}).sessionAgentId : void 0);
|
|
1213
|
-
return resolveOpenClawExecPolicyForCodexAppServer({
|
|
1214
|
-
config: params.config,
|
|
1215
|
-
agentId,
|
|
1216
|
-
execOverrides: readSessionExecOverrides({
|
|
1217
|
-
config: params.config,
|
|
1218
|
-
agentId,
|
|
1219
|
-
sessionKey: params.sessionKey
|
|
1220
|
-
}),
|
|
1221
|
-
approvals: loadExecApprovals()
|
|
1222
|
-
});
|
|
1223
|
-
}
|
|
1224
|
-
function readSessionExecOverrides(params) {
|
|
1225
|
-
const sessionKey = params.sessionKey?.trim();
|
|
1226
|
-
if (!params.config || !sessionKey) return;
|
|
1227
|
-
if (!canReadSessionExecOverrides({
|
|
1228
|
-
config: params.config,
|
|
1229
|
-
agentId: params.agentId,
|
|
1230
|
-
sessionKey
|
|
1231
|
-
})) return;
|
|
1232
|
-
const entry = getSessionEntry({
|
|
1233
|
-
storePath: resolveStorePath(params.config.session?.store, { agentId: params.agentId }),
|
|
1234
|
-
sessionKey,
|
|
1235
|
-
readConsistency: "latest"
|
|
1236
|
-
});
|
|
1237
|
-
if (!entry?.execSecurity && !entry?.execAsk) return;
|
|
1238
|
-
return {
|
|
1239
|
-
security: entry.execSecurity,
|
|
1240
|
-
ask: entry.execAsk
|
|
1241
|
-
};
|
|
1242
|
-
}
|
|
1243
|
-
function canReadSessionExecOverrides(params) {
|
|
1244
|
-
const agentId = normalizeAgentIdOrDefault(params.agentId);
|
|
1245
|
-
if (!agentId) return true;
|
|
1246
|
-
const sessionAgentId = parseAgentIdFromSessionKey(params.sessionKey);
|
|
1247
|
-
if (!sessionAgentId) return isDefaultAgentSessionKeyForAgent({
|
|
1248
|
-
config: params.config,
|
|
1249
|
-
agentId
|
|
1250
|
-
});
|
|
1251
|
-
return sessionAgentId === agentId;
|
|
1252
|
-
}
|
|
1253
|
-
function parseAgentIdFromSessionKey(sessionKey) {
|
|
1254
|
-
const raw = sessionKey?.trim();
|
|
1255
|
-
if (!raw) return;
|
|
1256
|
-
const parts = raw.toLowerCase().split(":").filter(Boolean);
|
|
1257
|
-
if (parts.length < 3 || parts[0] !== "agent" || !parts[2]) return;
|
|
1258
|
-
return normalizeAgentIdOrDefault(parts[1]);
|
|
1259
|
-
}
|
|
1260
|
-
function isDefaultAgentSessionKeyForAgent(params) {
|
|
1261
|
-
return normalizeAgentId(params.agentId) === tryResolveDefaultAgentId(params.config);
|
|
1262
|
-
}
|
|
1263
|
-
function normalizeAgentIdOrDefault(value) {
|
|
1264
|
-
const normalized = normalizeAgentId(value);
|
|
1265
|
-
return normalized === "main" && !(value ?? "").trim() ? void 0 : normalized;
|
|
1266
|
-
}
|
|
1267
1223
|
function isCodexThreadNotFoundError(error) {
|
|
1268
1224
|
const message = formatErrorMessage(error);
|
|
1269
1225
|
return /\bthread not found:/iu.test(message) || /\bbound Codex conversation has no thread binding\b/u.test(message);
|
|
@@ -3310,7 +3266,7 @@ function createCodexNodeExecServerCommand() {
|
|
|
3310
3266
|
const frames = io.frames;
|
|
3311
3267
|
let unsubscribe;
|
|
3312
3268
|
try {
|
|
3313
|
-
const { runCodexNodeExecServer } = await import("./node-exec-server.runtime-
|
|
3269
|
+
const { runCodexNodeExecServer } = await import("./node-exec-server.runtime-BpWqJO1V.js");
|
|
3314
3270
|
return await runCodexNodeExecServer({
|
|
3315
3271
|
workspaceDir: workspace.workspaceDir,
|
|
3316
3272
|
io,
|
|
@@ -3329,7 +3285,7 @@ function createCodexNodeExecServerCommand() {
|
|
|
3329
3285
|
}
|
|
3330
3286
|
};
|
|
3331
3287
|
}
|
|
3332
|
-
/** Keeps
|
|
3288
|
+
/** Keeps node exec-server launch behind explicit arming and one-time approval. */
|
|
3333
3289
|
function createCodexNodeExecServerInvokePolicy() {
|
|
3334
3290
|
return {
|
|
3335
3291
|
commands: [CODEX_NODE_EXEC_SERVER_COMMAND],
|
|
@@ -3342,7 +3298,7 @@ function createCodexNodeExecServerInvokePolicy() {
|
|
|
3342
3298
|
if (!context.approvals || context.risk?.level !== "high") return {
|
|
3343
3299
|
ok: false,
|
|
3344
3300
|
code: "CODEX_NODE_EXEC_APPROVAL_REQUIRED",
|
|
3345
|
-
message: "Codex
|
|
3301
|
+
message: "Codex node execution requires an available approval reviewer."
|
|
3346
3302
|
};
|
|
3347
3303
|
let placement;
|
|
3348
3304
|
try {
|
|
@@ -3351,19 +3307,19 @@ function createCodexNodeExecServerInvokePolicy() {
|
|
|
3351
3307
|
return {
|
|
3352
3308
|
ok: false,
|
|
3353
3309
|
code: "CODEX_NODE_EXEC_WORKSPACE_INVALID",
|
|
3354
|
-
message: "Codex
|
|
3310
|
+
message: "Codex node execution requires an exact managed placement workspace."
|
|
3355
3311
|
};
|
|
3356
3312
|
}
|
|
3357
|
-
const
|
|
3313
|
+
const nodeName = context.node?.displayName ?? context.nodeId;
|
|
3358
3314
|
if ((await context.approvals.request({
|
|
3359
|
-
title: "Run Codex execution on
|
|
3360
|
-
description: `${
|
|
3315
|
+
title: "Run Codex execution on node",
|
|
3316
|
+
description: `${nodeName}: ${placement.cwd}; allows arbitrary processes and filesystem access across the node account, not only this workspace.`,
|
|
3361
3317
|
severity: "critical",
|
|
3362
3318
|
allowedDecisions: ["allow-once"]
|
|
3363
3319
|
})).decision !== "allow-once") return {
|
|
3364
3320
|
ok: false,
|
|
3365
3321
|
code: "CODEX_NODE_EXEC_APPROVAL_DENIED",
|
|
3366
|
-
message: "Codex
|
|
3322
|
+
message: "Codex node execution requires one-time approval."
|
|
3367
3323
|
};
|
|
3368
3324
|
return await context.invokeNode({ params: placement });
|
|
3369
3325
|
}
|
|
@@ -4151,7 +4107,7 @@ function createCodexSupervisionTools(options) {
|
|
|
4151
4107
|
}
|
|
4152
4108
|
//#endregion
|
|
4153
4109
|
//#region extensions/codex/src/web-search-provider.ts
|
|
4154
|
-
const loadCodexWebSearchRuntime = createLazyRuntimeModule(() => import("./web-search-provider.runtime-
|
|
4110
|
+
const loadCodexWebSearchRuntime = createLazyRuntimeModule(() => import("./web-search-provider.runtime-ClaNPV7N.js"));
|
|
4155
4111
|
const CodexWebSearchSchema = {
|
|
4156
4112
|
type: "object",
|
|
4157
4113
|
properties: { query: {
|
|
@@ -4211,7 +4167,9 @@ var codex_default = definePluginEntry({
|
|
|
4211
4167
|
return livePluginConfig;
|
|
4212
4168
|
};
|
|
4213
4169
|
const resolveCurrentPluginConfig = () => resolvePluginConfig(resolveCurrentConfig);
|
|
4214
|
-
|
|
4170
|
+
const appServerConfig = readCodexPluginConfig(resolveCurrentPluginConfig()).appServer;
|
|
4171
|
+
api.registerService(createCodexDesktopGenerationService({ onGenerationChange: retireSharedCodexAppServerClientsBeforeDesktopGeneration }));
|
|
4172
|
+
if (appServerConfig?.transport === "websocket") api.registerService(createCodexAppServerConnectionHealthService({
|
|
4215
4173
|
getPluginConfig: resolveCurrentPluginConfig,
|
|
4216
4174
|
getRuntimeConfig: resolveCurrentConfig
|
|
4217
4175
|
}));
|
|
@@ -4381,7 +4339,7 @@ var codex_default = definePluginEntry({
|
|
|
4381
4339
|
if (!previousSessionId || !sessionId || previousSessionId === sessionId) return;
|
|
4382
4340
|
const config = resolveCurrentConfig();
|
|
4383
4341
|
const sessionKey = ctx.sessionKey?.trim();
|
|
4384
|
-
const { sessionBindingIdentity } = await import("./session-binding-
|
|
4342
|
+
const { sessionBindingIdentity } = await import("./session-binding-Bcynfd-_.js").then((n) => n.f);
|
|
4385
4343
|
const identity = sessionBindingIdentity({
|
|
4386
4344
|
sessionId,
|
|
4387
4345
|
...sessionKey ? { sessionKey } : {},
|
|
@@ -4399,7 +4357,7 @@ var codex_default = definePluginEntry({
|
|
|
4399
4357
|
if (endedSessionKey && nextSessionKey && nextSessionKey !== endedSessionKey) return;
|
|
4400
4358
|
if (event.nextSessionId?.trim() === event.sessionId.trim()) return;
|
|
4401
4359
|
const config = resolveCurrentConfig();
|
|
4402
|
-
const [{ sessionBindingIdentity }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./session-binding-
|
|
4360
|
+
const [{ sessionBindingIdentity }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./session-binding-Bcynfd-_.js").then((n) => n.f), import("./session-retirement-CcNC3YSY.js")]);
|
|
4403
4361
|
await retireCodexAppServerSessionGeneration({
|
|
4404
4362
|
bindingStore,
|
|
4405
4363
|
identity: sessionBindingIdentity({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { h as readCodexPluginConfig, r as resolveCodexAppServerHomeScope } from "./config-
|
|
2
|
-
import {
|
|
3
|
-
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-
|
|
4
|
-
import {
|
|
1
|
+
import { h as readCodexPluginConfig, r as resolveCodexAppServerHomeScope } from "./config-giW8X0QA.js";
|
|
2
|
+
import { pt as resolveCodexAppServerPreparedAuthHandoff, vt as isJsonObject } from "./shared-client-DKz23hHY.js";
|
|
3
|
+
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-B7iBUcuP.js";
|
|
4
|
+
import { a as createAttributedCodexAssistantMessage } from "./event-projector-assistant-message-C5-Ds8mA.js";
|
|
5
5
|
//#region extensions/codex/src/app-server/isolated-completion.ts
|
|
6
6
|
const ISOLATED_PASSIVE_ITEM_TYPES = /* @__PURE__ */ new Set(["agentMessage", "reasoning"]);
|
|
7
7
|
function assertIsolatedCompletionItems(items, prompt) {
|