@openclaw/codex 2026.7.1 → 2026.7.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -3
- package/dist/app-server-policy-Scc-Wevo.js +49 -0
- package/dist/{attempt-notifications-BGsEIIDI.js → attempt-notifications-BFmNhqFl.js} +3 -6
- package/dist/auth-binding-C1czuHPA.js +62 -0
- package/dist/cli-metadata.js +20 -0
- package/dist/{app-server-policy-C968Kgin.js → command-formatters-Dq9InZUK.js} +39 -51
- package/dist/{command-handlers-Dv-pzAmg.js → command-handlers-IgqmL_kv.js} +161 -61
- package/dist/{compact-4mVBriKT.js → compact-DCTmg3id.js} +39 -10
- package/dist/computer-use-CPcU8TjG.js +685 -0
- package/dist/conversation-control-CGkBlfc5.js +286 -0
- package/dist/doctor-contract-api.js +120 -81
- package/dist/{provider-capabilities-CDnHbmUZ.js → dynamic-tools-C_1tEs34.js} +6109 -5725
- package/dist/harness.js +59 -15
- package/dist/index.js +1460 -269
- package/dist/{media-understanding-provider-BHOu9-Gg.js → media-understanding-provider-D31dOJwb.js} +32 -15
- package/dist/media-understanding-provider.js +1 -1
- package/dist/{models-DDmO1zwd.js → models-uh26C8QU.js} +5 -9
- package/dist/notification-correlation-KmfV4EkP.js +67 -0
- package/dist/plugin-app-cache-key-Ceb-lm2c.js +315 -0
- package/dist/{provider-zjPfx5Fs.js → rate-limits-DyXaYAxU.js} +10 -266
- package/dist/request-B_oQsCXy.js +157 -0
- package/dist/{run-attempt-FUyOjGCV.js → run-attempt-MLzoMe_m.js} +7395 -6430
- package/dist/runtime-artifact-C2ITXdhM.js +488 -0
- package/dist/{sandbox-guard-DA2TQfZW.js → sandbox-guard-D1Wky__S.js} +10 -1
- package/dist/{config-CYEDnLJ2.js → session-binding-h1mmCGnl.js} +985 -31
- package/dist/session-catalog-CEvoXWHA.js +2412 -0
- package/dist/session-cli-XsEuWb_C.js +175 -0
- package/dist/{shared-client-4ICy3U6d.js → shared-client-JiAnW6pc.js} +2193 -1319
- package/dist/{side-question-N4OaDer2.js → side-question-DqDvIwSU.js} +140 -70
- package/dist/{thread-lifecycle-qWE88Dn2.js → thread-lifecycle-CN_pPtPh.js} +1826 -1188
- package/dist/{protocol-validators-dZQ-UTOa.js → transcript-mirror-D9rTxx2P.js} +485 -2
- package/dist/transport-stdio-DXgGZ7Ib.js +88 -0
- package/dist/usage-D5Rohxoc.js +25 -0
- package/dist/{web-search-provider.runtime-BSlriav6.js → web-search-provider.runtime-CKVBn3fP.js} +3 -3
- package/npm-shrinkwrap.json +56 -30
- package/openclaw.plugin.json +177 -14
- package/package.json +8 -6
- package/dist/command-rpc-eLM_mtC7.js +0 -784
- package/dist/computer-use-Bmaz333N.js +0 -377
- package/dist/notification-correlation-Bo7KB3ks.js +0 -35
- package/dist/plugin-app-cache-key-BrhVdeEf.js +0 -98
- package/dist/prompt-overlay.js +0 -15
- package/dist/protocol-2POPqAY4.js +0 -13
- package/dist/provider-catalog.js +0 -79
- package/dist/provider-discovery.js +0 -34
- package/dist/provider.js +0 -2
- package/dist/request-BcJyl8KL.js +0 -36
- package/dist/session-binding-C1ZXdP-x.js +0 -627
package/README.md
CHANGED
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
# OpenClaw Codex
|
|
2
2
|
|
|
3
|
-
Official OpenClaw
|
|
3
|
+
Official OpenClaw plugin for OpenAI Codex app-server integration. It exposes the Codex-managed GPT model catalog, the Codex runtime surfaces used by OpenClaw agents, and opt-in supervision of native Codex sessions.
|
|
4
4
|
|
|
5
5
|
Install from OpenClaw:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
openclaw
|
|
8
|
+
openclaw plugins install @openclaw/codex
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Use this plugin when you want OpenClaw to run Codex-backed model turns, media understanding, and prompt overlays through the Codex app-server harness.
|
|
11
|
+
Use this plugin when you want OpenClaw to run Codex-backed model turns, media understanding, and prompt overlays through the Codex app-server harness, or to browse non-archived Codex CLI, VS Code, Atlas, and ChatGPT sessions and paginated transcripts across paired computers.
|
|
12
|
+
|
|
13
|
+
Guided onboarding attempts to install and enable supervision after it detects a native Codex installation and the selected inference backend passes its live check; Codex does not need to be the primary backend. Supervision activates when that opportunistic plugin setup succeeds. App Server availability is checked when supervision connects. An explicit Codex plugin disable, plugin-policy block, or `supervision.enabled: false` prevents opportunistic enablement. Manual setups enable `plugins.entries.codex.config.supervision.enabled`. Without explicit App Server connection settings, supervision uses a managed user-home stdio connection; explicit `appServer` settings are honored.
|
|
14
|
+
|
|
15
|
+
The Gateway-backed operator CLI is:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
openclaw codex sessions [--search <text>] [--host <id>] [--limit <count>] [--cursor <cursor>] [--json] [--url <url>] [--token <token>] [--timeout <ms>] [--expect-final]
|
|
19
|
+
openclaw codex continue <thread-id> [--json] [--url <url>] [--token <token>] [--timeout <ms>] [--expect-final]
|
|
20
|
+
openclaw codex archive <thread-id> --confirm-no-other-runner [--json] [--url <url>] [--token <token>] [--timeout <ms>] [--expect-final]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The catalog never includes archived threads and has no archived or include-archived option. Rows appear in the normal Control UI sessions sidebar and open in the normal Chat pane. Transcript history requires a recent Codex App Server with `thread/turns/list` and is fetched 20 full-item turns at a time through opaque cursors; OpenClaw does not fall back to an unbounded `thread/read`, and rejects a serialized transcript page above 20 MiB before transport. `--limit` defaults to 50 sessions per host, `--cursor` requires `--host`, and the sessions Gateway timeout defaults to 75,000 ms so cold paired-node catalogs can complete. Continue and archive retain the shared 30,000 ms default. All operator surfaces require `operator.write`. Paired-node rows can be listed and read; continue and archive operate only on the Gateway-local host, and archive requires the no-other-runner confirmation. Catalog registration does not require `supervision.enabled`; that setting gates agent-facing supervision tools.
|
|
24
|
+
|
|
25
|
+
A supervised OpenClaw Chat cannot be deleted while its model-selection lock protects the native binding. Before native archive, OpenClaw checks the exact target and every non-archived spawned descendant reported by Codex; any active OpenClaw binding blocks the operation. Descendant pagination errors, cycles, and safety-limit exhaustion also fail closed. Codex still does not expose a conditional archive operation or cross-process runner lease, so the confirmation covers unknown native clients and the race between the status read and archive request.
|
|
26
|
+
|
|
27
|
+
Disabling or uninstalling the plugin leaves supervised Chats locked and unavailable rather than rerouting them. Reinstall or re-enable the same plugin and restart the Gateway to resume those Chats.
|
|
28
|
+
|
|
29
|
+
These shell commands differ from the in-chat `/codex` runtime commands. In particular, `/codex sessions --host <node>` lists Codex CLI session files on one node, `/codex threads` uses the current conversation's App Server connection, and `/codex resume` or `/codex bind` changes that conversation's binding. There is no `/codex archive` runtime command.
|
|
30
|
+
|
|
31
|
+
For a supervised branch, Codex App Server selects the snapshot fork's model and provider from its current native configuration. OpenClaw starts the canonical harness thread with exactly that returned pair. Codex persists the canonical thread's native selection, and later resumes preserve it because OpenClaw omits model and provider overrides. OpenClaw cannot substitute its outer runtime, model, or fallback. The returned initial pair can differ from the source's last recorded model.
|
|
32
|
+
|
|
33
|
+
The visible-history mirror keeps at most 200 user or assistant messages, 512 KiB total, and 64 KiB per message. Image inputs become `[Image attachment]`; image data and local paths are not copied.
|
|
34
|
+
|
|
35
|
+
See the [Codex harness](https://docs.openclaw.ai/plugins/codex-harness) and [Codex supervision](https://docs.openclaw.ai/plugins/codex-supervision) guides.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { p as canUseCodexModelBackedApprovalsReviewerForModel } from "./session-binding-h1mmCGnl.js";
|
|
2
|
+
//#region extensions/codex/src/app-server/app-server-policy.ts
|
|
3
|
+
/**
|
|
4
|
+
* Policy promotion for Codex app-server runs that can safely use OpenClaw tool
|
|
5
|
+
* approvals.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Promotes implicit `never` approval policy to `untrusted` only when runtime
|
|
9
|
+
* requirements allow OpenClaw to handle tool approvals.
|
|
10
|
+
*/
|
|
11
|
+
function resolveCodexAppServerForOpenClawToolPolicy(params) {
|
|
12
|
+
if (!params.shouldPromote || !params.canUseUntrustedApprovalPolicy || params.appServer.approvalPolicy !== "never") return params.appServer;
|
|
13
|
+
const explicitMode = params.execPolicy?.mode === "full" || params.pluginConfig.appServer?.mode !== void 0 || isCodexAppServerPolicyMode(params.env.OPENCLAW_CODEX_APP_SERVER_MODE);
|
|
14
|
+
const explicitApprovalPolicy = params.pluginConfig.appServer?.approvalPolicy !== void 0 || isConfiguredCodexAppServerApprovalPolicy(params.env.OPENCLAW_CODEX_APP_SERVER_APPROVAL_POLICY) || params.appServer.approvalPolicySource === "requirements";
|
|
15
|
+
if (explicitMode || explicitApprovalPolicy) return params.appServer;
|
|
16
|
+
return {
|
|
17
|
+
...params.appServer,
|
|
18
|
+
approvalPolicy: "untrusted"
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function resolveCodexAppServerForModelProvider(params) {
|
|
22
|
+
const explicitProvider = normalizeModelBackedReviewerProvider(params.provider);
|
|
23
|
+
if (!isCodexModelBackedApprovalsReviewer(params.appServer.approvalsReviewer) || canUseCodexModelBackedApprovalsReviewerForModel({
|
|
24
|
+
modelProvider: explicitProvider,
|
|
25
|
+
model: params.model,
|
|
26
|
+
config: params.config,
|
|
27
|
+
env: params.env,
|
|
28
|
+
agentDir: params.agentDir,
|
|
29
|
+
codexConfigToml: params.codexConfigToml
|
|
30
|
+
})) return params.appServer;
|
|
31
|
+
return {
|
|
32
|
+
...params.appServer,
|
|
33
|
+
approvalsReviewer: "user"
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function isCodexAppServerPolicyMode(value) {
|
|
37
|
+
return value === "guardian" || value === "yolo";
|
|
38
|
+
}
|
|
39
|
+
function isConfiguredCodexAppServerApprovalPolicy(value) {
|
|
40
|
+
return value === "never" || value === "on-request" || value === "on-failure" || value === "untrusted";
|
|
41
|
+
}
|
|
42
|
+
function isCodexModelBackedApprovalsReviewer(value) {
|
|
43
|
+
return value === "auto_review" || value === "guardian_subagent";
|
|
44
|
+
}
|
|
45
|
+
function normalizeModelBackedReviewerProvider(provider) {
|
|
46
|
+
return provider?.trim().toLowerCase() || void 0;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { resolveCodexAppServerForOpenClawToolPolicy as n, resolveCodexAppServerForModelProvider as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Z as isJsonObject } from "./shared-client-JiAnW6pc.js";
|
|
2
2
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/attempt-notifications.ts
|
|
4
4
|
/**
|
|
@@ -6,8 +6,6 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
const CODEX_TURN_ABORT_MARKER_START = "<turn_aborted>";
|
|
8
8
|
const CODEX_TURN_ABORT_MARKER_END = "</turn_aborted>";
|
|
9
|
-
const CODEX_INTERRUPTED_USER_GUIDANCE = "The user interrupted the previous turn on purpose. Any running unified exec processes may still be running in the background. If any tools/commands were aborted, they may have partially executed.";
|
|
10
|
-
const CODEX_INTERRUPTED_DEVELOPER_GUIDANCE = "The previous turn was interrupted on purpose. Any running unified exec processes may still be running in the background. If any tools/commands were aborted, they may have partially executed.";
|
|
11
9
|
/** Builds compact activity metadata for watchdog and diagnostic updates. */
|
|
12
10
|
function describeNotificationActivity(notification) {
|
|
13
11
|
if (!isJsonObject(notification.params)) return { lastNotificationMethod: notification.method };
|
|
@@ -182,12 +180,11 @@ function isCodexTurnAbortMarkerNotification(notification, options = {}) {
|
|
|
182
180
|
if (notification.method !== "rawResponseItem/completed" || !isJsonObject(notification.params)) return false;
|
|
183
181
|
const item = notification.params.item;
|
|
184
182
|
const role = isJsonObject(item) ? readString(item, "role") : void 0;
|
|
185
|
-
if (!isJsonObject(item) || role !== "user" && role !== "developer") return false;
|
|
183
|
+
if (!isJsonObject(item) || readString(item, "type") !== "message" || role !== "user" && role !== "developer") return false;
|
|
186
184
|
const text = extractRawResponseItemText(item).trim();
|
|
187
185
|
const currentPromptTexts = [options.currentPromptText, ...options.currentPromptTexts ?? []].filter(isNonEmptyString).map((prompt) => prompt.trim());
|
|
188
186
|
if (role === "user" && currentPromptTexts.includes(text)) return false;
|
|
189
|
-
|
|
190
|
-
return markerBody === CODEX_INTERRUPTED_USER_GUIDANCE || markerBody === CODEX_INTERRUPTED_DEVELOPER_GUIDANCE;
|
|
187
|
+
return readCodexTurnAbortMarkerBody(text) !== void 0;
|
|
191
188
|
}
|
|
192
189
|
function readCodexTurnAbortMarkerBody(text) {
|
|
193
190
|
if (!text.startsWith(CODEX_TURN_ABORT_MARKER_START) || !text.endsWith(CODEX_TURN_ABORT_MARKER_END)) return;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { resolveApiKeyForProfile } from "openclaw/plugin-sdk/agent-runtime";
|
|
3
|
+
import { fingerprintResolvedAuthProfileCredential } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
4
|
+
//#region extensions/codex/src/app-server/auth-binding.ts
|
|
5
|
+
var auth_binding_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
fingerprintCodexAppServerAuthBinding: () => fingerprintCodexAppServerAuthBinding,
|
|
7
|
+
prepareCodexAppServerAuthBinding: () => prepareCodexAppServerAuthBinding
|
|
8
|
+
});
|
|
9
|
+
function withMaterializedCredential(params) {
|
|
10
|
+
const store = structuredClone(params.store);
|
|
11
|
+
if (params.credential.type === "api_key") {
|
|
12
|
+
const { keyRef: _keyRef, ...credential } = params.credential;
|
|
13
|
+
store.profiles[params.profileId] = {
|
|
14
|
+
...credential,
|
|
15
|
+
key: params.value
|
|
16
|
+
};
|
|
17
|
+
} else if (params.credential.type === "token") {
|
|
18
|
+
const { tokenRef: _tokenRef, ...credential } = params.credential;
|
|
19
|
+
store.profiles[params.profileId] = {
|
|
20
|
+
...credential,
|
|
21
|
+
token: params.value
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return store;
|
|
25
|
+
}
|
|
26
|
+
/** Resolves one forwarded profile once so attestation and execution share exact material. */
|
|
27
|
+
async function prepareCodexAppServerAuthBinding(params) {
|
|
28
|
+
const credential = params.authProfileStore.profiles[params.authProfileId];
|
|
29
|
+
if (!credential || credential.type === "oauth") return;
|
|
30
|
+
const resolved = await resolveApiKeyForProfile({
|
|
31
|
+
cfg: params.config,
|
|
32
|
+
store: params.authProfileStore,
|
|
33
|
+
profileId: params.authProfileId,
|
|
34
|
+
agentDir: params.agentDir
|
|
35
|
+
});
|
|
36
|
+
if (!resolved?.apiKey) throw new Error(`Codex could not resolve auth profile "${params.authProfileId}".`);
|
|
37
|
+
const fingerprint = fingerprintResolvedAuthProfileCredential({
|
|
38
|
+
profileId: params.authProfileId,
|
|
39
|
+
credential,
|
|
40
|
+
resolvedAuth: {
|
|
41
|
+
apiKey: resolved.apiKey,
|
|
42
|
+
profileId: params.authProfileId,
|
|
43
|
+
source: `profile:${params.authProfileId}`,
|
|
44
|
+
mode: credential.type === "api_key" ? "api-key" : "token"
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
if (!fingerprint) throw new Error(`Codex could not attest auth profile "${params.authProfileId}".`);
|
|
48
|
+
return {
|
|
49
|
+
fingerprint,
|
|
50
|
+
authProfileStore: withMaterializedCredential({
|
|
51
|
+
store: params.authProfileStore,
|
|
52
|
+
profileId: params.authProfileId,
|
|
53
|
+
credential,
|
|
54
|
+
value: resolved.apiKey
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async function fingerprintCodexAppServerAuthBinding(params) {
|
|
59
|
+
return (await prepareCodexAppServerAuthBinding(params))?.fingerprint;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { prepareCodexAppServerAuthBinding as n, auth_binding_exports as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
2
|
+
//#region extensions/codex/cli-metadata.ts
|
|
3
|
+
function registerCodexCliMetadata(api) {
|
|
4
|
+
api.registerCli(async ({ program }) => {
|
|
5
|
+
const { registerCodexSessionCli } = await import("./session-cli-XsEuWb_C.js");
|
|
6
|
+
registerCodexSessionCli(program);
|
|
7
|
+
}, { descriptors: [{
|
|
8
|
+
name: "codex",
|
|
9
|
+
description: "Inspect and branch from Codex sessions through the Gateway",
|
|
10
|
+
hasSubcommands: true
|
|
11
|
+
}] });
|
|
12
|
+
}
|
|
13
|
+
var cli_metadata_default = definePluginEntry({
|
|
14
|
+
id: "codex",
|
|
15
|
+
name: "Codex",
|
|
16
|
+
description: "Codex app-server harness and native session supervision.",
|
|
17
|
+
register: registerCodexCliMetadata
|
|
18
|
+
});
|
|
19
|
+
//#endregion
|
|
20
|
+
export { cli_metadata_default as default, registerCodexCliMetadata };
|
|
@@ -1,6 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { R as CodexAppServerRpcError, Z as isJsonObject } from "./shared-client-JiAnW6pc.js";
|
|
2
|
+
import { c as summarizeCodexRateLimits, o as summarizeCodexAccountRateLimits, r as hasCodexRateLimitSnapshots } from "./rate-limits-DyXaYAxU.js";
|
|
3
|
+
//#region extensions/codex/src/app-server/capabilities.ts
|
|
4
|
+
/**
|
|
5
|
+
* Capability helpers for optional Codex app-server control-plane methods.
|
|
6
|
+
*/
|
|
7
|
+
/** Known app-server methods used by OpenClaw control surfaces. */
|
|
8
|
+
const CODEX_CONTROL_METHODS = {
|
|
9
|
+
account: "account/read",
|
|
10
|
+
compact: "thread/compact/start",
|
|
11
|
+
feedback: "feedback/upload",
|
|
12
|
+
forkThread: "thread/fork",
|
|
13
|
+
listMcpServers: "mcpServerStatus/list",
|
|
14
|
+
listSkills: "skills/list",
|
|
15
|
+
listThreads: "thread/list",
|
|
16
|
+
listThreadTurns: "thread/turns/list",
|
|
17
|
+
readThread: "thread/read",
|
|
18
|
+
rateLimits: "account/rateLimits/read",
|
|
19
|
+
archiveThread: "thread/archive",
|
|
20
|
+
renameThread: "thread/name/set",
|
|
21
|
+
resumeThread: "thread/resume",
|
|
22
|
+
review: "review/start",
|
|
23
|
+
unarchiveThread: "thread/unarchive"
|
|
24
|
+
};
|
|
25
|
+
/** Formats unsupported control calls differently from ordinary RPC failures. */
|
|
26
|
+
function describeControlFailure(error) {
|
|
27
|
+
if (isUnsupportedControlError(error)) return "unsupported by this Codex app-server";
|
|
28
|
+
return error instanceof Error ? error.message : String(error);
|
|
29
|
+
}
|
|
30
|
+
function isUnsupportedControlError(error) {
|
|
31
|
+
return error instanceof CodexAppServerRpcError && error.code === -32601;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
4
34
|
//#region extensions/codex/src/command-formatters.ts
|
|
5
35
|
/** Formats the combined `/codex status` probe result. */
|
|
6
36
|
function formatCodexStatus(probes) {
|
|
@@ -65,9 +95,14 @@ function formatAuthRowStatus(row) {
|
|
|
65
95
|
function formatComputerUseStatus(status) {
|
|
66
96
|
const lines = [`Computer Use: ${status.ready ? "ready" : status.enabled ? "not ready" : "disabled"}`];
|
|
67
97
|
lines.push(`Plugin: ${formatCodexDisplayText(status.pluginName)} (${computerUsePluginState(status)})`);
|
|
98
|
+
lines.push(`Installation: ${formatCodexDisplayText(status.installation.status)} (${status.installation.ok ? "ok" : "not ok"})`);
|
|
68
99
|
lines.push(`MCP server: ${formatCodexDisplayText(status.mcpServerName)}${status.mcpServerAvailable ? ` (${status.tools.length} tools)` : " (unavailable)"}`);
|
|
100
|
+
lines.push(`Exposure: ${formatCodexDisplayText(status.exposure.status)} (${status.exposure.ok ? "ok" : "not ok"})`);
|
|
101
|
+
lines.push(`Live test: ${formatCodexDisplayText(status.liveTest.status)} (${status.liveTest.attempted ? `${status.liveTest.attempts} attempt${status.liveTest.attempts === 1 ? "" : "s"}, ${status.liveTest.timeoutMs}ms` : "not run"})`);
|
|
102
|
+
if (status.liveTest.retried || status.liveTest.repaired) lines.push(`Live test recovery: retried=${status.liveTest.retried ? "yes" : "no"}, repaired=${status.liveTest.repaired ? "yes" : "no"}`);
|
|
69
103
|
if (status.marketplaceName) lines.push(`Marketplace: ${formatCodexDisplayText(status.marketplaceName)}`);
|
|
70
104
|
if (status.tools.length > 0) lines.push(`Tools: ${status.tools.slice(0, 8).map(formatCodexDisplayText).join(", ")}`);
|
|
105
|
+
for (const warning of status.warnings) lines.push(`Warning: ${formatCodexDisplayText(warning)}`);
|
|
71
106
|
lines.push(formatCodexDisplayText(status.message));
|
|
72
107
|
return lines.join("\n");
|
|
73
108
|
}
|
|
@@ -273,51 +308,4 @@ function readString(record, key) {
|
|
|
273
308
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
274
309
|
}
|
|
275
310
|
//#endregion
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Policy promotion for Codex app-server runs that can safely use OpenClaw tool
|
|
279
|
-
* approvals.
|
|
280
|
-
*/
|
|
281
|
-
/**
|
|
282
|
-
* Promotes implicit `never` approval policy to `untrusted` only when runtime
|
|
283
|
-
* requirements allow OpenClaw to handle tool approvals.
|
|
284
|
-
*/
|
|
285
|
-
function resolveCodexAppServerForOpenClawToolPolicy(params) {
|
|
286
|
-
if (!params.shouldPromote || !params.canUseUntrustedApprovalPolicy || params.appServer.approvalPolicy !== "never") return params.appServer;
|
|
287
|
-
const explicitMode = params.execPolicy?.mode === "full" || params.pluginConfig.appServer?.mode !== void 0 || isCodexAppServerPolicyMode(params.env.OPENCLAW_CODEX_APP_SERVER_MODE);
|
|
288
|
-
const explicitApprovalPolicy = params.pluginConfig.appServer?.approvalPolicy !== void 0 || isConfiguredCodexAppServerApprovalPolicy(params.env.OPENCLAW_CODEX_APP_SERVER_APPROVAL_POLICY) || params.appServer.approvalPolicySource === "requirements";
|
|
289
|
-
if (explicitMode || explicitApprovalPolicy) return params.appServer;
|
|
290
|
-
return {
|
|
291
|
-
...params.appServer,
|
|
292
|
-
approvalPolicy: "untrusted"
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
function resolveCodexAppServerForModelProvider(params) {
|
|
296
|
-
const explicitProvider = normalizeModelBackedReviewerProvider(params.provider);
|
|
297
|
-
if (!isCodexModelBackedApprovalsReviewer(params.appServer.approvalsReviewer) || canUseCodexModelBackedApprovalsReviewerForModel({
|
|
298
|
-
modelProvider: explicitProvider,
|
|
299
|
-
model: params.model,
|
|
300
|
-
config: params.config,
|
|
301
|
-
env: params.env,
|
|
302
|
-
agentDir: params.agentDir,
|
|
303
|
-
codexConfigToml: params.codexConfigToml
|
|
304
|
-
})) return params.appServer;
|
|
305
|
-
return {
|
|
306
|
-
...params.appServer,
|
|
307
|
-
approvalsReviewer: "user"
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
function isCodexAppServerPolicyMode(value) {
|
|
311
|
-
return value === "guardian" || value === "yolo";
|
|
312
|
-
}
|
|
313
|
-
function isConfiguredCodexAppServerApprovalPolicy(value) {
|
|
314
|
-
return value === "never" || value === "on-request" || value === "on-failure" || value === "untrusted";
|
|
315
|
-
}
|
|
316
|
-
function isCodexModelBackedApprovalsReviewer(value) {
|
|
317
|
-
return value === "auto_review" || value === "guardian_subagent";
|
|
318
|
-
}
|
|
319
|
-
function normalizeModelBackedReviewerProvider(provider) {
|
|
320
|
-
return provider?.trim().toLowerCase() || void 0;
|
|
321
|
-
}
|
|
322
|
-
//#endregion
|
|
323
|
-
export { formatCodexDisplayText as a, formatList as c, formatThreads as d, readString as f, formatAccount as i, formatModels as l, resolveCodexAppServerForOpenClawToolPolicy as n, formatCodexStatus as o, buildHelp as r, formatComputerUseStatus as s, resolveCodexAppServerForModelProvider as t, formatSkills as u };
|
|
311
|
+
export { formatComputerUseStatus as a, formatSkills as c, CODEX_CONTROL_METHODS as d, describeControlFailure as f, formatCodexStatus as i, formatThreads as l, formatAccount as n, formatList as o, formatCodexDisplayText as r, formatModels as s, buildHelp as t, readString as u };
|