@openclaw/codex 2026.9.5 → 2026.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/.setup/{account-usage-runtime-C2MOIvfq.mjs → account-usage-runtime-Eem_WGqY.mjs} +5 -5
  2. package/dist/.setup/{apply-CJ0ZfmBG.mjs → apply-DDOi8uNx.mjs} +22 -28
  3. package/dist/.setup/{attempt-client-cleanup-BpYKdTA0.mjs → attempt-client-cleanup-CEv1cKwF.mjs} +58 -43
  4. package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +331 -0
  5. package/dist/.setup/{auth-cache-key-QirmgiCo.mjs → auth-cache-key-B2mpaI9D.mjs} +9 -81
  6. package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
  7. package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
  8. package/dist/.setup/{binding-connection-Bm38niE8.mjs → binding-connection-ThoatDcb.mjs} +1 -1
  9. package/dist/.setup/{binding-connection.runtime-CnRMC0ta.mjs → binding-connection.runtime-yoHrABt-.mjs} +4 -4
  10. package/dist/.setup/{bounded-turn-BtlZcivC.mjs → bounded-turn-B2HScEgT.mjs} +138 -32
  11. package/dist/.setup/{build-state-Xx9ybZqa.mjs → build-state-C7EnDVgr.mjs} +1 -1
  12. package/dist/.setup/{capabilities-_vXcZGSx.mjs → capabilities-CDXOOFdZ.mjs} +1 -1
  13. package/dist/.setup/{client-vXs2929Q.mjs → client-Cs08OXVQ.mjs} +583 -559
  14. package/dist/.setup/client-catalog-response-BMgt_4q4.mjs +285 -0
  15. package/dist/.setup/{command-dispatch-naHIZwwF.mjs → command-dispatch-B4JuOsOk.mjs} +8 -4
  16. package/dist/.setup/{command-formatters-CGEkdawF.mjs → command-formatters-Bmqvr9tO.mjs} +8 -4
  17. package/dist/.setup/{command-handlers-BtAJEW1X.mjs → command-handlers-DW7Lx9oH.mjs} +106 -172
  18. package/dist/.setup/{command-rpc-DHFpn4le.mjs → command-rpc-DixIj3HW.mjs} +36 -21
  19. package/dist/.setup/{compact-C3i3qlzj.mjs → compact-Du5UvtxA.mjs} +14 -21
  20. package/dist/.setup/{config-CedDWjM-.mjs → config-BoTP_mrL.mjs} +3 -3
  21. package/dist/.setup/{config-options-BsanJ8QG.mjs → config-options-BvaRs51b.mjs} +46 -30
  22. package/dist/.setup/{config-runtime-CeAhl_h4.mjs → config-runtime-C8Rw1m1m.mjs} +1 -1
  23. package/dist/.setup/{config-security-BRQ2mgW9.mjs → config-security-BEReZ6go.mjs} +35 -120
  24. package/dist/.setup/{conversation-binding-DhzrpTM6.mjs → conversation-binding-DP-gMrBP.mjs} +21 -32
  25. package/dist/.setup/{conversation-control-DN53ns41.mjs → conversation-control-uK9Jomlc.mjs} +28 -67
  26. package/dist/.setup/{dynamic-tools-D16lOp67.mjs → dynamic-tools-BDXl-8Cw.mjs} +848 -578
  27. package/dist/.setup/{effective-mcp-catalog-K6kLCN8X.mjs → effective-mcp-catalog-CvnvnGIe.mjs} +3 -3
  28. package/dist/.setup/{ephemeral-turn-R1gA8Sn6.mjs → ephemeral-turn-poidXgek.mjs} +9 -6
  29. package/dist/.setup/{event-projector-assistant-message-DNUR1s0A.mjs → event-projector-assistant-message-BsruvNrH.mjs} +2 -4
  30. package/dist/.setup/{event-projector-items-DyTQ_XqL.mjs → event-projector-items-C6L_5ZiT.mjs} +42 -8
  31. package/dist/.setup/{event-projector-usage-C7Ntzs-f.mjs → event-projector-usage-CnBS8Wa3.mjs} +1 -1
  32. package/dist/.setup/{harness-rxaaoN-o.mjs → harness-a_MsE4-_.mjs} +23 -17
  33. package/dist/.setup/{inference-context-fulhZuz8.mjs → inference-context-D96l9-ew.mjs} +1 -1
  34. package/dist/.setup/inference-proxy-b-aJMSxm.mjs +601 -0
  35. package/dist/.setup/{isolated-completion-B6srt48J.mjs → isolated-completion-BIZFhTNG.mjs} +17 -10
  36. package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
  37. package/dist/.setup/{managed-binary-DP6Rib3P.mjs → managed-binary-BnshlFag.mjs} +13 -2
  38. package/dist/.setup/{model-catalog-DkvUuBey.mjs → model-catalog-CfXJf9Ay.mjs} +9 -10
  39. package/dist/.setup/{models-BDFgm_G-.mjs → models-KnqBv0hE.mjs} +3 -3
  40. package/dist/.setup/{native-auth-BLZGqFjw.mjs → native-auth-rWbGbMn3.mjs} +4 -4
  41. package/dist/.setup/{native-subagent-history-YXaL6dMd.mjs → native-subagent-history-0nYYgo0k.mjs} +26 -13
  42. package/dist/.setup/{native-subagent-monitor-B1hxzIOy.mjs → native-subagent-monitor-D3filLY2.mjs} +145 -317
  43. package/dist/.setup/{native-subagent-task-ids-DsuOonKv.mjs → native-subagent-task-ids-wb8CKZGN.mjs} +69 -39
  44. package/dist/.setup/{node-cli-sessions-Cl8b2ZF3.mjs → node-cli-sessions-r3avj02l.mjs} +86 -68
  45. package/dist/.setup/node-exec-server.runtime-BDwWXVpK.mjs +247 -0
  46. package/dist/.setup/{plan-xD7WKYTM.mjs → plan-CN3VwfNU.mjs} +74 -76
  47. package/dist/.setup/{plugin-activation-r8nq5Jzp.mjs → plugin-activation-DT3MNtqj.mjs} +7 -16
  48. package/dist/.setup/{plugin-app-cache-key-BOxKP7db.mjs → plugin-app-cache-key-B2CsSdnV.mjs} +4 -20
  49. package/dist/.setup/{plugin-approval-roundtrip-CjfzafAZ.mjs → plugin-approval-roundtrip-C0MZzCuP.mjs} +1 -1
  50. package/dist/.setup/{plugin-inventory-DUle8DLz.mjs → plugin-inventory-BoRei8Z4.mjs} +16 -7
  51. package/dist/.setup/{plugin-marketplace-discovery-P-Vndfqq.mjs → plugin-marketplace-discovery-CDOi8IFs.mjs} +4 -1
  52. package/dist/.setup/{plugin-metadata-cache-DsS5buNa.mjs → plugin-metadata-cache-Ctmo83k_.mjs} +224 -154
  53. package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
  54. package/dist/.setup/{provider-fFh_-VR3.mjs → provider-BOsxQHOM.mjs} +9 -5
  55. package/dist/.setup/{provider-capabilities-B8J4Dy-O.mjs → provider-capabilities-BfE88FZ5.mjs} +31 -3
  56. package/dist/.setup/{rate-limits-DOEGYRNs.mjs → rate-limits-CMU3DUD0.mjs} +116 -137
  57. package/dist/.setup/{request-BioXJLYa.mjs → request-D2L0zMrq.mjs} +23 -15
  58. package/dist/.setup/{run-attempt-rlA07pUv.mjs → run-attempt-BHu11r7h.mjs} +1197 -617
  59. package/dist/.setup/{runtime-artifact-Dy38Z5iU.mjs → runtime-artifact-CLZ8udh-.mjs} +29 -45
  60. package/dist/.setup/{sandbox-guard-BBP-RbTf.mjs → sandbox-guard-C2sRMOEY.mjs} +1 -1
  61. package/dist/.setup/{session-binding-_0W_fHRr.mjs → session-binding-Cm0apEbd.mjs} +3 -32
  62. package/dist/.setup/{session-binding-record-TH3xA0zj.mjs → session-binding-record-BGoz8wOK.mjs} +22 -3
  63. package/dist/.setup/{session-binding-sidecars-CKYEcfNn.mjs → session-binding-sidecars-BlB5EvIS.mjs} +48 -45
  64. package/dist/.setup/{session-catalog-fUdWDx-U.mjs → session-catalog-Pno1xGcl.mjs} +482 -182
  65. package/dist/.setup/{session-catalog-adoption-CR_whkEW.mjs → session-catalog-adoption-BI6UTDZT.mjs} +57 -25
  66. package/dist/.setup/{session-catalog-archive-CwZaPacf.mjs → session-catalog-archive-lHBqzhaO.mjs} +6 -6
  67. package/dist/.setup/{session-catalog-events-jMcYfQyd.mjs → session-catalog-events-Bj6j94E_.mjs} +122 -25
  68. package/dist/.setup/{session-catalog-index-B141u15s.mjs → session-catalog-index-B9_VQIUz.mjs} +178 -78
  69. package/dist/.setup/{session-catalog-index-order-Cc5BzlQr.mjs → session-catalog-index-order-hcdz07yN.mjs} +2 -2
  70. package/dist/.setup/{session-catalog-index-state-BAuDztHN.mjs → session-catalog-index-state-Dgh8ORJm.mjs} +5 -2
  71. package/dist/.setup/{session-catalog-native-projection-ChV3cCtm.mjs → session-catalog-native-projection-DowriLid.mjs} +30 -13
  72. package/dist/.setup/{session-catalog-node-adoption-BVRsYOSh.mjs → session-catalog-node-adoption-ITddWx_X.mjs} +24 -12
  73. package/dist/.setup/{session-catalog-node-continue-Dowv8osw.mjs → session-catalog-node-continue-6g6qi4A9.mjs} +22 -13
  74. package/dist/.setup/{session-catalog-projection-C1Bj9Jl-.mjs → session-catalog-projection-zK_PUsiE.mjs} +13 -5
  75. package/dist/.setup/{session-cli-DIj-IE-E.mjs → session-cli-irrD-uo7.mjs} +4 -4
  76. package/dist/.setup/{session-history-C--SrLI8.mjs → session-history-BrqhSCf9.mjs} +17 -22
  77. package/dist/.setup/{session-history-import-JHXT5Xfi.mjs → session-history-import-D-3wAgOP.mjs} +4 -4
  78. package/dist/.setup/{session-history.worker-CpNj7H_P.mjs → session-history.worker-CaCh0xF_.mjs} +5 -18
  79. package/dist/.setup/{session-initialization-DH1z6fXn.mjs → session-initialization-rcgbZiid.mjs} +2 -2
  80. package/dist/.setup/{session-permission-policy-DhurXY0l.mjs → session-permission-policy-BI1QK_98.mjs} +2 -2
  81. package/dist/.setup/{session-retirement-CU87AOg9.mjs → session-retirement-BH-S6qkJ.mjs} +25 -6
  82. package/dist/.setup/{settled-turn-finalizer-CiY2bLFK.mjs → settled-turn-finalizer-DiAi6Kx6.mjs} +8 -8
  83. package/dist/.setup/{shared-client-BpTtuLQ5.mjs → shared-client-DA4VR4Eb.mjs} +59 -89
  84. package/dist/.setup/{side-question-DSCZyoBD.mjs → side-question-BJ1wSDcB.mjs} +147 -211
  85. package/dist/.setup/{source-Bjp4UQij.mjs → source-CUzJq5WN.mjs} +9 -9
  86. package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
  87. package/dist/.setup/{thread-archive-guard-jmecf6OJ.mjs → thread-archive-guard-C9frICzX.mjs} +10 -3
  88. package/dist/.setup/{thread-history-page-BTx-4xsg.mjs → thread-history-page-DoVpnHim.mjs} +1 -1
  89. package/dist/.setup/{thread-lifecycle-Cik28qWn.mjs → thread-lifecycle-B3mfz1TG.mjs} +172 -2271
  90. package/dist/.setup/{thread-ownership-skomxnIt.mjs → thread-ownership-DcTtAcXj.mjs} +4 -2
  91. package/dist/.setup/{thread-policy-Cjs4B8xf.mjs → thread-policy-DGuQsuFC.mjs} +19 -3
  92. package/dist/.setup/thread-requests-BLvGkP2R.mjs +2205 -0
  93. package/dist/.setup/{thread-resume-BkNpj9Pz.mjs → thread-resume-DIBXwOpE.mjs} +6 -6
  94. package/dist/.setup/{timeout-DZF05XrR.mjs → timeout-C910MdAB.mjs} +19 -2
  95. package/dist/.setup/{transcript-history-projection-DHNBDhCU.mjs → transcript-history-projection-ZZpkFkJ_.mjs} +94 -64
  96. package/dist/.setup/{transcript-mirror-D4qp_leP.mjs → transcript-mirror-BtHDBp1G.mjs} +218 -198
  97. package/dist/.setup/{transport-stdio-Cmx94Oiy.mjs → transport-stdio-h2VHOskC.mjs} +135 -55
  98. package/dist/.setup/{upstream-session-fork-D3UKxgVD.mjs → upstream-session-fork-BUr4OUbC.mjs} +44 -36
  99. package/dist/.setup/{usage-BOgBEKso.mjs → usage-BML0r-ua.mjs} +5 -4
  100. package/dist/.setup/{usage-limit-error-C0ow7DOc.mjs → usage-limit-error-DUMbefVY.mjs} +4 -4
  101. package/dist/.setup/{web-search-provider.runtime-CTGuJt6i.mjs → web-search-provider.runtime-CDKlN-Rv.mjs} +4 -3
  102. package/dist/api.js +23 -12
  103. package/dist/catalog-page-worker-entrypoint.js +12 -0
  104. package/dist/catalog-page.worker.js +9 -0
  105. package/dist/cli-metadata.js +1 -1
  106. package/dist/doctor-contract-api.js +2 -2
  107. package/dist/harness.js +1 -1
  108. package/dist/index.js +221 -170
  109. package/dist/media-understanding-provider.js +2 -2
  110. package/dist/migration-provider-api.js +1 -1
  111. package/dist/provider-discovery.js +1 -1
  112. package/dist/session-history-worker-runtime.js +15 -32
  113. package/dist/session-history.worker.js +1 -1
  114. package/package.json +9 -6
  115. package/dist/.setup/attempt-context-VXVwTCfS.mjs +0 -636
  116. package/dist/.setup/inference-proxy-CC15HuSi.mjs +0 -311
  117. package/dist/.setup/launch-args-DnMak49W.mjs +0 -111
  118. package/dist/.setup/node-exec-server.runtime-BaViBKNz.mjs +0 -226
  119. package/dist/.setup/version-CoqzXPgK.mjs +0 -12
  120. package/dist/.setup/{native-execution-policy-YBMHSzC4.mjs → native-execution-policy-umd0tgh4.mjs} +1 -1
@@ -0,0 +1,331 @@
1
+ import { r as flattenCodexDynamicToolFunctions } from "./protocol-CANUwXJ3.mjs";
2
+ import { ct as isMessageOnlyCodexSourceReply } from "./thread-requests-BLvGkP2R.mjs";
3
+ import { readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
+ import path from "node:path";
5
+ import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
6
+ import { buildBootstrapContextForFiles, embeddedAgentLog, resolveBootstrapFilesForRun } from "openclaw/plugin-sdk/agent-harness-runtime";
7
+ import { resolveBootstrapFilesForPreparation } from "openclaw/plugin-sdk/codex-mcp-projection";
8
+ import { prepareMemorySystemPromptAddition } from "openclaw/plugin-sdk/core";
9
+ //#region extensions/codex/src/app-server/attempt-workspace-context.ts
10
+ /** Workspace snapshots, per-turn workspace context, and memory-tool routing for Codex. */
11
+ const CODEX_NATIVE_PROJECT_DOC_BASENAMES = /* @__PURE__ */ new Set(["agents.md"]);
12
+ const CODEX_TURN_SCOPED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES = /* @__PURE__ */ new Set([
13
+ "identity.md",
14
+ "soul.md",
15
+ "user.md"
16
+ ]);
17
+ const CODEX_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES = new Set(CODEX_TURN_SCOPED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES);
18
+ const CODEX_MEMORY_CONTEXT_BASENAME = "memory.md";
19
+ const CODEX_MEMORY_TOOL_NAMES = /* @__PURE__ */ new Set(["memory_search", "memory_get"]);
20
+ const CODEX_BOOTSTRAP_CONTEXT_ORDER = /* @__PURE__ */ new Map([
21
+ ["soul.md", 10],
22
+ ["identity.md", 20],
23
+ ["user.md", 30],
24
+ ["bootstrap.md", 50],
25
+ ["memory.md", 60]
26
+ ]);
27
+ /** A child baseline reads the bounded workspace snapshot without invoking admission hooks. */
28
+ async function prepareCodexWorkspaceDeveloperInstructions(params) {
29
+ if (isSameCodexWorkspacePath(params.workspaceDir, params.cwd)) return;
30
+ const files = await resolveBootstrapFilesForPreparation(params);
31
+ return renderCodexWorkspaceDeveloperInstructions({
32
+ files: selectCodexWorkspaceAgentProjectInstructionFiles(buildBootstrapContextForFiles(files, {
33
+ config: params.config,
34
+ agentId: params.agentId
35
+ }), params.workspaceDir),
36
+ header: "## OpenClaw Agent Workspace Instructions",
37
+ preamble: "OpenClaw loaded this bounded snapshot from the configured agent workspace."
38
+ }) ?? "";
39
+ }
40
+ /** Loads and partitions workspace snapshots, turn instructions, and memory references. */
41
+ async function buildCodexWorkspaceBootstrapContext(params) {
42
+ const inheritsAgentWorkspace = (params.executionWorkspace ?? params.resolvedWorkspace) !== params.resolvedWorkspace;
43
+ const injectOpenClawContext = shouldInjectCodexOpenClawPromptContext(params.params);
44
+ const restrictedProjectDocNeedsOpenClawCarrier = params.params.pluginHarnessToolPolicyRestricted === true && !params.params.disableTools && !isMessageOnlyCodexSourceReply(params.params) && params.params.bootstrapContextMode !== "lightweight";
45
+ const includeAgentWorkspaceInstructions = injectOpenClawContext && !params.ringZeroActive && (inheritsAgentWorkspace || restrictedProjectDocNeedsOpenClawCarrier);
46
+ try {
47
+ const promptWorkspace = inheritsAgentWorkspace ? params.resolvedWorkspace : params.effectiveWorkspace;
48
+ const memoryToolsAvailable = params.memoryToolNames.length > 0 && canRouteCodexWorkspaceMemoryThroughTools({
49
+ config: params.params.config,
50
+ agentId: params.params.agentId ?? params.sessionAgentId,
51
+ workspaceDir: inheritsAgentWorkspace ? params.resolvedWorkspace : params.effectiveWorkspace
52
+ });
53
+ const bootstrapFiles = await resolveBootstrapFilesForRun({
54
+ workspaceDir: params.resolvedWorkspace,
55
+ config: params.params.config,
56
+ sessionKey: params.sessionKey,
57
+ sessionId: params.params.sessionId,
58
+ bootstrapUserProfileId: params.params.bootstrapUserProfileId,
59
+ chatType: params.params.chatType,
60
+ agentId: params.params.agentId ?? params.sessionAgentId,
61
+ warn: (message) => embeddedAgentLog.warn(message),
62
+ contextMode: params.params.bootstrapContextMode,
63
+ runKind: params.params.bootstrapContextRunKind
64
+ });
65
+ const memoryToolRoutedBootstrapFiles = memoryToolsAvailable ? selectCodexWorkspaceMemoryReferenceFiles({
66
+ bootstrapFiles,
67
+ workspaceDir: params.resolvedWorkspace
68
+ }) : [];
69
+ const memoryReferenceFiles = memoryToolRoutedBootstrapFiles.map((file) => remapCodexContextFilePath({
70
+ file: toCodexEmbeddedContextFile(file),
71
+ sourceWorkspaceDir: params.resolvedWorkspace,
72
+ targetWorkspaceDir: promptWorkspace
73
+ }));
74
+ const contextFiles = buildBootstrapContextForFiles(memoryToolsAvailable ? bootstrapFiles.filter((file) => !isCodexWorkspaceRootMemoryBootstrapFile({
75
+ file,
76
+ workspaceDir: params.resolvedWorkspace
77
+ })) : bootstrapFiles, {
78
+ config: params.params.config,
79
+ agentId: params.params.agentId ?? params.sessionAgentId,
80
+ warn: (message) => embeddedAgentLog.warn(message)
81
+ }).map((file) => remapCodexContextFilePath({
82
+ file,
83
+ sourceWorkspaceDir: params.resolvedWorkspace,
84
+ targetWorkspaceDir: promptWorkspace
85
+ }));
86
+ const promptContextFiles = selectCodexWorkspacePromptContextFiles(contextFiles, {
87
+ excludeMemory: memoryToolsAvailable,
88
+ memoryWorkspaceDir: params.effectiveWorkspace
89
+ });
90
+ const threadDeveloperInstructionFiles = includeAgentWorkspaceInstructions ? selectCodexWorkspaceAgentProjectInstructionFiles(contextFiles, params.resolvedWorkspace) : [];
91
+ const turnScopedDeveloperInstructionFiles = injectOpenClawContext ? selectCodexWorkspaceTurnScopedDeveloperInstructionFiles(contextFiles) : [];
92
+ return {
93
+ bootstrapFiles,
94
+ contextFiles,
95
+ inheritsAgentWorkspace,
96
+ promptContextFiles,
97
+ threadDeveloperInstructionFiles,
98
+ turnScopedDeveloperInstructionFiles,
99
+ memoryReferenceFiles,
100
+ memoryToolRoutedBootstrapFiles,
101
+ memoryToolNames: [...params.memoryToolNames],
102
+ memoryToolRouted: memoryToolsAvailable,
103
+ promptContext: renderCodexWorkspaceBootstrapPromptContext(promptContextFiles),
104
+ threadDeveloperInstructions: includeAgentWorkspaceInstructions ? params.agentWorkspaceDeveloperInstructions ?? renderCodexWorkspaceDeveloperInstructions({
105
+ files: threadDeveloperInstructionFiles,
106
+ header: "## OpenClaw Agent Workspace Instructions",
107
+ preamble: "OpenClaw loaded this bounded snapshot from the configured agent workspace."
108
+ }) ?? "" : void 0,
109
+ turnScopedDeveloperInstructions: renderCodexWorkspaceCollaborationDeveloperInstructions(turnScopedDeveloperInstructionFiles),
110
+ memoryCollaborationInstructions: injectOpenClawContext ? await renderCodexWorkspaceMemoryCollaborationInstructions({
111
+ files: memoryReferenceFiles,
112
+ toolNames: params.memoryToolNames,
113
+ memoryToolRouted: memoryToolsAvailable,
114
+ citationsMode: params.params.config?.memory?.citations,
115
+ agentId: params.params.agentId ?? params.sessionAgentId,
116
+ agentSessionKey: params.sessionKey,
117
+ sandboxed: params.sandboxed
118
+ }) : void 0
119
+ };
120
+ } catch (error) {
121
+ embeddedAgentLog.warn("failed to load codex workspace bootstrap instructions", { error });
122
+ return {
123
+ bootstrapFiles: [],
124
+ contextFiles: [],
125
+ inheritsAgentWorkspace,
126
+ threadDeveloperInstructions: includeAgentWorkspaceInstructions ? params.agentWorkspaceDeveloperInstructions : void 0
127
+ };
128
+ }
129
+ }
130
+ function shouldInjectCodexOpenClawPromptContext(params) {
131
+ return !(params.bootstrapContextMode === "lightweight" && params.bootstrapContextRunKind === "cron");
132
+ }
133
+ function renderCodexWorkspaceBootstrapPromptContext(contextFiles) {
134
+ const files = contextFiles;
135
+ if (files.length === 0) return;
136
+ const lines = [
137
+ "OpenClaw loaded these user-editable workspace files for the current turn. Codex loads project-local AGENTS.md natively. When execution uses another folder, OpenClaw supplies the agent workspace AGENTS.md as thread-level developer instructions. SOUL.md, IDENTITY.md, and USER.md are prepared separately from user input and are not repeated here.",
138
+ "",
139
+ "# Project Context",
140
+ "",
141
+ "The following project context files have been loaded:"
142
+ ];
143
+ lines.push("");
144
+ for (const file of files) lines.push(`## ${file.path}`, "", file.content, "");
145
+ return lines.join("\n").trim();
146
+ }
147
+ function selectCodexWorkspacePromptContextFiles(contextFiles, options = {}) {
148
+ const excludeMemory = options.excludeMemory ?? true;
149
+ return contextFiles.filter((file) => {
150
+ const baseName = getCodexContextFileBasename(file.path);
151
+ return baseName && !CODEX_NATIVE_PROJECT_DOC_BASENAMES.has(baseName) && !CODEX_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES.has(baseName) && (!excludeMemory || !isCodexWorkspaceRootMemoryContextFile({
152
+ file,
153
+ workspaceDir: options.memoryWorkspaceDir
154
+ })) && !isMissingCodexBootstrapContextFile(file);
155
+ }).toSorted(compareCodexContextFiles);
156
+ }
157
+ function selectCodexWorkspaceTurnScopedDeveloperInstructionFiles(contextFiles) {
158
+ return selectCodexWorkspaceDeveloperInstructionFiles(contextFiles, CODEX_TURN_SCOPED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES);
159
+ }
160
+ function selectCodexWorkspaceAgentProjectInstructionFiles(contextFiles, agentWorkspaceDir) {
161
+ const agentProjectDocPath = path.join(path.resolve(agentWorkspaceDir), "AGENTS.md");
162
+ return selectCodexWorkspaceDeveloperInstructionFiles(contextFiles, CODEX_NATIVE_PROJECT_DOC_BASENAMES).filter((file) => path.resolve(file.path) === agentProjectDocPath);
163
+ }
164
+ function selectCodexWorkspaceDeveloperInstructionFiles(contextFiles, basenames) {
165
+ return contextFiles.filter((file) => {
166
+ const baseName = getCodexContextFileBasename(file.path);
167
+ return baseName && basenames.has(baseName) && !isMissingCodexBootstrapContextFile(file) && file.content.trim().length > 0;
168
+ }).toSorted(compareCodexContextFiles);
169
+ }
170
+ function renderCodexWorkspaceCollaborationDeveloperInstructions(files) {
171
+ return renderCodexWorkspaceDeveloperInstructions({
172
+ files,
173
+ header: "## OpenClaw Agent Soul",
174
+ preamble: "OpenClaw loaded these workspace instruction files from the active agent workspace. They are the canonical definitions of who you are, how you think and work, and the human you work alongside. Internalize and follow them accordingly." + (files.some((file) => file.personalUser === true) ? " The personal users/<profile-id>/USER.md belongs to this session's selected person (assigned human owner, otherwise human creator). It supplements shared USER.md and overrides conflicting shared preferences, not higher-priority rules. Other participants do not change this personal context." : ""),
175
+ wrapperTag: "AGENT_SOUL"
176
+ });
177
+ }
178
+ function renderCodexWorkspaceDeveloperInstructions(params) {
179
+ const { files, header, preamble, wrapperTag } = params;
180
+ if (files.length === 0) return;
181
+ const lines = [
182
+ header,
183
+ "",
184
+ preamble,
185
+ ""
186
+ ];
187
+ if (wrapperTag) lines.push(`<${wrapperTag}>`, "");
188
+ for (const file of files) lines.push(`### ${file.path}`, "", file.content, "");
189
+ if (wrapperTag) lines.push(`</${wrapperTag}>`);
190
+ return lines.join("\n").trim();
191
+ }
192
+ function selectCodexWorkspaceMemoryReferenceFiles(params) {
193
+ return params.bootstrapFiles.filter((file) => {
194
+ return isCodexWorkspaceRootMemoryBootstrapFile({
195
+ file,
196
+ workspaceDir: params.workspaceDir
197
+ }) && !file.missing && (file.content ?? "").trim().length > 0;
198
+ }).toSorted(compareCodexBootstrapFiles);
199
+ }
200
+ /**
201
+ * Renders a memory-file reference that points Codex at memory tools instead of
202
+ * embedding MEMORY.md contents.
203
+ */
204
+ function renderCodexWorkspaceMemoryReference(params) {
205
+ if (params.files.length === 0) return;
206
+ const lines = [
207
+ "## OpenClaw Workspace Memory",
208
+ "",
209
+ `MEMORY.md exists in the active agent workspace as a memory file, not an instruction file. OpenClaw does not paste its contents into native Codex turns; use ${(params.toolNames?.length ? params.toolNames : Array.from(CODEX_MEMORY_TOOL_NAMES)).join(" or ")} when durable memory is relevant and the tools are available.`,
210
+ ""
211
+ ];
212
+ for (const file of params.files) lines.push(`- ${file.path}`);
213
+ return lines.join("\n").trim();
214
+ }
215
+ async function renderCodexWorkspaceMemoryCollaborationInstructions(params) {
216
+ const sections = [params.memoryToolRouted ? await renderCodexMemoryRecallInstructions({
217
+ toolNames: params.toolNames,
218
+ citationsMode: params.citationsMode,
219
+ agentId: params.agentId,
220
+ agentSessionKey: params.agentSessionKey,
221
+ sandboxed: params.sandboxed
222
+ }) : void 0, renderCodexWorkspaceMemoryReference({
223
+ files: params.files,
224
+ toolNames: params.toolNames
225
+ })].filter(isNonEmptyString);
226
+ return sections.length > 0 ? sections.join("\n\n") : void 0;
227
+ }
228
+ async function renderCodexMemoryRecallInstructions(params) {
229
+ const availableTools = new Set(params.toolNames);
230
+ const memoryPrompt = await prepareMemorySystemPromptAddition({
231
+ availableTools,
232
+ citationsMode: params.citationsMode,
233
+ agentId: params.agentId,
234
+ agentSessionKey: params.agentSessionKey,
235
+ sandboxed: params.sandboxed
236
+ }).catch((error) => {
237
+ embeddedAgentLog.warn("failed to prepare codex memory recall instructions", { error });
238
+ });
239
+ if (!memoryPrompt) return;
240
+ return [memoryPrompt, renderCodexMemoryToolSearchBridge(params.toolNames)].filter(isNonEmptyString).join("\n").trim();
241
+ }
242
+ function renderCodexMemoryToolSearchBridge(toolNames) {
243
+ const memoryToolNames = toolNames.map((name) => normalizeCodexDynamicToolName(name)).filter((name) => CODEX_MEMORY_TOOL_NAMES.has(name)).toSorted();
244
+ if (memoryToolNames.length === 0) return;
245
+ return `Codex may expose ${memoryToolNames.join(" and ")} as deferred tools. When the memory guidance above calls for memory recall, use an already-loaded memory tool directly. If the needed memory tool is deferred and not currently callable, use \`tool_search\` to load it, then call that memory tool.`;
246
+ }
247
+ /** Lists available memory tool names understood by Codex workspace memory routing. */
248
+ function getCodexWorkspaceMemoryToolNames(tools) {
249
+ const availableToolNames = new Set(flattenCodexDynamicToolFunctions(tools).map((tool) => normalizeCodexDynamicToolName(tool.name)));
250
+ return Array.from(CODEX_MEMORY_TOOL_NAMES).filter((name) => availableToolNames.has(name));
251
+ }
252
+ function canRouteCodexWorkspaceMemoryThroughTools(params) {
253
+ if (!params.config) return false;
254
+ return isSameCodexWorkspacePath(resolveAgentWorkspaceDir(params.config, params.agentId), params.workspaceDir);
255
+ }
256
+ function isMissingCodexBootstrapContextFile(file) {
257
+ return file.content.trimStart().startsWith("[MISSING] Expected at:");
258
+ }
259
+ function toCodexEmbeddedContextFile(file) {
260
+ return {
261
+ path: readNonBlankString(file.path) ?? readNonBlankString(file.name) ?? "",
262
+ content: file.content ?? "",
263
+ ...file.personalUser === true ? { personalUser: true } : {}
264
+ };
265
+ }
266
+ function isCodexWorkspaceRootMemoryBootstrapFile(params) {
267
+ return isCodexWorkspaceRootMemoryPath({
268
+ filePath: readNonBlankString(params.file.path) ?? readNonBlankString(params.file.name) ?? "",
269
+ workspaceDir: params.workspaceDir
270
+ });
271
+ }
272
+ function isCodexWorkspaceRootMemoryContextFile(params) {
273
+ if (!params.workspaceDir) return false;
274
+ return isCodexWorkspaceRootMemoryPath({
275
+ filePath: params.file.path,
276
+ workspaceDir: params.workspaceDir
277
+ });
278
+ }
279
+ function isCodexWorkspaceRootMemoryPath(params) {
280
+ const filePath = params.filePath.trim();
281
+ if (!filePath) return false;
282
+ return (path.isAbsolute(filePath) ? path.resolve(filePath) : path.resolve(params.workspaceDir, filePath)) === path.join(path.resolve(params.workspaceDir), "MEMORY.md");
283
+ }
284
+ function isSameCodexWorkspacePath(left, right) {
285
+ return path.resolve(left) === path.resolve(right);
286
+ }
287
+ /**
288
+ * Remaps bootstrap file paths from the resolved workspace to the effective Codex
289
+ * workspace while preserving platform path separators.
290
+ */
291
+ function remapCodexContextFilePath(params) {
292
+ const relativePath = path.relative(params.sourceWorkspaceDir, params.file.path);
293
+ if (!relativePath || relativePath === ".." || relativePath.startsWith(`..${path.sep}`) || path.isAbsolute(relativePath) || params.sourceWorkspaceDir === params.targetWorkspaceDir) return params.file;
294
+ const targetUsesPosixSeparators = params.targetWorkspaceDir.includes("/") && !params.targetWorkspaceDir.includes("\\");
295
+ const normalizedRelativePath = targetUsesPosixSeparators ? relativePath.replaceAll("\\", "/") : relativePath.replaceAll("/", "\\");
296
+ return {
297
+ ...params.file,
298
+ path: targetUsesPosixSeparators ? path.posix.join(params.targetWorkspaceDir, normalizedRelativePath) : path.win32.join(params.targetWorkspaceDir, normalizedRelativePath)
299
+ };
300
+ }
301
+ function compareCodexContextFiles(left, right) {
302
+ const leftPath = normalizeCodexContextFilePath(left.path);
303
+ const rightPath = normalizeCodexContextFilePath(right.path);
304
+ const leftBase = getCodexContextFileBasename(left.path);
305
+ const rightBase = getCodexContextFileBasename(right.path);
306
+ const leftOrder = CODEX_BOOTSTRAP_CONTEXT_ORDER.get(leftBase) ?? Number.MAX_SAFE_INTEGER;
307
+ const rightOrder = CODEX_BOOTSTRAP_CONTEXT_ORDER.get(rightBase) ?? Number.MAX_SAFE_INTEGER;
308
+ if (leftOrder !== rightOrder) return leftOrder - rightOrder;
309
+ if (leftBase !== rightBase) return leftBase.localeCompare(rightBase);
310
+ return leftBase === "user.md" ? 0 : leftPath.localeCompare(rightPath);
311
+ }
312
+ function compareCodexBootstrapFiles(left, right) {
313
+ return compareCodexContextFiles(toCodexEmbeddedContextFile(left), toCodexEmbeddedContextFile(right));
314
+ }
315
+ function normalizeCodexContextFilePath(filePath) {
316
+ return filePath.trim().replaceAll("\\", "/").toLowerCase();
317
+ }
318
+ function getCodexContextFileDisplayBasename(filePath) {
319
+ return filePath.trim().replaceAll("\\", "/").split("/").pop()?.trim() ?? "";
320
+ }
321
+ function getCodexContextFileBasename(filePath) {
322
+ return normalizeCodexContextFilePath(filePath).split("/").pop() ?? "";
323
+ }
324
+ function normalizeCodexDynamicToolName(name) {
325
+ return name.trim().toLowerCase();
326
+ }
327
+ function isNonEmptyString(value) {
328
+ return typeof value === "string" && value.length > 0;
329
+ }
330
+ //#endregion
331
+ export { getCodexContextFileDisplayBasename as a, normalizeCodexContextFilePath as c, shouldInjectCodexOpenClawPromptContext as d, getCodexContextFileBasename as i, normalizeCodexDynamicToolName as l, CODEX_NATIVE_PROJECT_DOC_BASENAMES as n, getCodexWorkspaceMemoryToolNames as o, buildCodexWorkspaceBootstrapContext as r, isNonEmptyString as s, CODEX_MEMORY_CONTEXT_BASENAME as t, prepareCodexWorkspaceDeveloperInstructions as u };
@@ -1,11 +1,12 @@
1
- import { n as defineCodexBuildState } from "./build-state-Xx9ybZqa.mjs";
2
- import { c as resolveMacOSDesktopCodexAppPathCandidates } from "./managed-binary-DP6Rib3P.mjs";
3
- import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-Cmx94Oiy.mjs";
1
+ import { n as defineCodexBuildState } from "./build-state-C7EnDVgr.mjs";
2
+ import { u as resolveMacOSDesktopCodexAppPathCandidates } from "./managed-binary-BnshlFag.mjs";
3
+ import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-h2VHOskC.mjs";
4
4
  import { createHash } from "node:crypto";
5
5
  import fs, { constants, existsSync, watch } from "node:fs";
6
6
  import path from "node:path";
7
7
  import os from "node:os";
8
8
  import fs$1 from "node:fs/promises";
9
+ import { sha256File } from "openclaw/plugin-sdk/file-access-runtime";
9
10
  import { readSecretFile } from "openclaw/plugin-sdk/secret-file";
10
11
  //#region extensions/codex/src/app-server/desktop-generation-fingerprint.ts
11
12
  const MAX_COMPUTER_USE_PLUGIN_TREE_ENTRIES = 4096;
@@ -94,10 +95,10 @@ async function readFileFingerprint(filePath, expected, followsSymlink) {
94
95
  try {
95
96
  const before = await handle.stat({ bigint: true });
96
97
  if (!sameStat(before, expected)) throw new Error(`Codex desktop artifact changed while fingerprinting: ${filePath}`);
97
- const hash = createHash("sha256");
98
- for await (const chunk of handle.createReadStream({ autoClose: false })) hash.update(chunk);
99
- if (!sameStat(before, await handle.stat({ bigint: true }))) throw new Error(`Codex desktop artifact changed while fingerprinting: ${filePath}`);
100
- return hash.digest("hex");
98
+ const hash = await sha256File(handle, { maxBytes: Number(before.size) });
99
+ const after = await handle.stat({ bigint: true });
100
+ if (BigInt(hash.bytes) !== before.size || !sameStat(before, after)) throw new Error(`Codex desktop artifact changed while fingerprinting: ${filePath}`);
101
+ return hash.digest;
101
102
  } finally {
102
103
  await handle.close();
103
104
  }
@@ -321,79 +322,6 @@ function closeWatchers(current) {
321
322
  for (const watcher of watchers ?? []) watcher.close();
322
323
  }
323
324
  //#endregion
324
- //#region extensions/codex/src/app-server/shared-client-lifecycle.ts
325
- /** Client ownership and synchronous retirement, independent of startup/auth execution. */
326
- const createCodexAppServerStartupLifetime = () => ({
327
- controller: new AbortController(),
328
- pending: /* @__PURE__ */ new Set()
329
- });
330
- const getSharedCodexAppServerClientState = defineCodexBuildState("openclaw.codexAppServerClientState", () => ({
331
- clients: /* @__PURE__ */ new Map(),
332
- liveClients: /* @__PURE__ */ new Set(),
333
- isolatedClients: /* @__PURE__ */ new Set(),
334
- entriesByClient: /* @__PURE__ */ new WeakMap(),
335
- desktopGenerationDrainChecks: /* @__PURE__ */ new Set(),
336
- startup: createCodexAppServerStartupLifetime(),
337
- startMetadata: /* @__PURE__ */ new WeakMap()
338
- }));
339
- function getCurrentSharedClientEntry(client) {
340
- const state = getSharedCodexAppServerClientState();
341
- const entry = client ? state.entriesByClient.get(client) : void 0;
342
- return entry && entry.client === client && state.clients.get(entry.key) === entry ? entry : void 0;
343
- }
344
- /**
345
- * Retires a matching shared client. Default is graceful: detach from the map
346
- * (future acquisitions get a fresh client) and close once leases drain.
347
- * `failActiveLeases` is for suspect clients only (timed-out turns): it closes
348
- * the physical connection immediately so co-leased attempts hit the normal
349
- * client-closed retry path, and pending acquires reject instead of leasing
350
- * the poisoned process. Routine cleanup must NOT use it — it would abort
351
- * healthy sibling turns on a working client.
352
- */
353
- function retireSharedCodexAppServerClientIfCurrent(client, opts) {
354
- if (!client) return;
355
- const state = getSharedCodexAppServerClientState();
356
- const currentEntry = getCurrentSharedClientEntry(client);
357
- const entry = currentEntry ?? state.entriesByClient.get(client);
358
- if (!entry || entry.client !== client && !entry.closeError) return;
359
- if (currentEntry) {
360
- state.clients.delete(entry.key);
361
- entry.closeWhenIdle = true;
362
- }
363
- if (opts?.failActiveLeases && (currentEntry || !entry.closeError)) {
364
- entry.closeError = /* @__PURE__ */ new Error("codex app-server client is closed");
365
- return {
366
- activeLeases: entry.activeLeases,
367
- closed: closeRetiredSharedClientEntry(entry)
368
- };
369
- }
370
- return {
371
- activeLeases: entry.activeLeases,
372
- closed: currentEntry ? closeRetiredSharedClientEntryIfIdle(entry) : false
373
- };
374
- }
375
- /** Gracefully retires exact clients attached to an older desktop generation. */
376
- function retireSharedCodexAppServerClientsBeforeDesktopGeneration(generation) {
377
- const state = getSharedCodexAppServerClientState();
378
- for (const entry of state.clients.values()) {
379
- const client = entry.client;
380
- const attached = client ? state.startMetadata.get(client) : void 0;
381
- if (client && attached?.desktopGeneration && attached.desktopGeneration.epoch < generation.epoch) retireSharedCodexAppServerClientIfCurrent(client);
382
- }
383
- }
384
- function closeRetiredSharedClientEntryIfIdle(entry) {
385
- if (!entry.closeWhenIdle || entry.activeLeases > 0 || entry.pendingAcquires > 0 || !entry.client) return false;
386
- entry.closeWhenIdle = false;
387
- return closeRetiredSharedClientEntry(entry);
388
- }
389
- function closeRetiredSharedClientEntry(entry) {
390
- const client = entry.client;
391
- if (!client) return false;
392
- entry.client = void 0;
393
- client.close();
394
- return true;
395
- }
396
- //#endregion
397
325
  //#region extensions/codex/src/app-server/auth-cache-key.ts
398
326
  /** Auth cache identity and native CLI credential reads, without login or refresh. */
399
327
  const CODEX_HOME_ENV_VAR = "CODEX_HOME";
@@ -495,4 +423,4 @@ function readFirstNonEmptyEnvEntry(env, keys) {
495
423
  }
496
424
  }
497
425
  //#endregion
498
- export { isCodexDesktopGenerationCurrent as _, readCodexCliAuthFileApiKey as a, resolveCodexAppServerPreparedApiKeyCacheKey as c, createCodexAppServerStartupLifetime as d, getCurrentSharedClientEntry as f, createCodexDesktopGenerationService as g, retireSharedCodexAppServerClientsBeforeDesktopGeneration as h, fingerprintTokenAuthProfileCacheKey as i, closeRetiredSharedClientEntry as l, retireSharedCodexAppServerClientIfCurrent as m, CODEX_AUTH_JSON_FILENAME as n, readFirstNonEmptyEnv as o, getSharedCodexAppServerClientState as p, fingerprintApiKeyAuthProfileCacheKey as r, resolveCodexAppServerFallbackApiKeyCacheKey as s, CODEX_APP_SERVER_API_KEY_ENV_VARS as t, closeRetiredSharedClientEntryIfIdle as u, waitForCodexDesktopGeneration as v };
426
+ export { readCodexCliAuthFileApiKey as a, resolveCodexAppServerPreparedApiKeyCacheKey as c, waitForCodexDesktopGeneration as d, fingerprintTokenAuthProfileCacheKey as i, createCodexDesktopGenerationService as l, CODEX_AUTH_JSON_FILENAME as n, readFirstNonEmptyEnv as o, fingerprintApiKeyAuthProfileCacheKey as r, resolveCodexAppServerFallbackApiKeyCacheKey as s, CODEX_APP_SERVER_API_KEY_ENV_VARS as t, isCodexDesktopGenerationCurrent as u };
@@ -0,0 +1,53 @@
1
+ import { r as formatCodexAuthProfileUnavailableMessage, t as CODEX_NATIVE_PROFILE_IMPORT_COMMAND } from "./auth-profile-recovery-BREezV0L.mjs";
2
+ //#region extensions/codex/src/auth-profile-health.ts
3
+ const CHECK_ID = "codex/native-profile-recovery";
4
+ const PROFILE_ID = "openai:default";
5
+ async function collectFindings(config, env) {
6
+ const declared = config.auth?.profiles?.[PROFILE_ID];
7
+ if (declared?.provider !== "openai" || declared.mode !== "oauth") return [];
8
+ const [{ loadAuthProfileStoreForRuntime }, { listAgentIds, resolveAgentDir }] = await Promise.all([import("openclaw/plugin-sdk/agent-runtime"), import("openclaw/plugin-sdk/agent-scope-runtime")]);
9
+ const findings = [];
10
+ const missing = [];
11
+ for (const agentId of listAgentIds(config)) try {
12
+ if (!loadAuthProfileStoreForRuntime(resolveAgentDir(config, agentId, env), {
13
+ readOnly: true,
14
+ config,
15
+ externalCli: { mode: "none" }
16
+ }, env).profiles[PROFILE_ID]) missing.push(agentId);
17
+ } catch (error) {
18
+ findings.push({
19
+ checkId: CHECK_ID,
20
+ source: "codex",
21
+ severity: "warning",
22
+ message: `Could not inspect OpenAI auth profiles for agent "${agentId}": ${error instanceof Error ? error.message : String(error)}`,
23
+ fixHint: "openclaw doctor --fix"
24
+ });
25
+ }
26
+ if (missing.length > 0) findings.push({
27
+ checkId: CHECK_ID,
28
+ source: "codex",
29
+ severity: "warning",
30
+ message: `${formatCodexAuthProfileUnavailableMessage(PROFILE_ID)} Affected agents: ${missing.join(", ")}.`,
31
+ fixHint: CODEX_NATIVE_PROFILE_IMPORT_COMMAND
32
+ });
33
+ return findings;
34
+ }
35
+ const codexNativeProfileRecoveryHealthCheck = {
36
+ id: CHECK_ID,
37
+ kind: "plugin",
38
+ source: "codex",
39
+ description: "Explain recovery for a configured profile formerly supplied by native Codex login.",
40
+ detect: (ctx) => collectFindings(ctx.cfg, ctx.env ?? process.env)
41
+ };
42
+ const codexNativeProfileRecoveryService = {
43
+ id: CHECK_ID,
44
+ async start(ctx) {
45
+ const findings = await collectFindings(ctx.config, {
46
+ ...process.env,
47
+ OPENCLAW_STATE_DIR: ctx.stateDir
48
+ });
49
+ for (const finding of findings) ctx.logger.warn(finding.message);
50
+ }
51
+ };
52
+ //#endregion
53
+ export { codexNativeProfileRecoveryService as n, codexNativeProfileRecoveryHealthCheck as t };
@@ -0,0 +1,14 @@
1
+ //#region extensions/codex/src/app-server/auth-profile-recovery.ts
2
+ const CODEX_NATIVE_PROFILE_IMPORT_COMMAND = "openclaw models auth login --provider openai --method device-code";
3
+ var CodexAppServerAuthProfileUnavailableError = class extends Error {
4
+ constructor(..._args) {
5
+ super(..._args);
6
+ this.code = "selected_auth_profile_unavailable";
7
+ }
8
+ };
9
+ function formatCodexAuthProfileUnavailableMessage(profileId) {
10
+ const missing = `Codex app-server auth profile "${profileId}" was not found in the OpenClaw credential store. This is a local credential lookup failure.`;
11
+ return profileId === "openai:default" ? `${missing} Since 2026.9.5, OpenClaw no longer supplies this profile from the native Codex login. Run \`${CODEX_NATIVE_PROFILE_IMPORT_COMMAND}\` to import that login or sign in through OpenClaw, then retry. For multiple agents, add \`--agent <id>\`.` : `${missing} Restore or select an existing OpenAI profile, then retry.`;
12
+ }
13
+ //#endregion
14
+ export { CodexAppServerAuthProfileUnavailableError as n, formatCodexAuthProfileUnavailableMessage as r, CODEX_NATIVE_PROFILE_IMPORT_COMMAND as t };
@@ -44,7 +44,7 @@ function requireCodexSupervisionModelSelection(binding) {
44
44
  }
45
45
  /** Registration publishes the resolver; connection policy loads only for an actual request. */
46
46
  async function resolveCodexBindingAppServerConnection(params) {
47
- return (await import("./binding-connection.runtime-CnRMC0ta.mjs")).resolveCodexBindingAppServerConnection(params, catalogHomes.tryGetRuntime());
47
+ return (await import("./binding-connection.runtime-yoHrABt-.mjs")).resolveCodexBindingAppServerConnection(params, catalogHomes.tryGetRuntime());
48
48
  }
49
49
  //#endregion
50
50
  export { setCodexCatalogConnectionHomeResolver as a, resolveCodexBindingAppServerConnection as i, binding_connection_exports as n, requireCodexSupervisionModelSelection as r, assertCodexSessionRuntimeOwnership as t };
@@ -1,7 +1,7 @@
1
- import { g as resolveCodexAppServerLocalHomeDir } from "./config-security-BRQ2mgW9.mjs";
1
+ import { f as resolveCodexAppServerLocalHomeDir } from "./config-security-BEReZ6go.mjs";
2
2
  import { d as readCodexPluginConfig } from "./config-parsing-CcB9iPoq.mjs";
3
- import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-BOxKP7db.mjs";
4
- import { n as resolveCodexAppServerRuntimeOptions, r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-CeAhl_h4.mjs";
3
+ import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-B2CsSdnV.mjs";
4
+ import { n as resolveCodexAppServerRuntimeOptions, r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-C8Rw1m1m.mjs";
5
5
  //#region extensions/codex/src/app-server/binding-connection.runtime.ts
6
6
  /** Resolves connection and auth ownership exclusively from the private thread binding. */
7
7
  async function resolveCodexBindingAppServerConnection(params, discoverHomes) {
@@ -41,7 +41,7 @@ async function resolveCodexBindingAppServerConnection(params, discoverHomes) {
41
41
  appServer,
42
42
  usesSupervisionConnection,
43
43
  requestAuthProfileId: usesSupervisionConnection ? void 0 : authProfileId,
44
- clientAuthProfileId: usesSupervisionConnection ? null : authProfileId
44
+ clientAuthProfileId: usesSupervisionConnection || appServer.start.homeScope === "user" ? null : authProfileId
45
45
  };
46
46
  }
47
47
  //#endregion