@openclaw/codex 2026.7.2-beta.1 → 2026.7.2-beta.3
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 +1 -1
- package/dist/{app-server-policy-DVcxdse_.js → app-server-policy-DUMF2Xyr.js} +1 -1
- package/dist/{attempt-notifications-DEv9h7iC.js → attempt-notifications-Ecjyzufe.js} +3 -6
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-D6ZlGNmb.js → command-formatters-NCTL7A2q.js} +38 -3
- package/dist/{command-handlers-Cpl9fUWv.js → command-handlers-DtFbZiba.js} +70 -15
- package/dist/{compact-FnJmiPNA.js → compact-Kgy26gIM.js} +4 -5
- package/dist/{computer-use-DVzr8OP1.js → computer-use-C7x4ZaqR.js} +4 -4
- package/dist/{conversation-control-DtQ-E7mr.js → conversation-control-B0s3aIjT.js} +5 -7
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{dynamic-tools-BMLoaTeG.js → dynamic-tools-D_vSVmv9.js} +851 -434
- package/dist/harness.js +11 -6
- package/dist/index.js +52 -31
- package/dist/{media-understanding-provider-D580L0P8.js → media-understanding-provider-IPNNQre6.js} +11 -12
- package/dist/media-understanding-provider.js +1 -1
- package/dist/{models-DuKzZA6G.js → models-DD5zBdX5.js} +5 -9
- package/dist/{notification-correlation-DfaCm0mx.js → notification-correlation-C8DVQ_Bq.js} +3 -3
- package/dist/{plugin-app-cache-key-BKNjHMEs.js → plugin-app-cache-key-DJbhLYSK.js} +2 -2
- package/dist/{rate-limits-Dhp04Rqo.js → rate-limits-CqhWQ2R9.js} +9 -6
- package/dist/{request-DborTWgw.js → request-9yf9pZjf.js} +54 -8
- package/dist/{run-attempt-VPVJoYDP.js → run-attempt-BIoO8ISr.js} +637 -351
- package/dist/{config-c48K5HP9.js → session-binding-Bmt20HfB.js} +788 -3
- package/dist/{session-catalog-7H112Tr_.js → session-catalog-CA7R-hX2.js} +82 -45
- package/dist/{session-cli-B28RhCyp.js → session-cli-Bxk3-Wqz.js} +2 -2
- package/dist/{shared-client-D4mFI9al.js → shared-client-CSXLtCLE.js} +304 -81
- package/dist/{side-question-CgJBz52s.js → side-question-DtzquMOb.js} +15 -13
- package/dist/{thread-lifecycle-BgLXzjvV.js → thread-lifecycle-CQ_9mAa1.js} +1821 -1582
- package/dist/{protocol-validators-dZQ-UTOa.js → transcript-mirror-D9rTxx2P.js} +485 -2
- package/dist/usage-CuPpFgTc.js +25 -0
- package/dist/{web-search-provider.runtime-Bs-eTn5U.js → web-search-provider.runtime-_x5XTeqh.js} +3 -3
- package/npm-shrinkwrap.json +30 -30
- package/openclaw.plugin.json +21 -6
- package/package.json +6 -6
- package/dist/capabilities-42Dfn2TV.js +0 -33
- package/dist/prompt-overlay.js +0 -15
- package/dist/protocol-BMifTfdW.js +0 -15
- package/dist/provider-catalog.js +0 -118
- package/dist/provider-discovery.js +0 -34
- package/dist/provider.js +0 -307
- package/dist/session-binding-BMfX1OX-.js +0 -786
- package/dist/transcript-mirror-DhLwFIL4.js +0 -485
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Install from OpenClaw:
|
|
|
8
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, or to browse non-archived Codex
|
|
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
12
|
|
|
13
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
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as canUseCodexModelBackedApprovalsReviewerForModel } from "./session-binding-Bmt20HfB.js";
|
|
2
2
|
//#region extensions/codex/src/app-server/app-server-policy.ts
|
|
3
3
|
/**
|
|
4
4
|
* Policy promotion for Codex app-server runs that can safely use OpenClaw tool
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Z as isJsonObject } from "./shared-client-CSXLtCLE.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;
|
package/dist/cli-metadata.js
CHANGED
|
@@ -2,7 +2,7 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
|
2
2
|
//#region extensions/codex/cli-metadata.ts
|
|
3
3
|
function registerCodexCliMetadata(api) {
|
|
4
4
|
api.registerCli(async ({ program }) => {
|
|
5
|
-
const { registerCodexSessionCli } = await import("./session-cli-
|
|
5
|
+
const { registerCodexSessionCli } = await import("./session-cli-Bxk3-Wqz.js");
|
|
6
6
|
registerCodexSessionCli(program);
|
|
7
7
|
}, { descriptors: [{
|
|
8
8
|
name: "codex",
|
|
@@ -1,5 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as summarizeCodexRateLimits, o as summarizeCodexAccountRateLimits, r as hasCodexRateLimitSnapshots } from "./rate-limits-
|
|
1
|
+
import { R as CodexAppServerRpcError, Z as isJsonObject } from "./shared-client-CSXLtCLE.js";
|
|
2
|
+
import { c as summarizeCodexRateLimits, o as summarizeCodexAccountRateLimits, r as hasCodexRateLimitSnapshots } from "./rate-limits-CqhWQ2R9.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
|
+
getThreadGoal: "thread/goal/get",
|
|
25
|
+
setThreadGoal: "thread/goal/set",
|
|
26
|
+
clearThreadGoal: "thread/goal/clear"
|
|
27
|
+
};
|
|
28
|
+
/** Formats unsupported control calls differently from ordinary RPC failures. */
|
|
29
|
+
function describeControlFailure(error) {
|
|
30
|
+
if (isUnsupportedControlError(error)) return "unsupported by this Codex app-server";
|
|
31
|
+
return error instanceof Error ? error.message : String(error);
|
|
32
|
+
}
|
|
33
|
+
function isUnsupportedControlError(error) {
|
|
34
|
+
return error instanceof CodexAppServerRpcError && error.code === -32601;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
3
37
|
//#region extensions/codex/src/command-formatters.ts
|
|
4
38
|
/** Formats the combined `/codex status` probe result. */
|
|
5
39
|
function formatCodexStatus(probes) {
|
|
@@ -175,6 +209,7 @@ function buildHelp() {
|
|
|
175
209
|
"- /codex status",
|
|
176
210
|
"- /codex models",
|
|
177
211
|
"- /codex threads [filter]",
|
|
212
|
+
"- /codex goal [status|set <objective>|pause|resume|block|complete|clear]",
|
|
178
213
|
"- /codex sessions --host <node> [filter]",
|
|
179
214
|
"- /codex resume <thread-id>",
|
|
180
215
|
"- /codex resume <session-id> --host <node> --bind here",
|
|
@@ -277,4 +312,4 @@ function readString(record, key) {
|
|
|
277
312
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
278
313
|
}
|
|
279
314
|
//#endregion
|
|
280
|
-
export { formatComputerUseStatus as a, formatSkills as c, formatCodexStatus as i, formatThreads as l, formatAccount as n, formatList as o, formatCodexDisplayText as r, formatModels as s, buildHelp as t, readString as u };
|
|
315
|
+
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 };
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as listAllCodexAppServerModels } from "./models-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { s as summarizeCodexAccountUsage } from "./rate-limits-Dhp04Rqo.js";
|
|
8
|
-
import { t as CODEX_CONTROL_METHODS } from "./capabilities-42Dfn2TV.js";
|
|
9
|
-
import { a as formatComputerUseStatus, c as formatSkills, i as formatCodexStatus, l as formatThreads, n as formatAccount, o as formatList, r as formatCodexDisplayText, s as formatModels, t as buildHelp, u as readString$1 } from "./command-formatters-D6ZlGNmb.js";
|
|
1
|
+
import { S as resolveCodexAppServerAuthProfileIdForAgent, Z as isJsonObject } from "./shared-client-CSXLtCLE.js";
|
|
2
|
+
import { _ as isCodexFastServiceTier, c as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as normalizeCodexAppServerBindingModelProvider, r as bindingStoreKey, s as reclaimCurrentCodexSessionGeneration } from "./session-binding-Bmt20HfB.js";
|
|
3
|
+
import { u as assertCodexThreadResumeResponse } from "./transcript-mirror-D9rTxx2P.js";
|
|
4
|
+
import { t as listAllCodexAppServerModels } from "./models-DD5zBdX5.js";
|
|
5
|
+
import { a as formatComputerUseStatus, c as formatSkills, d as CODEX_CONTROL_METHODS, i as formatCodexStatus, l as formatThreads, n as formatAccount, o as formatList, r as formatCodexDisplayText, s as formatModels, t as buildHelp, u as readString$1 } from "./command-formatters-NCTL7A2q.js";
|
|
6
|
+
import { s as summarizeCodexAccountUsage } from "./rate-limits-CqhWQ2R9.js";
|
|
10
7
|
import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-D1Wky__S.js";
|
|
11
|
-
import { a as setCodexConversationFastMode, c as steerCodexConversationTurn, d as CODEX_NATIVE_EXECUTION_AUTH_ERROR, f as canMutateCodexHost, i as readCodexConversationActiveTurn, l as stopCodexConversationTurn, n as parseCodexFastModeArg, o as setCodexConversationModel, r as parseCodexPermissionsModeArg, s as setCodexConversationPermissions, t as formatPermissionsMode } from "./conversation-control-
|
|
8
|
+
import { a as setCodexConversationFastMode, c as steerCodexConversationTurn, d as CODEX_NATIVE_EXECUTION_AUTH_ERROR, f as canMutateCodexHost, i as readCodexConversationActiveTurn, l as stopCodexConversationTurn, n as parseCodexFastModeArg, o as setCodexConversationModel, r as parseCodexPermissionsModeArg, s as setCodexConversationPermissions, t as formatPermissionsMode } from "./conversation-control-B0s3aIjT.js";
|
|
12
9
|
import { i as readCodexConversationBindingData, n as createCodexCliNodeConversationBindingData, o as resolveCodexDefaultWorkspaceDir, r as createCodexConversationBindingData } from "./conversation-binding-data-BHRpYbX3.js";
|
|
13
|
-
import { a as resolveCodexBindingAppServerConnection } from "./notification-correlation-
|
|
14
|
-
import { c as requestOptions, l as safeCodexControlRequest, o as codexControlRequest, p as formatCodexCliSessions, s as readCodexStatusProbes } from "./session-catalog-
|
|
15
|
-
import { i as readCodexComputerUseStatus, n as installCodexComputerUse } from "./computer-use-
|
|
10
|
+
import { a as resolveCodexBindingAppServerConnection } from "./notification-correlation-C8DVQ_Bq.js";
|
|
11
|
+
import { c as requestOptions, l as safeCodexControlRequest, o as codexControlRequest, p as formatCodexCliSessions, s as readCodexStatusProbes } from "./session-catalog-CA7R-hX2.js";
|
|
12
|
+
import { i as readCodexComputerUseStatus, n as installCodexComputerUse } from "./computer-use-C7x4ZaqR.js";
|
|
16
13
|
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
17
14
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
18
15
|
import crypto from "node:crypto";
|
|
@@ -542,7 +539,8 @@ const CODEX_NATIVE_EXECUTION_SUBCOMMANDS = /* @__PURE__ */ new Set([
|
|
|
542
539
|
"fast",
|
|
543
540
|
"permissions",
|
|
544
541
|
"compact",
|
|
545
|
-
"review"
|
|
542
|
+
"review",
|
|
543
|
+
"goal"
|
|
546
544
|
]);
|
|
547
545
|
const CODEX_NATIVE_CONTROL_SUBCOMMANDS = /* @__PURE__ */ new Set([
|
|
548
546
|
...CODEX_NATIVE_EXECUTION_SUBCOMMANDS,
|
|
@@ -684,7 +682,7 @@ async function handleCodexSubcommand(ctx, options) {
|
|
|
684
682
|
const [subcommand = "status", ...rest] = args;
|
|
685
683
|
const normalized = subcommand.toLowerCase();
|
|
686
684
|
if (normalized === "help") return { text: buildHelp() };
|
|
687
|
-
if (CODEX_NATIVE_CONTROL_SUBCOMMANDS.has(normalized) && !returnsBeforeNativeCodexExecution(normalized, rest) && !canMutateCodexHost(ctx)) return { text: CODEX_NATIVE_EXECUTION_AUTH_ERROR };
|
|
685
|
+
if (CODEX_NATIVE_CONTROL_SUBCOMMANDS.has(normalized) && !returnsBeforeNativeCodexExecution(normalized, rest) && !isReadOnlyCodexGoalCommand(normalized, rest) && !canMutateCodexHost(ctx)) return { text: CODEX_NATIVE_EXECUTION_AUTH_ERROR };
|
|
688
686
|
const sandboxBlock = resolveCodexNativeCommandSandboxBlock(ctx, normalized, rest);
|
|
689
687
|
if (sandboxBlock) return { text: sandboxBlock };
|
|
690
688
|
if (normalized === "plugins") {
|
|
@@ -702,6 +700,7 @@ async function handleCodexSubcommand(ctx, options) {
|
|
|
702
700
|
return { text: formatModels(await deps.listCodexAppServerModels(deps.requestOptions(options.pluginConfig, 100, ctx.config, agentDir))) };
|
|
703
701
|
}
|
|
704
702
|
if (normalized === "threads") return { text: await buildThreads(deps, ctx, options.pluginConfig, rest.join(" ")) };
|
|
703
|
+
if (normalized === "goal") return { text: await handleNativeGoal(deps, ctx, options.pluginConfig, rest) };
|
|
705
704
|
if (normalized === "sessions") return { text: await buildCodexCliSessions(deps, rest) };
|
|
706
705
|
if (normalized === "resume") return { text: await resumeThread(deps, ctx, options.pluginConfig, rest) };
|
|
707
706
|
if (normalized === "bind") return await bindConversation(deps, ctx, options.pluginConfig, rest);
|
|
@@ -780,6 +779,7 @@ function isCurrentSessionModelSelectionLocked(ctx) {
|
|
|
780
779
|
}));
|
|
781
780
|
}
|
|
782
781
|
function resolveCodexNativeCommandSandboxBlock(ctx, subcommand, args) {
|
|
782
|
+
if (isReadOnlyCodexGoalCommand(subcommand, args)) return;
|
|
783
783
|
if (!CODEX_NATIVE_EXECUTION_SUBCOMMANDS.has(subcommand)) return;
|
|
784
784
|
if (returnsBeforeNativeCodexExecution(subcommand, args)) return;
|
|
785
785
|
if (isCodexCliNodeResumeBind(subcommand, args)) return resolveCodexNativeSandboxBlock({
|
|
@@ -796,6 +796,11 @@ function resolveCodexNativeCommandSandboxBlock(ctx, subcommand, args) {
|
|
|
796
796
|
surface: `/${["codex", subcommand].join(" ")}`
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
|
+
function isReadOnlyCodexGoalCommand(subcommand, args) {
|
|
800
|
+
if (subcommand !== "goal" || args.length > 1) return false;
|
|
801
|
+
const action = (args[0] ?? "status").toLowerCase();
|
|
802
|
+
return action === "status" || action === "get";
|
|
803
|
+
}
|
|
799
804
|
function returnsBeforeNativeCodexExecution(subcommand, args) {
|
|
800
805
|
switch (subcommand) {
|
|
801
806
|
case "bind": return parseBindArgs([...args]).help === true;
|
|
@@ -933,6 +938,56 @@ async function buildThreads(deps, ctx, pluginConfig, filter) {
|
|
|
933
938
|
...scope
|
|
934
939
|
}));
|
|
935
940
|
}
|
|
941
|
+
async function handleNativeGoal(deps, ctx, pluginConfig, args) {
|
|
942
|
+
const action = (args[0] ?? "status").toLowerCase();
|
|
943
|
+
const objective = args.slice(1).join(" ").trim();
|
|
944
|
+
const target = await resolveControlTarget(ctx);
|
|
945
|
+
if (!target) return "Cannot manage the Codex goal because this command has no stable binding identity.";
|
|
946
|
+
const binding = await deps.bindingStore.read(target.identity);
|
|
947
|
+
if (!binding?.threadId) return "No Codex thread is attached to this OpenClaw session yet.";
|
|
948
|
+
const connection = resolveCodexBindingAppServerConnection({
|
|
949
|
+
binding,
|
|
950
|
+
authProfileId: binding.authProfileId,
|
|
951
|
+
pluginConfig
|
|
952
|
+
});
|
|
953
|
+
const goalRequestOptions = {
|
|
954
|
+
agentDir: target.agentDir,
|
|
955
|
+
authProfileId: connection.clientAuthProfileId,
|
|
956
|
+
config: ctx.config,
|
|
957
|
+
...connection.usesSupervisionConnection ? { startOptions: connection.appServer.start } : {}
|
|
958
|
+
};
|
|
959
|
+
if (action === "status" || action === "get") {
|
|
960
|
+
if (args.length > 1) return "Usage: /codex goal [status]";
|
|
961
|
+
return formatNativeGoal(await deps.codexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.getThreadGoal, { threadId: binding.threadId }, goalRequestOptions));
|
|
962
|
+
}
|
|
963
|
+
if (action === "clear") {
|
|
964
|
+
if (args.length > 1) return "Usage: /codex goal clear";
|
|
965
|
+
const response = await deps.codexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.clearThreadGoal, { threadId: binding.threadId }, goalRequestOptions);
|
|
966
|
+
return isJsonObject(response) && response.cleared === true ? "Cleared the Codex goal." : "No Codex goal was active.";
|
|
967
|
+
}
|
|
968
|
+
const requestedStatus = action === "pause" ? "paused" : action === "resume" ? "active" : action === "block" ? "blocked" : action === "complete" ? "complete" : void 0;
|
|
969
|
+
const isObjectiveUpdate = action === "set";
|
|
970
|
+
if (!requestedStatus && !isObjectiveUpdate || isObjectiveUpdate && !objective) return "Usage: /codex goal [status|set <objective>|pause|resume|block|complete|clear]";
|
|
971
|
+
if (requestedStatus && args.length > 1) return `Usage: /codex goal ${action}`;
|
|
972
|
+
return formatNativeGoal(await deps.codexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.setThreadGoal, {
|
|
973
|
+
threadId: binding.threadId,
|
|
974
|
+
...objective ? { objective } : {},
|
|
975
|
+
...requestedStatus ? { status: requestedStatus } : {}
|
|
976
|
+
}, goalRequestOptions));
|
|
977
|
+
}
|
|
978
|
+
function formatNativeGoal(response) {
|
|
979
|
+
const goal = isJsonObject(response) && isJsonObject(response.goal) ? response.goal : void 0;
|
|
980
|
+
if (!goal) return "No Codex goal is active.";
|
|
981
|
+
const objective = readString$1(goal, "objective") ?? "unknown";
|
|
982
|
+
const status = readString$1(goal, "status") ?? "unknown";
|
|
983
|
+
const tokensUsed = typeof goal.tokensUsed === "number" ? goal.tokensUsed : 0;
|
|
984
|
+
const tokenBudget = typeof goal.tokenBudget === "number" ? goal.tokenBudget : void 0;
|
|
985
|
+
return [
|
|
986
|
+
`Codex goal: ${formatCodexDisplayText(objective)}`,
|
|
987
|
+
`- Status: ${formatCodexDisplayText(status)}`,
|
|
988
|
+
`- Tokens: ${tokensUsed}${tokenBudget === void 0 ? "" : ` / ${tokenBudget}`}`
|
|
989
|
+
].join("\n");
|
|
990
|
+
}
|
|
936
991
|
async function buildCodexCliSessions(deps, args) {
|
|
937
992
|
const parsed = parseCodexCliSessionsArgs(args);
|
|
938
993
|
if (parsed.help || !parsed.host) return "Usage: /codex sessions --host <node> [filter] [--limit <n>]";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as readCodexNotificationItem } from "./attempt-notifications-
|
|
3
|
-
import {
|
|
4
|
-
import { c as sessionBindingIdentity, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-BMfX1OX-.js";
|
|
1
|
+
import { R as CodexAppServerRpcError, Z as isJsonObject, a as getLeasedSharedCodexAppServerClient, c as releaseLeasedSharedCodexAppServerClient } from "./shared-client-CSXLtCLE.js";
|
|
2
|
+
import { _ as readCodexNotificationItem } from "./attempt-notifications-Ecjyzufe.js";
|
|
3
|
+
import { c as sessionBindingIdentity, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-Bmt20HfB.js";
|
|
5
4
|
import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-D1Wky__S.js";
|
|
6
|
-
import { a as resolveCodexBindingAppServerConnection, n as readCodexNotificationThreadId, r as readCodexNotificationTurnId } from "./notification-correlation-
|
|
5
|
+
import { a as resolveCodexBindingAppServerConnection, n as readCodexNotificationThreadId, r as readCodexNotificationTurnId } from "./notification-correlation-C8DVQ_Bq.js";
|
|
7
6
|
import { resolveAgentDir, resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime";
|
|
8
7
|
import { embeddedAgentLog, resolveCompactionTimeoutMs } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
9
8
|
//#region extensions/codex/src/app-server/compact.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { E as resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath, H as isCodexAppServerConnectionClosedError, U as isCodexAppServerIndeterminateRequestCancellationError, W as isCodexAppServerIndeterminateTransportError, a as getLeasedSharedCodexAppServerClient, c as releaseLeasedSharedCodexAppServerClient, h as acquireCodexNativeConfigFence, l as resolveCodexNativeConfigFenceKey } from "./shared-client-CSXLtCLE.js";
|
|
2
|
+
import { C as resolveCodexComputerUseConfig, b as resolveCodexAppServerRuntimeOptions } from "./session-binding-Bmt20HfB.js";
|
|
3
|
+
import { f as describeControlFailure } from "./command-formatters-NCTL7A2q.js";
|
|
4
|
+
import { r as requestCodexAppServerJson } from "./request-9yf9pZjf.js";
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
6
|
import { runExec } from "openclaw/plugin-sdk/process-runtime";
|
|
7
7
|
//#region extensions/codex/src/app-server/computer-use.ts
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { r as formatCodexDisplayText } from "./command-formatters-D6ZlGNmb.js";
|
|
7
|
-
import { a as resolveCodexBindingAppServerConnection } from "./notification-correlation-DfaCm0mx.js";
|
|
1
|
+
import { a as getLeasedSharedCodexAppServerClient, c as releaseLeasedSharedCodexAppServerClient, p as withLeasedCodexAppServerClientStartSelectionRetry, s as releaseCodexAppServerClientLease } from "./shared-client-CSXLtCLE.js";
|
|
2
|
+
import { _ as isCodexFastServiceTier, a as isCodexAppServerNativeAuthProfile, b as resolveCodexAppServerRuntimeOptions, o as normalizeCodexAppServerBindingModelProvider, r as bindingStoreKey, w as resolveCodexModelBackedReviewerPolicyContext } from "./session-binding-Bmt20HfB.js";
|
|
3
|
+
import { _ as resolveCodexBindingModelProviderFallback, h as resolveCodexAppServerRequestModelSelection } from "./thread-lifecycle-CQ_9mAa1.js";
|
|
4
|
+
import { d as CODEX_CONTROL_METHODS, r as formatCodexDisplayText } from "./command-formatters-NCTL7A2q.js";
|
|
5
|
+
import { a as resolveCodexBindingAppServerConnection } from "./notification-correlation-C8DVQ_Bq.js";
|
|
8
6
|
import { ModelSelectionLockedError } from "openclaw/plugin-sdk/model-session-runtime";
|
|
9
7
|
//#region extensions/codex/src/command-authorization.ts
|
|
10
8
|
const CODEX_NATIVE_EXECUTION_AUTH_ERROR = "Only an owner or operator.admin can control Codex native execution.";
|
|
@@ -302,7 +302,7 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
302
302
|
return await withFileLock(source.sidecarPath, LEGACY_BINDING_LOCK_OPTIONS, async () => {
|
|
303
303
|
const [contents, stat] = await Promise.all([fs.readFile(source.sidecarPath, "utf8"), fs.stat(source.sidecarPath)]);
|
|
304
304
|
const raw = JSON.parse(contents);
|
|
305
|
-
const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-
|
|
305
|
+
const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-Bmt20HfB.js").then((n) => n.l), import("./conversation-binding-data-BHRpYbX3.js").then((n) => n.t)]);
|
|
306
306
|
const agentId = owner?.agentId ?? (source.agentIds.size === 1 ? [...source.agentIds][0] : void 0);
|
|
307
307
|
const baseStored = createStoredCodexAppServerBinding(raw, {
|
|
308
308
|
now: stat.mtime.toISOString(),
|