@openclaw/codex 2026.8.1-beta.3 → 2026.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +4 -5
- package/dist/{attempt-client-cleanup-URjUlCHg.js → attempt-client-cleanup-CVPvp9dL.js} +47 -5
- package/dist/{auth-binding-B4FfbcCg.js → auth-binding-Ds_QVm-X.js} +18 -3
- package/dist/{binding-connection-DAvZwp96.js → binding-connection-CCQFs8lf.js} +2 -2
- package/dist/{bounded-turn-4BjrZEwW.js → bounded-turn-rq5tiSXk.js} +13 -18
- package/dist/{capabilities-CH3K57v4.js → capabilities-CGm_94eL.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-D0nZ3qtd.js → command-formatters-C54Yg3eA.js} +2 -2
- package/dist/{command-handlers-DC86lgT4.js → command-handlers-BvOAHTrA.js} +89 -62
- package/dist/{compact-COqgBRny.js → compact-Hd7SAc0N.js} +8 -9
- package/dist/{config-CpNeo5AE.js → config-Cxw3Cl3k.js} +346 -286
- package/dist/doctor-contract-api.js +115 -14
- package/dist/{dynamic-tools-fJZhl4CE.js → dynamic-tools-BFoUcRdx.js} +147 -903
- package/dist/{effective-mcp-catalog-4YKn51aG.js → effective-mcp-catalog-BTJHnDSx.js} +2 -2
- package/dist/{event-projector-assistant-message-BwxV4d6N.js → event-projector-assistant-message-C5-Ds8mA.js} +18 -1
- package/dist/{event-projector-usage-CLwNEJqW.js → event-projector-usage-D3PHFFXh.js} +3 -3
- package/dist/{harness-DoKQcF8n.js → harness-DVfUQBlQ.js} +42 -52
- package/dist/harness.js +1 -1
- package/dist/index.js +278 -295
- package/dist/{isolated-completion-DPMtlH9r.js → isolated-completion-Cbbx_5Ed.js} +4 -4
- package/dist/launch-args-sXOAg0SX.js +84 -0
- package/dist/{managed-binary-By4FZC6i.js → managed-binary-ZkGodW19.js} +43 -7
- package/dist/media-understanding-provider.js +1 -1
- package/dist/model-catalog-o6Cgjoss.js +101 -0
- package/dist/{models-CZw1wClT.js → models-DgFWSuxA.js} +25 -28
- package/dist/{native-subagent-monitor-GGq3RnOo.js → native-subagent-monitor-CwFyoylz.js} +207 -30
- package/dist/{node-exec-server.runtime-Bsu1LdFZ.js → node-exec-server.runtime-DXrqpw1c.js} +8 -5
- package/dist/{plugin-approval-roundtrip-C75Yiiwc.js → plugin-approval-roundtrip-D80UZiJ_.js} +1 -1
- package/dist/{plugin-marketplace-discovery-CSWDkMrP.js → plugin-marketplace-discovery-mdmScYOj.js} +30 -39
- package/dist/{plugin-metadata-cache-BXH5NF-4.js → plugin-metadata-cache-CulOABwu.js} +162 -135
- package/dist/{protocol-validators-VAVyEnDp.js → protocol-validators-Bg5rpNxk.js} +148 -5
- package/dist/{rate-limits-BI1dMHDG.js → rate-limits-hFtzt2Up.js} +1 -1
- package/dist/{sandbox-guard-C1qEeZ5C.js → request-CCm4LaED.js} +183 -2
- package/dist/{run-attempt-BV3HzuCf.js → run-attempt-BwNQDH2u.js} +599 -361
- package/dist/{runtime-artifact-BvyT1uyd.js → runtime-artifact-DeBvleJw.js} +1 -1
- package/dist/{session-binding-BTrLf9Qm.js → session-binding-q2WSTVmC.js} +195 -122
- package/dist/{session-catalog-ezP_UcRM.js → session-catalog-C2Tae4rI.js} +229 -122
- package/dist/session-catalog-home-id-DAKUrm3C.js +112 -0
- package/dist/{session-cli-B1hKvfkI.js → session-cli-BuDjm5Ou.js} +1 -1
- package/dist/session-permission-policy-gLm40Vtq.js +160 -0
- package/dist/session-retirement-CdkI0bvb.js +90 -0
- package/dist/{session-upstream-marker-D_2npHlA.js → session-upstream-marker-Bcy33kam.js} +2 -3
- package/dist/{settled-turn-finalizer-Dx1onIqg.js → settled-turn-finalizer-B8JJcxCi.js} +7 -6
- package/dist/{shared-client-Dw-rzii0.js → shared-client-kNkljY-R.js} +1720 -786
- package/dist/{side-question-DbXkJZzg.js → side-question-GwD73tX6.js} +69 -39
- package/dist/{thread-lifecycle-DKdrnTMX.js → thread-lifecycle-Ss-uwnC4.js} +852 -359
- package/dist/{thread-ownership-i2NBwDUL.js → thread-ownership-CeYBqg_4.js} +18 -8
- package/dist/{plugin-app-cache-key-DMNQ8Zi8.js → thread-resume-DF54hagX.js} +52 -6
- package/dist/{transcript-mirror-BU0_LKAL.js → transcript-mirror-CkEQIna-.js} +112 -13
- package/dist/transport-stdio-C7-s9TLG.js +708 -0
- package/dist/{upstream-session-fork-BDVJCLAD.js → upstream-session-fork-BACGlOFa.js} +78 -86
- package/dist/{usage-9dKJCgcy.js → usage-C2l8Mils.js} +3 -3
- package/dist/{web-search-provider.runtime-DCdx4DGu.js → web-search-provider.runtime-B2XgRdFv.js} +3 -3
- package/openclaw.plugin.json +19 -1
- package/package.json +8 -8
- package/dist/app-server-policy-bg5QPSVP.js +0 -25
- package/dist/command-rpc-xUIIonsO.js +0 -90
- package/dist/incognito-session-ET_ufDH-.js +0 -2
- package/dist/model-catalog-CmGoqVKB.js +0 -48
- package/dist/request-DSK0W6YI.js +0 -157
- package/dist/session-catalog-home-id-BNwAJ9D7.js +0 -18
- package/dist/session-retirement-CE4iMiLh.js +0 -36
- package/dist/thread-resume-CdJk2Ehf.js +0 -30
- package/dist/transport-stdio-DhoGy33Z.js +0 -99
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { d as sessionBindingIdentity } from "./session-binding-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { d as sessionBindingIdentity } from "./session-binding-q2WSTVmC.js";
|
|
2
|
+
import { a as assertCodexThreadForkResponse } from "./protocol-validators-Bg5rpNxk.js";
|
|
3
|
+
import { i as readUpstreamUserText, r as readMirrorIdentity } from "./upstream-prompt-provenance-CFmsKwr9.js";
|
|
4
|
+
import { c as fingerprintCodexMirrorSourceMessage, l as readCodexMirrorSourceFingerprint, p as projectCodexUserItemText } from "./transcript-mirror-CkEQIna-.js";
|
|
5
|
+
import { i as createImportedCodexSession, n as codexUpstreamBaseline, t as codexLastTerminalTurnId } from "./session-upstream-marker-Bcy33kam.js";
|
|
5
6
|
import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
7
|
import { readVisibleSessionTranscriptMessageEntries } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
7
8
|
import { deleteSessionUpstreamLink, upsertSessionUpstreamLink } from "openclaw/plugin-sdk/session-catalog";
|
|
@@ -17,31 +18,6 @@ function failure(code, message) {
|
|
|
17
18
|
function asInputs(item) {
|
|
18
19
|
return Array.isArray(item.content) ? item.content : [];
|
|
19
20
|
}
|
|
20
|
-
function userMessageDisplay(item) {
|
|
21
|
-
let text = "";
|
|
22
|
-
let hasTextElement = false;
|
|
23
|
-
let hasImage = false;
|
|
24
|
-
let hasUnverifiableInput = false;
|
|
25
|
-
for (const input of asInputs(item)) if (input.type === "text") {
|
|
26
|
-
if (typeof input.text === "string") text += input.text;
|
|
27
|
-
hasTextElement ||= Array.isArray(input.textElements) && input.textElements.length > 0;
|
|
28
|
-
} else {
|
|
29
|
-
hasUnverifiableInput = true;
|
|
30
|
-
hasImage ||= input.type === "image" || input.type === "localImage";
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
text,
|
|
34
|
-
visible: Boolean(text.trim()) || hasTextElement || hasImage,
|
|
35
|
-
hasUnverifiableInput
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function isHiddenNestedReviewTurn(previous, turn) {
|
|
39
|
-
if (previous?.status !== "completed" || turn.status !== "interrupted" || turn.completedAt != null || !previous.items.some((item) => item.type === "enteredReviewMode") || !previous.items.some((item) => item.type === "exitedReviewMode")) return false;
|
|
40
|
-
const userMessages = turn.items.filter((item) => item.type === "userMessage");
|
|
41
|
-
const [firstUserMessage, secondUserMessage] = userMessages;
|
|
42
|
-
if (!firstUserMessage || !secondUserMessage || userMessages.length !== 2) return false;
|
|
43
|
-
return JSON.stringify(asInputs(firstUserMessage)) === JSON.stringify(asInputs(secondUserMessage));
|
|
44
|
-
}
|
|
45
21
|
function localMessageText(content) {
|
|
46
22
|
if (typeof content === "string") return content;
|
|
47
23
|
if (!Array.isArray(content)) return;
|
|
@@ -52,37 +28,35 @@ function localMessageText(content) {
|
|
|
52
28
|
if (typed.type !== "text" || typeof typed.text !== "string") return;
|
|
53
29
|
texts.push(typed.text);
|
|
54
30
|
}
|
|
55
|
-
return texts.join("");
|
|
31
|
+
return texts.join("\n");
|
|
56
32
|
}
|
|
57
33
|
function resolveCodexUpstreamForkBoundaryFromTurns(params) {
|
|
58
|
-
let
|
|
59
|
-
let
|
|
34
|
+
let localIndex = 0;
|
|
35
|
+
let matchedPrefix = false;
|
|
60
36
|
for (const [turnIndex, turn] of params.turns.entries()) {
|
|
61
|
-
const hiddenNestedReviewTurn = isHiddenNestedReviewTurn(params.turns[turnIndex - 1], turn);
|
|
62
37
|
let userMessagesInTurn = 0;
|
|
63
38
|
for (const item of turn.items) {
|
|
64
|
-
if (item.type === "enteredReviewMode") {
|
|
65
|
-
reviewMode = true;
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
if (item.type === "exitedReviewMode") {
|
|
69
|
-
reviewMode = false;
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
39
|
if (item.type !== "userMessage") continue;
|
|
73
40
|
const isSteer = userMessagesInTurn > 0;
|
|
74
41
|
userMessagesInTurn += 1;
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
42
|
+
if (asInputs(item).some((input) => input.type !== "text")) return failure("drift-mismatch", "A message before the fork point contains images or attachments that cannot be verified across OpenClaw and Codex. Fork from a text-only span instead.");
|
|
43
|
+
const text = projectCodexUserItemText(item);
|
|
44
|
+
if (!text) continue;
|
|
45
|
+
const local = params.localPrefix[localIndex];
|
|
46
|
+
const identity = local && readMirrorIdentity(local.message);
|
|
47
|
+
const matchesIdentity = identity === `${turn.id}:${item.id}` || !isSteer && identity === `${turn.id}:prompt`;
|
|
48
|
+
if (!matchedPrefix && !matchesIdentity) continue;
|
|
49
|
+
matchedPrefix = true;
|
|
50
|
+
const localText = localMessageText(local && "content" in local.message ? local.message.content : void 0);
|
|
51
|
+
const upstreamText = local && readUpstreamUserText(local.message);
|
|
52
|
+
const upstreamPromptVerified = !upstreamText || local?.message.role === "user" && readCodexMirrorSourceFingerprint(local.message) === fingerprintCodexMirrorSourceMessage(local.message);
|
|
53
|
+
const expectedText = upstreamText ? projectCodexUserItemText({ content: [{
|
|
54
|
+
type: "text",
|
|
55
|
+
text: upstreamText
|
|
56
|
+
}] }) : localText;
|
|
57
|
+
if (!matchesIdentity || !upstreamPromptVerified || localText === void 0 || text !== expectedText) return failure("drift-mismatch", "The local conversation no longer matches the Codex thread. Refresh the session and try again.");
|
|
58
|
+
if (localIndex < params.localPrefix.length - 1) {
|
|
59
|
+
localIndex += 1;
|
|
86
60
|
continue;
|
|
87
61
|
}
|
|
88
62
|
if (isSteer) return failure("steer-message", "This message steered an existing Codex turn and cannot be forked independently. Fork from the turn's first message instead.");
|
|
@@ -104,7 +78,7 @@ function resolveCodexUpstreamForkBoundaryFromTurns(params) {
|
|
|
104
78
|
};
|
|
105
79
|
}
|
|
106
80
|
}
|
|
107
|
-
return failure("drift-mismatch", "The
|
|
81
|
+
return failure("drift-mismatch", "The local history has no verified boundary in this Codex thread. Use native Codex to fork this conversation.");
|
|
108
82
|
}
|
|
109
83
|
async function listCodexUpstreamTurns(control, threadId) {
|
|
110
84
|
const turns = [];
|
|
@@ -128,24 +102,23 @@ async function listCodexUpstreamTurns(control, threadId) {
|
|
|
128
102
|
}
|
|
129
103
|
async function resolveCodexUpstreamForkBoundary(params) {
|
|
130
104
|
try {
|
|
131
|
-
if ((await params.control.readThread(params.threadId, false)).historyMode === "paginated") return failure("upstream-unavailable", "This Codex thread uses paginated history, which cannot be forked from OpenClaw yet.");
|
|
132
105
|
const visibleUserEntries = (await readVisibleSessionTranscriptMessageEntries({
|
|
133
106
|
agentId: params.agentId,
|
|
134
107
|
sessionId: params.sessionId,
|
|
135
108
|
sessionKey: params.sessionKey,
|
|
136
109
|
storePath: params.storePath
|
|
137
110
|
})).filter((entry) => entry.role === "user");
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
111
|
+
const targetIndex = visibleUserEntries.findIndex((entry) => entry.entryId === params.entryId);
|
|
112
|
+
if (targetIndex < 0) return failure("drift-mismatch", "The local message could not be mapped to the Codex thread. Refresh the session and try again.");
|
|
113
|
+
const localPrefix = visibleUserEntries.slice(0, targetIndex + 1);
|
|
141
114
|
const resolved = resolveCodexUpstreamForkBoundaryFromTurns({
|
|
142
115
|
turns: await listCodexUpstreamTurns(params.control, params.threadId),
|
|
143
|
-
|
|
144
|
-
localPrefixTexts
|
|
116
|
+
localPrefix
|
|
145
117
|
});
|
|
118
|
+
const target = localPrefix.at(-1)?.message;
|
|
146
119
|
return resolved.ok ? {
|
|
147
120
|
...resolved,
|
|
148
|
-
editorText:
|
|
121
|
+
editorText: localMessageText(target && "content" in target ? target.content : void 0)
|
|
149
122
|
} : resolved;
|
|
150
123
|
} catch {
|
|
151
124
|
return failure("upstream-unavailable", "The Codex thread could not be read. Check that Codex is available, then try again.");
|
|
@@ -166,9 +139,6 @@ function readConnectionFingerprint(ref) {
|
|
|
166
139
|
if (!isRecord(ref)) return;
|
|
167
140
|
return typeof ref.connectionFingerprint === "string" && ref.connectionFingerprint.trim() ? ref.connectionFingerprint : void 0;
|
|
168
141
|
}
|
|
169
|
-
function normalizeTurnId(value) {
|
|
170
|
-
return normalizeOptionalString(value);
|
|
171
|
-
}
|
|
172
142
|
async function forkCodexUpstreamSession(params, options) {
|
|
173
143
|
try {
|
|
174
144
|
const sourceFingerprint = params.upstream.kind === "codex-app-server" ? readConnectionFingerprint(params.upstream.ref) : void 0;
|
|
@@ -179,27 +149,33 @@ async function forkCodexUpstreamSession(params, options) {
|
|
|
179
149
|
message: "This Codex thread is not available on the current connection. Reconnect to its host and try again."
|
|
180
150
|
};
|
|
181
151
|
return await requestControl.withPinnedConnection(async (control) => {
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
152
|
+
const sourceBinding = await options.bindingStore.read(sessionBindingIdentity({
|
|
153
|
+
...params.source,
|
|
154
|
+
config: options.resolveConfig?.()
|
|
155
|
+
}));
|
|
156
|
+
const supervised = sourceBinding?.connectionScope === "supervision";
|
|
157
|
+
const sourceThreadId = params.upstream.threadId;
|
|
185
158
|
let linked = false;
|
|
186
|
-
let
|
|
159
|
+
let createdBinding;
|
|
187
160
|
const compensateFork = async (forkedThreadId) => {
|
|
188
|
-
if (
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
161
|
+
if (createdBinding) {
|
|
162
|
+
if (!await options.bindingStore.mutate(createdBinding.identity, {
|
|
163
|
+
kind: "clear",
|
|
164
|
+
threadId: forkedThreadId,
|
|
165
|
+
expectedPendingSupervisionBranch: createdBinding.pending
|
|
166
|
+
}).catch(() => false)) return;
|
|
167
|
+
}
|
|
192
168
|
if (linked) deleteSessionUpstreamLink(params.targetKey, params.source.agentId);
|
|
193
169
|
await control.archiveThread(forkedThreadId).catch(() => void 0);
|
|
194
170
|
};
|
|
195
|
-
if (sourceFingerprint !== control.connectionFingerprint) return {
|
|
171
|
+
if (sourceFingerprint !== control.connectionFingerprint || supervised && (sourceBinding.supervisionSourceThreadId !== params.upstream.threadId || (sourceBinding.pendingSupervisionBranch?.connectionFingerprint ?? sourceBinding.appServerRuntimeFingerprint) !== sourceFingerprint)) return {
|
|
196
172
|
status: "failed",
|
|
197
173
|
code: "upstream-unavailable",
|
|
198
174
|
message: "This Codex thread is not available on the current connection. Reconnect to its host and try again."
|
|
199
175
|
};
|
|
200
176
|
const resolved = await resolveCodexUpstreamForkBoundary({
|
|
201
177
|
...params.source,
|
|
202
|
-
threadId:
|
|
178
|
+
threadId: sourceThreadId,
|
|
203
179
|
control
|
|
204
180
|
});
|
|
205
181
|
if (!resolved.ok) return {
|
|
@@ -207,7 +183,7 @@ async function forkCodexUpstreamSession(params, options) {
|
|
|
207
183
|
code: resolved.code,
|
|
208
184
|
message: resolved.message
|
|
209
185
|
};
|
|
210
|
-
const liveTurns = await listCodexUpstreamTurns(control,
|
|
186
|
+
const liveTurns = await listCodexUpstreamTurns(control, sourceThreadId);
|
|
211
187
|
const precheck = precheckCodexUpstreamForkBoundary({
|
|
212
188
|
boundary: resolved.boundary,
|
|
213
189
|
turns: liveTurns
|
|
@@ -218,27 +194,27 @@ async function forkCodexUpstreamSession(params, options) {
|
|
|
218
194
|
message: precheck.message
|
|
219
195
|
};
|
|
220
196
|
const rawResponse = await control.forkThread({
|
|
221
|
-
threadId:
|
|
197
|
+
threadId: sourceThreadId,
|
|
222
198
|
beforeTurnId: resolved.boundary.beforeTurnId,
|
|
223
|
-
...
|
|
224
|
-
excludeTurns:
|
|
199
|
+
...params.sandbox === "required" ? { sandbox: "workspace-write" } : {},
|
|
200
|
+
excludeTurns: true
|
|
225
201
|
});
|
|
226
202
|
let response;
|
|
227
203
|
try {
|
|
228
204
|
response = assertCodexThreadForkResponse(rawResponse);
|
|
229
205
|
} catch (error) {
|
|
230
206
|
const orphanThreadId = isRecord(rawResponse.thread) && typeof rawResponse.thread.id === "string" ? rawResponse.thread.id.trim() : "";
|
|
231
|
-
if (orphanThreadId && orphanThreadId !==
|
|
207
|
+
if (orphanThreadId && orphanThreadId !== sourceThreadId && orphanThreadId !== sourceBinding?.threadId) await control.archiveThread(orphanThreadId).catch(() => void 0);
|
|
232
208
|
throw error;
|
|
233
209
|
}
|
|
234
210
|
const threadId = response.thread.id.trim();
|
|
235
211
|
if (!threadId) throw new Error("Codex thread/fork response did not include a thread id");
|
|
236
|
-
if (threadId ===
|
|
212
|
+
if (threadId === sourceThreadId || threadId === sourceBinding?.threadId) throw new Error("Codex thread/fork response reused the source thread id");
|
|
237
213
|
const forkedThreadId = threadId;
|
|
238
214
|
try {
|
|
239
|
-
const connectionFingerprint = control.connectionFingerprint;
|
|
215
|
+
const connectionFingerprint = normalizeOptionalString(control.connectionFingerprint);
|
|
240
216
|
if (!connectionFingerprint) throw new Error("Codex fork connection did not include a fingerprint");
|
|
241
|
-
const forkedTurns =
|
|
217
|
+
const forkedTurns = await listCodexUpstreamTurns(control, threadId);
|
|
242
218
|
const expectedLastTurnId = resolved.boundary.retainedMarker.turnId;
|
|
243
219
|
if ((forkedTurns.at(-1)?.id ?? null) !== expectedLastTurnId) {
|
|
244
220
|
await compensateFork(forkedThreadId);
|
|
@@ -252,8 +228,8 @@ async function forkCodexUpstreamSession(params, options) {
|
|
|
252
228
|
...response.thread,
|
|
253
229
|
turns: forkedTurns
|
|
254
230
|
};
|
|
255
|
-
const throughTurnId = codexLastTerminalTurnId(forkedThread,
|
|
256
|
-
const marker = codexUpstreamBaseline(forkedThread,
|
|
231
|
+
const throughTurnId = codexLastTerminalTurnId(forkedThread, normalizeOptionalString) ?? null;
|
|
232
|
+
const marker = codexUpstreamBaseline(forkedThread, normalizeOptionalString);
|
|
257
233
|
const config = options.resolveConfig?.() ?? {};
|
|
258
234
|
return {
|
|
259
235
|
status: "created",
|
|
@@ -269,7 +245,7 @@ async function forkCodexUpstreamSession(params, options) {
|
|
|
269
245
|
modelSelectionLocked: true
|
|
270
246
|
},
|
|
271
247
|
afterImport: async (entry) => {
|
|
272
|
-
bindingIdentity = sessionBindingIdentity({
|
|
248
|
+
const bindingIdentity = sessionBindingIdentity({
|
|
273
249
|
agentId: entry.agentId,
|
|
274
250
|
sessionId: entry.sessionId,
|
|
275
251
|
sessionKey: entry.key,
|
|
@@ -289,17 +265,33 @@ async function forkCodexUpstreamSession(params, options) {
|
|
|
289
265
|
marker
|
|
290
266
|
});
|
|
291
267
|
if (!linked) throw new Error("Codex fork link could not be persisted");
|
|
268
|
+
createdBinding = {
|
|
269
|
+
identity: bindingIdentity,
|
|
270
|
+
pending: {
|
|
271
|
+
sourceThreadId: threadId,
|
|
272
|
+
connectionFingerprint,
|
|
273
|
+
...throughTurnId ? { lastTurnId: throughTurnId } : {}
|
|
274
|
+
}
|
|
275
|
+
};
|
|
292
276
|
if (!await options.bindingStore.mutate(bindingIdentity, {
|
|
293
277
|
kind: "set",
|
|
278
|
+
if: { kind: "absent" },
|
|
294
279
|
binding: {
|
|
295
280
|
threadId,
|
|
296
|
-
|
|
281
|
+
connectionScope: "supervision",
|
|
282
|
+
supervisionSourceThreadId: threadId,
|
|
283
|
+
preserveNativeModel: true,
|
|
284
|
+
conversationSourceTransferComplete: true,
|
|
285
|
+
pendingSupervisionBranch: createdBinding.pending,
|
|
297
286
|
cwd: forkedThread.cwd ?? "",
|
|
298
287
|
model: response.model,
|
|
299
288
|
modelProvider: response.modelProvider ?? void 0,
|
|
300
289
|
historyCoveredThrough: (/* @__PURE__ */ new Date()).toISOString()
|
|
301
290
|
}
|
|
302
|
-
}))
|
|
291
|
+
})) {
|
|
292
|
+
createdBinding = void 0;
|
|
293
|
+
throw new Error("Codex session binding changed before the fork could be attached");
|
|
294
|
+
}
|
|
303
295
|
return { pluginExtensions: entry.entry.pluginExtensions };
|
|
304
296
|
}
|
|
305
297
|
})).key,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as resolveCodexAppServerRuntimeOptions } from "./config-
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
1
|
+
import { i as resolveCodexAppServerRuntimeOptions } from "./config-Cxw3Cl3k.js";
|
|
2
|
+
import { n as readCodexAppServerUsage } from "./request-CCm4LaED.js";
|
|
3
|
+
import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-hFtzt2Up.js";
|
|
4
4
|
import { CODEX_APP_SERVER_AUTH_MARKER } from "openclaw/plugin-sdk/agent-runtime";
|
|
5
5
|
//#region extensions/codex/src/app-server/usage.ts
|
|
6
6
|
/** Handles the synthetic usage credential for a Codex-backed OpenAI route. */
|
package/dist/{web-search-provider.runtime-DCdx4DGu.js → web-search-provider.runtime-B2XgRdFv.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-
|
|
1
|
+
import { Ht as isJsonObject } from "./shared-client-kNkljY-R.js";
|
|
2
|
+
import { b as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-Ss-uwnC4.js";
|
|
3
|
+
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-rq5tiSXk.js";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { readStringParam, resolveSearchTimeoutSeconds, wrapWebContent } from "openclaw/plugin-sdk/provider-web-search";
|
|
6
6
|
//#region extensions/codex/src/web-search-provider.runtime.ts
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "codex",
|
|
3
|
+
"backupResources": [
|
|
4
|
+
{
|
|
5
|
+
"disposition": "regenerable",
|
|
6
|
+
"scope": "agent",
|
|
7
|
+
"relativePath": "codex-home/tmp/arg0"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"disposition": "regenerable",
|
|
11
|
+
"scope": "agent",
|
|
12
|
+
"relativePath": "codex-home/.tmp/plugins"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"disposition": "regenerable",
|
|
16
|
+
"scope": "agent",
|
|
17
|
+
"relativePath": "codex-home/.tmp/bundled-marketplaces"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
3
20
|
"doctorContract": {
|
|
4
21
|
"configRepair": true,
|
|
5
22
|
"stateMigrations": true
|
|
6
23
|
},
|
|
24
|
+
"doctorHealthChecks": true,
|
|
7
25
|
"sessionRouteStateOwners": [
|
|
8
26
|
{
|
|
9
27
|
"id": "codex",
|
|
@@ -497,7 +515,7 @@
|
|
|
497
515
|
},
|
|
498
516
|
"computerUse.autoRepair": {
|
|
499
517
|
"label": "Auto Repair",
|
|
500
|
-
"help": "When true, failed Computer Use live tests
|
|
518
|
+
"help": "When true, failed Computer Use live tests reload the Codex-owned MCP runtime before retrying once.",
|
|
501
519
|
"advanced": true
|
|
502
520
|
},
|
|
503
521
|
"computerUse.marketplaceSource": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.8.1
|
|
3
|
+
"version": "2026.8.1",
|
|
4
4
|
"description": "OpenClaw Codex app-server harness and native session supervision plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openai/codex": "0.
|
|
11
|
+
"@openai/codex": "0.151.0",
|
|
12
12
|
"semver": "7.8.5",
|
|
13
|
-
"smol-toml": "1.
|
|
14
|
-
"typebox": "1.3.
|
|
15
|
-
"ws": "8.21.
|
|
13
|
+
"smol-toml": "1.8.0",
|
|
14
|
+
"typebox": "1.3.16",
|
|
15
|
+
"ws": "8.21.3",
|
|
16
16
|
"zod": "4.4.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
]
|
|
37
37
|
},
|
|
38
38
|
"compat": {
|
|
39
|
-
"pluginApi": ">=2026.8.1
|
|
39
|
+
"pluginApi": ">=2026.8.1"
|
|
40
40
|
},
|
|
41
41
|
"build": {
|
|
42
|
-
"openclawVersion": "2026.8.1
|
|
42
|
+
"openclawVersion": "2026.8.1"
|
|
43
43
|
},
|
|
44
44
|
"release": {
|
|
45
45
|
"publishToClawHub": true,
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"README.md"
|
|
60
60
|
],
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"openclaw": ">=2026.8.1
|
|
62
|
+
"openclaw": ">=2026.8.1"
|
|
63
63
|
},
|
|
64
64
|
"peerDependenciesMeta": {
|
|
65
65
|
"openclaw": {
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { b as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-CpNeo5AE.js";
|
|
2
|
-
//#region extensions/codex/src/app-server/app-server-policy.ts
|
|
3
|
-
function resolveCodexAppServerForModelProvider(params) {
|
|
4
|
-
const explicitProvider = normalizeModelBackedReviewerProvider(params.provider);
|
|
5
|
-
if (!isCodexModelBackedApprovalsReviewer(params.appServer.approvalsReviewer) || canUseCodexModelBackedApprovalsReviewerForModel({
|
|
6
|
-
modelProvider: explicitProvider,
|
|
7
|
-
model: params.model,
|
|
8
|
-
config: params.config,
|
|
9
|
-
env: params.env,
|
|
10
|
-
agentDir: params.agentDir,
|
|
11
|
-
codexConfigToml: params.codexConfigToml
|
|
12
|
-
})) return params.appServer;
|
|
13
|
-
return {
|
|
14
|
-
...params.appServer,
|
|
15
|
-
approvalsReviewer: "user"
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function isCodexModelBackedApprovalsReviewer(value) {
|
|
19
|
-
return value === "auto_review" || value === "guardian_subagent";
|
|
20
|
-
}
|
|
21
|
-
function normalizeModelBackedReviewerProvider(provider) {
|
|
22
|
-
return provider?.trim().toLowerCase() || void 0;
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
export { resolveCodexAppServerForModelProvider as t };
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { i as resolveCodexAppServerRuntimeOptions, s as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-CpNeo5AE.js";
|
|
2
|
-
import { n as listCodexAppServerModels } from "./models-CZw1wClT.js";
|
|
3
|
-
import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-CH3K57v4.js";
|
|
4
|
-
import { i as withCodexAppServerJsonClient, r as requestCodexAppServerJson } from "./request-DSK0W6YI.js";
|
|
5
|
-
//#region extensions/codex/src/command-rpc.ts
|
|
6
|
-
function requestOptions(pluginConfig, limit, config, agentDir) {
|
|
7
|
-
const runtime = resolveCodexAppServerRuntimeOptions({ pluginConfig });
|
|
8
|
-
return {
|
|
9
|
-
limit,
|
|
10
|
-
timeoutMs: runtime.requestTimeoutMs,
|
|
11
|
-
startOptions: runtime.start,
|
|
12
|
-
config,
|
|
13
|
-
agentDir
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
async function codexControlRequest(pluginConfig, method, requestParams, options = {}) {
|
|
17
|
-
const runtime = options.startOptions ? resolveCodexSupervisionAppServerRuntimeOptions({ pluginConfig }) : resolveCodexAppServerRuntimeOptions({ pluginConfig });
|
|
18
|
-
const controlRequestOptions = {
|
|
19
|
-
timeoutMs: options.timeoutMs ?? runtime.requestTimeoutMs,
|
|
20
|
-
startOptions: options.startOptions ?? runtime.start,
|
|
21
|
-
config: options.config,
|
|
22
|
-
sessionKey: options.sessionKey,
|
|
23
|
-
sessionId: options.sessionId,
|
|
24
|
-
authProfileId: options.authProfileId,
|
|
25
|
-
agentDir: options.agentDir,
|
|
26
|
-
isolated: options.isolated
|
|
27
|
-
};
|
|
28
|
-
if (options.onResponse) return await withCodexAppServerJsonClient(controlRequestOptions, async (request, client) => {
|
|
29
|
-
const response = await request({
|
|
30
|
-
method,
|
|
31
|
-
requestParams
|
|
32
|
-
});
|
|
33
|
-
await options.onResponse(response, client);
|
|
34
|
-
return response;
|
|
35
|
-
});
|
|
36
|
-
return await requestCodexAppServerJson({
|
|
37
|
-
method,
|
|
38
|
-
requestParams,
|
|
39
|
-
...controlRequestOptions
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
async function safeCodexControlRequest(pluginConfig, method, requestParams, options = {}) {
|
|
43
|
-
return await safeValue(async () => await codexControlRequest(pluginConfig, method, requestParams, options));
|
|
44
|
-
}
|
|
45
|
-
async function safeCodexModelList(pluginConfig, limit, config, agentDir) {
|
|
46
|
-
return await safeValue(async () => await listCodexAppServerModels(requestOptions(pluginConfig, limit, config, agentDir)));
|
|
47
|
-
}
|
|
48
|
-
async function readCodexStatusProbes(pluginConfig, config, agentDir) {
|
|
49
|
-
const [models, account, limits, mcps, skills] = await Promise.all([
|
|
50
|
-
safeCodexModelList(pluginConfig, 20, config, agentDir),
|
|
51
|
-
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.account, { refreshToken: false }, {
|
|
52
|
-
config,
|
|
53
|
-
agentDir
|
|
54
|
-
}),
|
|
55
|
-
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.rateLimits, void 0, {
|
|
56
|
-
config,
|
|
57
|
-
agentDir
|
|
58
|
-
}),
|
|
59
|
-
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.listMcpServers, { limit: 100 }, {
|
|
60
|
-
config,
|
|
61
|
-
agentDir
|
|
62
|
-
}),
|
|
63
|
-
safeCodexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.listSkills, {}, {
|
|
64
|
-
config,
|
|
65
|
-
agentDir
|
|
66
|
-
})
|
|
67
|
-
]);
|
|
68
|
-
return {
|
|
69
|
-
models,
|
|
70
|
-
account,
|
|
71
|
-
limits,
|
|
72
|
-
mcps,
|
|
73
|
-
skills
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
async function safeValue(read) {
|
|
77
|
-
try {
|
|
78
|
-
return {
|
|
79
|
-
ok: true,
|
|
80
|
-
value: await read()
|
|
81
|
-
};
|
|
82
|
-
} catch (error) {
|
|
83
|
-
return {
|
|
84
|
-
ok: false,
|
|
85
|
-
error: describeControlFailure(error)
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
//#endregion
|
|
90
|
-
export { safeCodexControlRequest as i, readCodexStatusProbes as n, requestOptions as r, codexControlRequest as t };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { r as buildCodexRuntimeModelParams } from "./harness-DoKQcF8n.js";
|
|
2
|
-
import { h as readCodexPluginConfig } from "./config-CpNeo5AE.js";
|
|
3
|
-
import { t as listAllCodexAppServerModels } from "./models-CZw1wClT.js";
|
|
4
|
-
import { r as requestOptions } from "./command-rpc-xUIIonsO.js";
|
|
5
|
-
//#region extensions/codex/src/app-server/model-catalog.ts
|
|
6
|
-
const OPENAI_CODEX_BASE_URL = "https://chatgpt.com/backend-api/codex";
|
|
7
|
-
const DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS = 2500;
|
|
8
|
-
const INPUT_TYPES = /* @__PURE__ */ new Set([
|
|
9
|
-
"text",
|
|
10
|
-
"image",
|
|
11
|
-
"audio",
|
|
12
|
-
"video",
|
|
13
|
-
"document"
|
|
14
|
-
]);
|
|
15
|
-
function isModelInputType(value) {
|
|
16
|
-
return INPUT_TYPES.has(value);
|
|
17
|
-
}
|
|
18
|
-
function codexAppServerModelsToCatalogEntries(models) {
|
|
19
|
-
return models.map((model, providerOrder) => {
|
|
20
|
-
const input = model.inputModalities.filter(isModelInputType);
|
|
21
|
-
const runtimeParams = buildCodexRuntimeModelParams(model.id, model.model);
|
|
22
|
-
return {
|
|
23
|
-
provider: "openai",
|
|
24
|
-
id: model.id,
|
|
25
|
-
name: model.displayName ?? model.id,
|
|
26
|
-
providerOrder,
|
|
27
|
-
api: "openai-chatgpt-responses",
|
|
28
|
-
baseUrl: OPENAI_CODEX_BASE_URL,
|
|
29
|
-
reasoning: model.supportedReasoningEfforts.length > 0,
|
|
30
|
-
...input.length > 0 ? { input } : {},
|
|
31
|
-
...runtimeParams ? { params: runtimeParams } : {},
|
|
32
|
-
compat: {
|
|
33
|
-
supportsReasoningEffort: model.supportedReasoningEfforts.length > 0,
|
|
34
|
-
supportedReasoningEfforts: model.supportedReasoningEfforts
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
async function loadCodexAppServerModelCatalog(params, pluginConfig) {
|
|
40
|
-
const discovery = readCodexPluginConfig(pluginConfig).discovery;
|
|
41
|
-
if (discovery?.enabled === false) return [];
|
|
42
|
-
return codexAppServerModelsToCatalogEntries((await listAllCodexAppServerModels({
|
|
43
|
-
...requestOptions(pluginConfig, 100, params.config, params.agentDir),
|
|
44
|
-
timeoutMs: discovery?.timeoutMs ?? DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS
|
|
45
|
-
})).models);
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
export { loadCodexAppServerModelCatalog };
|