@openclaw/codex 2026.7.1-beta.6 → 2026.7.2-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.
Files changed (46) hide show
  1. package/README.md +27 -3
  2. package/dist/app-server-policy-DVcxdse_.js +49 -0
  3. package/dist/{attempt-notifications-BGsEIIDI.js → attempt-notifications-DEv9h7iC.js} +1 -1
  4. package/dist/auth-binding-C1czuHPA.js +62 -0
  5. package/dist/capabilities-42Dfn2TV.js +33 -0
  6. package/dist/cli-metadata.js +20 -0
  7. package/dist/{app-server-policy-C968Kgin.js → command-formatters-D6ZlGNmb.js} +8 -51
  8. package/dist/{command-handlers-Dv-pzAmg.js → command-handlers-Cpl9fUWv.js} +163 -60
  9. package/dist/{compact-4mVBriKT.js → compact-FnJmiPNA.js} +40 -10
  10. package/dist/computer-use-DVzr8OP1.js +685 -0
  11. package/dist/{config-CYEDnLJ2.js → config-c48K5HP9.js} +200 -29
  12. package/dist/conversation-control-DtQ-E7mr.js +288 -0
  13. package/dist/doctor-contract-api.js +120 -81
  14. package/dist/{provider-capabilities-CDnHbmUZ.js → dynamic-tools-BMLoaTeG.js} +5246 -5140
  15. package/dist/harness.js +55 -15
  16. package/dist/index.js +1435 -265
  17. package/dist/{media-understanding-provider-BHOu9-Gg.js → media-understanding-provider-D580L0P8.js} +28 -10
  18. package/dist/media-understanding-provider.js +1 -1
  19. package/dist/{models-DDmO1zwd.js → models-DuKzZA6G.js} +1 -1
  20. package/dist/notification-correlation-DfaCm0mx.js +67 -0
  21. package/dist/plugin-app-cache-key-BKNjHMEs.js +315 -0
  22. package/dist/{protocol-2POPqAY4.js → protocol-BMifTfdW.js} +3 -1
  23. package/dist/provider-catalog.js +66 -27
  24. package/dist/provider.js +306 -1
  25. package/dist/{provider-zjPfx5Fs.js → rate-limits-Dhp04Rqo.js} +4 -261
  26. package/dist/request-DborTWgw.js +111 -0
  27. package/dist/{run-attempt-FUyOjGCV.js → run-attempt-VPVJoYDP.js} +7897 -7136
  28. package/dist/runtime-artifact-C2ITXdhM.js +488 -0
  29. package/dist/{sandbox-guard-DA2TQfZW.js → sandbox-guard-D1Wky__S.js} +10 -1
  30. package/dist/{session-binding-C1ZXdP-x.js → session-binding-BMfX1OX-.js} +247 -88
  31. package/dist/session-catalog-7H112Tr_.js +2396 -0
  32. package/dist/session-cli-B28RhCyp.js +175 -0
  33. package/dist/{shared-client-4ICy3U6d.js → shared-client-D4mFI9al.js} +1997 -1297
  34. package/dist/{side-question-N4OaDer2.js → side-question-CgJBz52s.js} +135 -67
  35. package/dist/{thread-lifecycle-qWE88Dn2.js → thread-lifecycle-BgLXzjvV.js} +747 -317
  36. package/dist/transcript-mirror-DhLwFIL4.js +485 -0
  37. package/dist/transport-stdio-DXgGZ7Ib.js +88 -0
  38. package/dist/{web-search-provider.runtime-BSlriav6.js → web-search-provider.runtime-Bs-eTn5U.js} +3 -3
  39. package/npm-shrinkwrap.json +56 -30
  40. package/openclaw.plugin.json +168 -10
  41. package/package.json +8 -6
  42. package/dist/command-rpc-eLM_mtC7.js +0 -784
  43. package/dist/computer-use-Bmaz333N.js +0 -377
  44. package/dist/notification-correlation-Bo7KB3ks.js +0 -35
  45. package/dist/plugin-app-cache-key-BrhVdeEf.js +0 -98
  46. package/dist/request-BcJyl8KL.js +0 -36
@@ -1,14 +1,15 @@
1
- import { r as isJsonObject } from "./protocol-2POPqAY4.js";
2
- import { _ as shouldAutoApproveCodexAppServerApprovals, d as resolveCodexAppServerRuntimeOptions, g as resolveOpenClawExecPolicyForCodexAppServer, m as resolveCodexModelBackedReviewerPolicyContext, n as canUseCodexModelBackedApprovalsReviewerForModel, u as readCodexPluginConfig } from "./config-CYEDnLJ2.js";
1
+ import { i as isJsonObject } from "./protocol-BMifTfdW.js";
2
+ import { b as shouldAutoApproveCodexAppServerApprovals, d as readCodexPluginConfig, g as resolveCodexModelBackedReviewerPolicyContext, i as canUseCodexModelBackedApprovalsReviewerForModel, y as resolveOpenClawExecPolicyForCodexAppServer } from "./config-c48K5HP9.js";
3
3
  import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse, t as assertCodexThreadForkResponse } from "./protocol-validators-dZQ-UTOa.js";
4
- import { C as filterCodexDynamicTools, E as resolveCodexDynamicToolsLoading, H as mergeCodexThreadConfigs, d as resolveCodexAppServerModelProvider, f as resolveCodexAppServerRequestModelSelection, h as resolveReasoningEffort, m as resolveCodexBindingModelProviderFallback, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE, v as resolveCodexWebSearchPlan, z as buildCodexPluginAppsConfigPatchFromPolicyContext } from "./thread-lifecycle-qWE88Dn2.js";
5
- import { a as readCodexSupportedReasoningEfforts, c as formatCodexUsageLimitErrorMessage } from "./provider-zjPfx5Fs.js";
6
- import { a as getLeasedSharedCodexAppServerClient, d as isCodexAppServerApprovalRequest, h as readRecentCodexRateLimits, o as releaseLeasedSharedCodexAppServerClient, p as ensureCodexAppServerClientRuntime } from "./shared-client-4ICy3U6d.js";
7
- import { i as isCodexAppServerNativeAuthProfile, s as sessionBindingIdentity } from "./session-binding-C1ZXdP-x.js";
8
- import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-C968Kgin.js";
9
- import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-DA2TQfZW.js";
10
- import { n as readCodexNotificationThreadId, r as readCodexNotificationTurnId } from "./notification-correlation-Bo7KB3ks.js";
11
- import { D as emitDynamicToolStartedDiagnostic, E as emitDynamicToolErrorDiagnostic, I as resolveCodexMessageToolProvider, O as emitDynamicToolTerminalDiagnostic, R as shouldEnableCodexAppServerNativeToolSurface, T as createCodexDynamicToolBridge, U as handleCodexAppServerApprovalRequest, V as filterToolsForVisionInputs, Z as handleDynamicToolCallWithTimeout, _ as buildCodexNativeHookRelayDisabledConfig, g as buildCodexNativeHookRelayConfig, i as CodexNativeToolLifecycleProjector, m as CODEX_NATIVE_HOOK_RELAY_EVENTS, n as resolveCodexProviderWebSearchSupportForClient, st as resolveCodexToolAbortTerminalReason, tt as resolveDynamicToolCallTimeoutMs, w as handleCodexAppServerElicitationRequest, y as emitCodexNativePreToolUseFailureDiagnostic } from "./provider-capabilities-CDnHbmUZ.js";
4
+ import { A as isCodexAppServerApprovalRequest, T as resolveCodexAppServerPreparedAuthHandoff, a as getLeasedSharedCodexAppServerClient, g as ensureCodexAppServerClientRuntime, p as withLeasedCodexAppServerClientStartSelectionRetry, s as releaseCodexAppServerClientLease, v as readRecentCodexRateLimits } from "./shared-client-D4mFI9al.js";
5
+ import { O as resolveCodexDynamicToolsLoading, V as buildCodexPluginAppsConfigPatchFromPolicyContext, W as mergeCodexThreadConfigs, d as resolveCodexAppServerModelProvider, f as resolveCodexAppServerRequestModelSelection, h as resolveReasoningEffort, m as resolveCodexBindingModelProviderFallback, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE, v as resolveCodexWebSearchPlan, w as filterCodexDynamicTools } from "./thread-lifecycle-BgLXzjvV.js";
6
+ import { c as sessionBindingIdentity } from "./session-binding-BMfX1OX-.js";
7
+ import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-Dhp04Rqo.js";
8
+ import { readCodexSupportedReasoningEfforts } from "./provider.js";
9
+ import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-DVcxdse_.js";
10
+ import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-D1Wky__S.js";
11
+ import { a as resolveCodexBindingAppServerConnection, i as requireCodexSupervisionModelSelection, n as readCodexNotificationThreadId, r as readCodexNotificationTurnId } from "./notification-correlation-DfaCm0mx.js";
12
+ import { A as CodexNativeToolLifecycleProjector, B as handleDynamicToolCallWithTimeout, C as resolveCodexMessageToolProvider, I as emitCodexNativePreToolUseFailureDiagnostic, N as buildCodexNativeHookRelayConfig, O as filterToolsForVisionInputs, P as buildCodexNativeHookRelayDisabledConfig, T as shouldEnableCodexAppServerNativeToolSurface, W as resolveDynamicToolCallTimeoutMs, X as resolveCodexToolAbortTerminalReason, a as emitDynamicToolStartedDiagnostic, c as resolveCodexProviderWebSearchSupportForClient, i as emitDynamicToolErrorDiagnostic, j as CODEX_NATIVE_HOOK_RELAY_EVENTS, n as handleCodexAppServerApprovalRequest, o as emitDynamicToolTerminalDiagnostic, r as handleCodexAppServerElicitationRequest, t as createCodexDynamicToolBridge } from "./dynamic-tools-BMLoaTeG.js";
12
13
  import { randomUUID } from "node:crypto";
13
14
  import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
14
15
  import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
@@ -67,10 +68,27 @@ async function runCodexAppServerSideQuestion(params, options) {
67
68
  config: params.cfg,
68
69
  agentId: sessionAgentId
69
70
  });
70
- const authProfileId = params.authProfileId ?? binding.authProfileId;
71
- const modelProvider = resolveCodexAppServerModelProvider({
71
+ const usesSupervisionConnection = binding.connectionScope === "supervision";
72
+ const supervisionModelSelection = usesSupervisionConnection ? requireCodexSupervisionModelSelection(binding) : void 0;
73
+ const preparedRuntimeAuth = params.preparedRuntimeAuth;
74
+ const { authProfileId, nativeAuthProfile: preparedNativeAuthProfile, preparedAuth: startupPreparedAuth } = usesSupervisionConnection ? {
75
+ authProfileId: void 0,
76
+ nativeAuthProfile: true,
77
+ preparedAuth: void 0
78
+ } : await resolveCodexAppServerPreparedAuthHandoff({
79
+ authRequirement: preparedRuntimeAuth.plan.modelRoute?.authRequirement,
80
+ resolvedApiKey: preparedRuntimeAuth.resolvedApiKey,
81
+ authProfileId: preparedRuntimeAuth.plan.forwardedAuthProfileId,
82
+ authProfileStore: preparedRuntimeAuth.authProfileStore,
83
+ agentDir: params.agentDir,
84
+ config: params.cfg,
85
+ subscriptionProfileRequiredError: "Prepared Codex subscription route requires a scoped native OAuth or token profile.",
86
+ subscriptionProfileUnusableError: `Prepared Codex auth profile "${preparedRuntimeAuth.plan.forwardedAuthProfileId}" is unusable.`
87
+ });
88
+ const modelProvider = supervisionModelSelection ? supervisionModelSelection.modelProvider : resolveCodexAppServerModelProvider({
72
89
  provider: params.provider,
73
90
  authProfileId,
91
+ authProfileStore: preparedRuntimeAuth.authProfileStore,
74
92
  agentDir: params.agentDir,
75
93
  config: params.cfg
76
94
  }) ?? resolveCodexBindingModelProviderFallback({
@@ -80,24 +98,23 @@ async function runCodexAppServerSideQuestion(params, options) {
80
98
  bindingModelProvider: binding.modelProvider
81
99
  });
82
100
  const modelSelection = resolveCodexAppServerRequestModelSelection({
83
- model: params.model,
101
+ model: supervisionModelSelection?.model ?? params.model,
84
102
  modelProvider,
85
103
  authProfileId,
104
+ authProfileStore: preparedRuntimeAuth.authProfileStore,
86
105
  agentDir: params.agentDir,
87
106
  config: params.cfg
88
107
  });
89
108
  const reviewerPolicyContext = resolveCodexModelBackedReviewerPolicyContext({
90
- provider: params.provider,
91
- model: params.model,
109
+ provider: usesSupervisionConnection ? "codex" : params.provider,
110
+ model: supervisionModelSelection?.model ?? params.model,
92
111
  bindingModelProvider: binding.modelProvider,
93
112
  bindingModel: binding.model,
94
- nativeAuthProfile: isCodexAppServerNativeAuthProfile({
95
- authProfileId,
96
- agentDir: params.agentDir,
97
- config: params.cfg
98
- })
113
+ nativeAuthProfile: usesSupervisionConnection || preparedNativeAuthProfile
99
114
  });
100
- const appServer = resolveCodexAppServerRuntimeOptions({
115
+ const connection = resolveCodexBindingAppServerConnection({
116
+ binding,
117
+ authProfileId,
101
118
  pluginConfig,
102
119
  execPolicy,
103
120
  modelProvider: reviewerPolicyContext.modelProvider,
@@ -105,9 +122,29 @@ async function runCodexAppServerSideQuestion(params, options) {
105
122
  config: params.cfg,
106
123
  agentDir: params.agentDir
107
124
  });
125
+ const appServer = connection.appServer;
108
126
  const cwd = binding.cwd || params.workspaceDir || process.cwd();
109
127
  const runId = params.opts?.runId ?? randomUUID();
110
- const sideRunParams = buildSideRunAttemptParams(params, {
128
+ const effectiveParams = supervisionModelSelection ? {
129
+ ...params,
130
+ provider: supervisionModelSelection.modelProvider,
131
+ model: supervisionModelSelection.model,
132
+ runtimeModel: {
133
+ id: supervisionModelSelection.model,
134
+ name: supervisionModelSelection.model,
135
+ provider: supervisionModelSelection.modelProvider,
136
+ api: "openai-chatgpt-responses",
137
+ reasoning: true,
138
+ input: ["text", "image"],
139
+ cost: {
140
+ input: 0,
141
+ output: 0,
142
+ cacheRead: 0,
143
+ cacheWrite: 0
144
+ }
145
+ }
146
+ } : params;
147
+ const sideRunParams = buildSideRunAttemptParams(effectiveParams, {
111
148
  cwd,
112
149
  authProfileId,
113
150
  runId
@@ -121,13 +158,16 @@ async function runCodexAppServerSideQuestion(params, options) {
121
158
  if (nativeExecutionBlock) throw new Error(nativeExecutionBlock);
122
159
  const nativeToolSurfaceEnabled = shouldEnableCodexAppServerNativeToolSurface(sideRunParams);
123
160
  if (!nativeToolSurfaceEnabled) throw new Error("Codex-native /btw side-question mode is unavailable because the effective tool policy restricts Codex native tools for this session.");
124
- const client = await getLeasedSharedCodexAppServerClient({
161
+ const clientOptions = {
125
162
  startOptions: appServer.start,
126
163
  timeoutMs: appServer.requestTimeoutMs,
127
- authProfileId,
164
+ ...startupPreparedAuth ? { preparedAuth: startupPreparedAuth } : { authProfileId: connection.clientAuthProfileId },
128
165
  agentDir: params.agentDir,
129
- config: params.cfg
130
- });
166
+ config: params.cfg,
167
+ ...params.opts?.abortSignal ? { abandonSignal: params.opts.abortSignal } : {}
168
+ };
169
+ let client = await getLeasedSharedCodexAppServerClient(clientOptions);
170
+ const clientLease = { client };
131
171
  const collector = new CodexSideQuestionCollector(params, () => readRecentCodexRateLimits(client));
132
172
  const runAbortController = new AbortController();
133
173
  let nativeToolLifecycleProjector;
@@ -157,7 +197,7 @@ async function runCodexAppServerSideQuestion(params, options) {
157
197
  }
158
198
  flushPendingNativePreToolUseFailures();
159
199
  };
160
- const removeNotificationHandler = client.addNotificationHandler((notification) => {
200
+ const handleNotification = (notification) => {
161
201
  collector.handleNotification(notification);
162
202
  if (notification.method !== "item/started" && notification.method !== "item/completed" && notification.method !== "rawResponseItem/completed" && notification.method !== "turn/completed") return;
163
203
  if (!nativeToolLifecycleProjector) {
@@ -165,7 +205,8 @@ async function runCodexAppServerSideQuestion(params, options) {
165
205
  return;
166
206
  }
167
207
  nativeToolLifecycleProjector.handleNotification(notification);
168
- });
208
+ };
209
+ let removeNotificationHandler = client.addNotificationHandler(handleNotification);
169
210
  const abortFromUpstream = () => runAbortController.abort(params.opts?.abortSignal?.reason ?? "codex_side_question_abort");
170
211
  if (params.opts?.abortSignal?.aborted) abortFromUpstream();
171
212
  else params.opts?.abortSignal?.addEventListener("abort", abortFromUpstream, { once: true });
@@ -192,7 +233,7 @@ async function runCodexAppServerSideQuestion(params, options) {
192
233
  const approvalPolicy = useModelScopedPolicy ? modelScopedAppServer.approvalPolicy : binding.approvalPolicy ?? modelScopedAppServer.approvalPolicy;
193
234
  const sandbox = useModelScopedPolicy ? modelScopedAppServer.sandbox : binding.sandbox ?? modelScopedAppServer.sandbox;
194
235
  const { toolBridge, webSearchPlan } = await createCodexSideToolBridge({
195
- params,
236
+ params: effectiveParams,
196
237
  cwd,
197
238
  pluginConfig,
198
239
  sessionAgentId,
@@ -211,10 +252,14 @@ async function runCodexAppServerSideQuestion(params, options) {
211
252
  });
212
253
  ensureCodexAppServerClientRuntime(client, {
213
254
  agentDir: params.agentDir,
214
- authProfileId,
255
+ authProfileId: startupPreparedAuth?.kind === "api-key" ? void 0 : connection.requestAuthProfileId,
256
+ ...!usesSupervisionConnection ? {
257
+ authProfileStore: preparedRuntimeAuth.authProfileStore,
258
+ authMode: startupPreparedAuth?.kind === "api-key" ? "prepared-api-key" : "profile"
259
+ } : {},
215
260
  config: params.cfg
216
261
  });
217
- removeRequestHandler = client.addRequestHandler(async (request) => {
262
+ const registerRequestHandler = (targetClient) => targetClient.addRequestHandler(async (request) => {
218
263
  if (!childThreadId || !turnId) return;
219
264
  if (request.method === "mcpServer/elicitation/request") return handleCodexAppServerElicitationRequest({
220
265
  requestParams: request.params,
@@ -232,9 +277,6 @@ async function runCodexAppServerSideQuestion(params, options) {
232
277
  threadId: childThreadId,
233
278
  turnId,
234
279
  nativeHookRelay,
235
- execPolicy,
236
- execReviewerAgentId: sessionAgentId,
237
- internalExecAutoReview: modelScopedAppServer.approvalsReviewer === "user",
238
280
  autoApprove: shouldAutoApproveCodexAppServerApprovals({
239
281
  approvalPolicy,
240
282
  networkProxy: modelScopedAppServer.networkProxy,
@@ -284,6 +326,19 @@ async function runCodexAppServerSideQuestion(params, options) {
284
326
  throw error;
285
327
  }
286
328
  });
329
+ removeRequestHandler = registerRequestHandler(client);
330
+ const rebindClientHandlers = (nextClient) => {
331
+ removeRequestHandler?.();
332
+ removeNotificationHandler();
333
+ client = nextClient;
334
+ ensureCodexAppServerClientRuntime(client, {
335
+ agentDir: params.agentDir,
336
+ authProfileId: connection.requestAuthProfileId,
337
+ config: params.cfg
338
+ });
339
+ removeNotificationHandler = client.addNotificationHandler(handleNotification);
340
+ removeRequestHandler = registerRequestHandler(client);
341
+ };
287
342
  const serviceTier = binding.serviceTier ?? appServer.serviceTier;
288
343
  const nativeHookRelayEvents = resolveCodexSideNativeHookRelayEvents({
289
344
  configuredEvents: options.nativeHookRelay?.events,
@@ -323,24 +378,28 @@ async function runCodexAppServerSideQuestion(params, options) {
323
378
  nativeCodeModeOnlyEnabled: appServer.codeModeOnly
324
379
  });
325
380
  const threadConfig = mergeCodexThreadConfigs(nativeHookRelayConfig, runtimeThreadConfig, binding.pluginAppPolicyContext ? buildCodexPluginAppsConfigPatchFromPolicyContext(binding.pluginAppPolicyContext) : void 0, modelScopedAppServer.networkProxy?.configPatch) ?? runtimeThreadConfig;
326
- childThreadId = assertCodexThreadForkResponse(await forkCodexSideThread(client, {
327
- threadId: binding.threadId,
328
- model: modelSelection.model,
329
- ...modelSelection.modelProvider ? { modelProvider: modelSelection.modelProvider } : {},
330
- personality: CODEX_NATIVE_PERSONALITY_NONE,
331
- cwd,
332
- approvalPolicy,
333
- approvalsReviewer: modelScopedAppServer.approvalsReviewer,
334
- ...modelScopedAppServer.networkProxy ? {} : { sandbox },
335
- ...serviceTier ? { serviceTier } : {},
336
- config: threadConfig,
337
- developerInstructions: SIDE_DEVELOPER_INSTRUCTIONS,
338
- ephemeral: true,
339
- threadSource: "user"
340
- }, {
341
- timeoutMs: appServer.requestTimeoutMs,
342
- signal: params.opts?.abortSignal
343
- })).thread.id;
381
+ const forkResponse = assertCodexThreadForkResponse(await withLeasedCodexAppServerClientStartSelectionRetry({
382
+ lease: clientLease,
383
+ options: clientOptions,
384
+ signal: params.opts?.abortSignal,
385
+ run: async (forkClient, requestOptions) => await forkCodexSideThread(forkClient, {
386
+ threadId: binding.threadId,
387
+ model: modelSelection.model,
388
+ ...modelSelection.modelProvider ? { modelProvider: modelSelection.modelProvider } : {},
389
+ cwd,
390
+ approvalPolicy,
391
+ approvalsReviewer: modelScopedAppServer.approvalsReviewer,
392
+ ...modelScopedAppServer.networkProxy ? {} : { sandbox },
393
+ ...serviceTier ? { serviceTier } : {},
394
+ config: threadConfig,
395
+ developerInstructions: SIDE_DEVELOPER_INSTRUCTIONS,
396
+ ephemeral: true,
397
+ threadSource: "user"
398
+ }, requestOptions),
399
+ onClientChange: rebindClientHandlers
400
+ }));
401
+ childThreadId = forkResponse.thread.id;
402
+ if (supervisionModelSelection && (forkResponse.model !== supervisionModelSelection.model || forkResponse.modelProvider !== supervisionModelSelection.modelProvider)) throw new Error("Codex supervised side thread did not preserve its native model and provider");
344
403
  await client.request("thread/inject_items", {
345
404
  threadId: childThreadId,
346
405
  items: [sideBoundaryPromptItem()]
@@ -348,7 +407,7 @@ async function runCodexAppServerSideQuestion(params, options) {
348
407
  timeoutMs: appServer.requestTimeoutMs,
349
408
  signal: params.opts?.abortSignal
350
409
  });
351
- const effort = resolveReasoningEffort(params.resolvedThinkLevel ?? "off", modelSelection.model, readCodexSupportedReasoningEfforts(params.runtimeModel?.compat));
410
+ const effort = usesSupervisionConnection ? void 0 : resolveReasoningEffort(params.resolvedThinkLevel ?? "off", modelSelection.model, readCodexSupportedReasoningEfforts(params.runtimeModel?.compat));
352
411
  turnId = assertCodexTurnStartResponse(await client.request("turn/start", {
353
412
  threadId: childThreadId,
354
413
  input: [{
@@ -358,15 +417,17 @@ async function runCodexAppServerSideQuestion(params, options) {
358
417
  }],
359
418
  cwd,
360
419
  model: modelSelection.model,
361
- personality: CODEX_NATIVE_PERSONALITY_NONE,
420
+ ...usesSupervisionConnection ? {} : { personality: CODEX_NATIVE_PERSONALITY_NONE },
362
421
  ...serviceTier ? { serviceTier } : {},
363
- effort,
364
- collaborationMode: {
365
- mode: "default",
366
- settings: {
367
- model: modelSelection.model,
368
- reasoning_effort: effort,
369
- developer_instructions: null
422
+ ...usesSupervisionConnection ? {} : {
423
+ effort,
424
+ collaborationMode: {
425
+ mode: "default",
426
+ settings: {
427
+ model: modelSelection.model,
428
+ reasoning_effort: effort,
429
+ developer_instructions: null
430
+ }
370
431
  }
371
432
  }
372
433
  }, {
@@ -419,7 +480,7 @@ async function runCodexAppServerSideQuestion(params, options) {
419
480
  }
420
481
  } finally {
421
482
  flushPendingNativePreToolUseFailures();
422
- releaseLeasedSharedCodexAppServerClient(client);
483
+ releaseCodexAppServerClientLease(clientLease);
423
484
  nativeHookRelay?.unregister();
424
485
  }
425
486
  }
@@ -472,9 +533,12 @@ function buildSideRunAttemptParams(params, options) {
472
533
  agentId: params.agentId,
473
534
  ...params.messageChannel ? { messageChannel: params.messageChannel } : {},
474
535
  ...params.messageProvider ? { messageProvider: params.messageProvider } : {},
536
+ ...params.chatType ? { chatType: params.chatType } : {},
475
537
  ...params.agentAccountId ? { agentAccountId: params.agentAccountId } : {},
476
538
  ...params.messageTo ? { messageTo: params.messageTo } : {},
477
539
  ...params.messageThreadId !== void 0 ? { messageThreadId: params.messageThreadId } : {},
540
+ ...params.chatId ? { chatId: params.chatId } : {},
541
+ ...params.messageActionTurnCapability ? { messageActionTurnCapability: params.messageActionTurnCapability } : {},
478
542
  ...params.groupId !== void 0 ? { groupId: params.groupId } : {},
479
543
  ...params.groupChannel !== void 0 ? { groupChannel: params.groupChannel } : {},
480
544
  ...params.groupSpace !== void 0 ? { groupSpace: params.groupSpace } : {},
@@ -489,12 +553,13 @@ function buildSideRunAttemptParams(params, options) {
489
553
  ...params.toolsAllow ? { toolsAllow: params.toolsAllow } : {},
490
554
  workspaceDir: options.cwd,
491
555
  authProfileId: options.authProfileId,
492
- authProfileIdSource: params.authProfileIdSource,
556
+ authProfileIdSource: options.authProfileId ? params.preparedRuntimeAuth.plan.forwardedAuthProfileSource : void 0,
493
557
  thinkLevel: params.resolvedThinkLevel ?? "off",
494
558
  resolvedReasoningLevel: params.resolvedReasoningLevel,
495
- authStorage: void 0,
496
- authProfileStore: void 0,
497
- modelRegistry: void 0,
559
+ authStorage: params.preparedRuntimeAuth.authStorage,
560
+ authProfileStore: params.preparedRuntimeAuth.authProfileStore,
561
+ modelRegistry: params.preparedRuntimeAuth.modelRegistry,
562
+ ...params.preparedRuntimeAuth.resolvedApiKey ? { resolvedApiKey: params.preparedRuntimeAuth.resolvedApiKey } : {},
498
563
  runId: options.runId,
499
564
  abortSignal: params.opts?.abortSignal,
500
565
  onAgentEvent: (event) => {
@@ -544,9 +609,12 @@ async function createCodexSideToolBridge(input) {
544
609
  messageProvider: messageToolProvider,
545
610
  toolPolicyMessageProvider: input.params.messageProvider ?? input.params.messageChannel
546
611
  } : {},
612
+ ...input.params.chatType ? { chatType: input.params.chatType } : {},
547
613
  ...input.params.agentAccountId ? { agentAccountId: input.params.agentAccountId } : {},
548
614
  ...input.params.messageTo ? { messageTo: input.params.messageTo } : {},
549
615
  ...input.params.messageThreadId !== void 0 ? { messageThreadId: input.params.messageThreadId } : {},
616
+ ...input.params.chatId ? { nativeChannelId: input.params.chatId } : {},
617
+ ...input.params.messageActionTurnCapability ? { messageActionTurnCapability: input.params.messageActionTurnCapability } : {},
550
618
  ...input.params.groupId !== void 0 ? { groupId: input.params.groupId } : {},
551
619
  ...input.params.groupChannel !== void 0 ? { groupChannel: input.params.groupChannel } : {},
552
620
  ...input.params.groupSpace !== void 0 ? { groupSpace: input.params.groupSpace } : {},
@@ -583,7 +651,7 @@ async function createCodexSideToolBridge(input) {
583
651
  config: input.params.cfg,
584
652
  webSearchAllowed: false
585
653
  }) : requestedWebSearchPlan;
586
- const exposedTools = tools.filter((tool) => tool.name !== "web_search");
654
+ const exposedTools = tools.filter((tool) => tool.name !== "web_search" && tool.name !== "computer");
587
655
  const hookChannelFields = buildAgentHookContextChannelFields({
588
656
  sessionKey: input.params.sessionKey,
589
657
  messageChannel: input.params.messageChannel,