orkestrator 2.30.0-beta → 2.31.0-beta
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 +15 -3
- package/dist/client.js +1725 -157
- package/dist/main.js +222674 -213019
- package/package.json +3 -3
- package/resources/claude-bridge/dist/index.js +774 -662
- package/resources/codex-bridge/dist/index.js +69 -21
|
@@ -3933,7 +3933,14 @@ var QUESTION_KEYS = new Set([
|
|
|
3933
3933
|
"allowFreeText",
|
|
3934
3934
|
"options"
|
|
3935
3935
|
]);
|
|
3936
|
-
var OPTION_KEYS = new Set([
|
|
3936
|
+
var OPTION_KEYS = new Set([
|
|
3937
|
+
"id",
|
|
3938
|
+
"label",
|
|
3939
|
+
"providerValue",
|
|
3940
|
+
"description",
|
|
3941
|
+
"preview",
|
|
3942
|
+
"amendment"
|
|
3943
|
+
]);
|
|
3937
3944
|
var AMENDMENT_KEYS = new Set(["kind", "detail"]);
|
|
3938
3945
|
var ANSWER_KEYS = new Set(["version", "interactionId", "sessionId", "answers"]);
|
|
3939
3946
|
var QUESTION_ANSWER_KEYS = new Set(["questionId", "optionIds", "freeText"]);
|
|
@@ -4060,6 +4067,15 @@ var NATIVE_AGENT_APPROVAL_MODES = Object.freeze({
|
|
|
4060
4067
|
}
|
|
4061
4068
|
]
|
|
4062
4069
|
});
|
|
4070
|
+
var CODEX_CONTAINER_APPROVAL_DESCRIPTIONS = Object.freeze({
|
|
4071
|
+
ask: {
|
|
4072
|
+
"on-request": "Codex has no sandbox of its own in a container, so this asks before any command Codex does not trust, like Untrusted"
|
|
4073
|
+
},
|
|
4074
|
+
"auto-approve": {
|
|
4075
|
+
"on-request": "Codex has no sandbox of its own in a container, so this never asks; choose Untrusted to approve commands",
|
|
4076
|
+
"auto-review": "Codex has no sandbox of its own in a container, so the reviewer is never consulted and everything runs"
|
|
4077
|
+
}
|
|
4078
|
+
});
|
|
4063
4079
|
var NATIVE_AGENT_RETIRED_DISPATCH_TTL_MS = 24 * 60 * 60 * 1000;
|
|
4064
4080
|
var SUPPRESSED_COMPOSER_PARAMETERS = Object.freeze({
|
|
4065
4081
|
claude: Object.freeze(["parameter:thinking", "parameter:context1m"]),
|
|
@@ -12332,7 +12348,9 @@ var COORDINATOR_CONTROL_TOOL_NAMES = Object.freeze([
|
|
|
12332
12348
|
"adopt_workflow",
|
|
12333
12349
|
"cancel_build_pipeline",
|
|
12334
12350
|
"cancel_multi_review",
|
|
12351
|
+
"cancel_schedule",
|
|
12335
12352
|
"compare_project_files",
|
|
12353
|
+
"create_schedule",
|
|
12336
12354
|
"create_ticket",
|
|
12337
12355
|
"get_build_pipeline",
|
|
12338
12356
|
"get_environment",
|
|
@@ -12354,6 +12372,7 @@ var COORDINATOR_CONTROL_TOOL_NAMES = Object.freeze([
|
|
|
12354
12372
|
"list_node_environments",
|
|
12355
12373
|
"list_nodes",
|
|
12356
12374
|
"list_projects",
|
|
12375
|
+
"list_schedules",
|
|
12357
12376
|
"list_tabs",
|
|
12358
12377
|
"list_tickets",
|
|
12359
12378
|
"list_workflows",
|
|
@@ -12809,7 +12828,7 @@ function mergePersistedSessionMeta(sessionsById, meta) {
|
|
|
12809
12828
|
}
|
|
12810
12829
|
function isSyntheticPersistedUserText(text) {
|
|
12811
12830
|
const trimmed = text.trim();
|
|
12812
|
-
return trimmed.startsWith("# AGENTS.md instructions for ") || /^# AGENTS\.md instructions[ \t]*\n\s*<INSTRUCTIONS>/.test(trimmed) || trimmed.startsWith(`<recommended_plugins>
|
|
12831
|
+
return trimmed.startsWith("# AGENTS.md instructions for ") || /^# AGENTS\.md instructions[ \t]*\n\s*<INSTRUCTIONS>/.test(trimmed) || trimmed.startsWith("<environment_context>") && trimmed.endsWith("</environment_context>") || trimmed.startsWith(`<recommended_plugins>
|
|
12813
12832
|
Here is a list of plugins that are available but not installed.`);
|
|
12814
12833
|
}
|
|
12815
12834
|
function extractPersistedMessageContent(content, role) {
|
|
@@ -14257,7 +14276,7 @@ class AppServerUnavailableError extends Error {
|
|
|
14257
14276
|
class AppServerCircuitOpenError extends Error {
|
|
14258
14277
|
failures;
|
|
14259
14278
|
constructor(failures, lastError) {
|
|
14260
|
-
super(`app-server failed to start ${failures} times; not retrying${lastError ? ` (last error: ${lastError})` : ""}`);
|
|
14279
|
+
super(`app-server failed to start ${failures} times; not retrying until the cooldown ends${lastError ? ` (last error: ${lastError})` : ""}`);
|
|
14261
14280
|
this.name = "AppServerCircuitOpenError";
|
|
14262
14281
|
this.failures = failures;
|
|
14263
14282
|
}
|
|
@@ -14933,6 +14952,8 @@ function isOwnershipContention(error) {
|
|
|
14933
14952
|
var DEFAULT_BACKOFF_MS = [250, 500, 1000, 2000, 5000, 1e4];
|
|
14934
14953
|
var DEFAULT_CIRCUIT_THRESHOLD = 5;
|
|
14935
14954
|
var DEFAULT_CIRCUIT_WINDOW_MS = 60000;
|
|
14955
|
+
var DEFAULT_CIRCUIT_COOLDOWN_MS = 5 * 60000;
|
|
14956
|
+
var DEFAULT_CIRCUIT_MAX_COOLDOWN_MS = 30 * 60000;
|
|
14936
14957
|
var DEFAULT_SHUTDOWN_GRACE_MS = 5000;
|
|
14937
14958
|
var INCOMPLETE_PIDFILE_GRACE_MS = 1000;
|
|
14938
14959
|
var PID_OWNERSHIP_TTL_MS = 24 * 60 * 60 * 1000;
|
|
@@ -14947,6 +14968,8 @@ class AppServerSupervisor {
|
|
|
14947
14968
|
backoffSchedule;
|
|
14948
14969
|
circuitThreshold;
|
|
14949
14970
|
circuitWindowMs;
|
|
14971
|
+
circuitCooldownMs;
|
|
14972
|
+
circuitMaxCooldownMs;
|
|
14950
14973
|
shutdownGraceMs;
|
|
14951
14974
|
fingerprintEnvironment;
|
|
14952
14975
|
notificationQueue = new SerialQueue;
|
|
@@ -14959,6 +14982,9 @@ class AppServerSupervisor {
|
|
|
14959
14982
|
restartFailures = [];
|
|
14960
14983
|
restartCount = 0;
|
|
14961
14984
|
circuitOpen = false;
|
|
14985
|
+
circuitProbeAt = 0;
|
|
14986
|
+
nextCircuitCooldownMs;
|
|
14987
|
+
stopController = new AbortController;
|
|
14962
14988
|
lastError;
|
|
14963
14989
|
lastExitCode = null;
|
|
14964
14990
|
lastExitSignal = null;
|
|
@@ -14974,6 +15000,9 @@ class AppServerSupervisor {
|
|
|
14974
15000
|
this.backoffSchedule = options.backoffScheduleMs ?? DEFAULT_BACKOFF_MS;
|
|
14975
15001
|
this.circuitThreshold = options.circuitBreakerThreshold ?? DEFAULT_CIRCUIT_THRESHOLD;
|
|
14976
15002
|
this.circuitWindowMs = options.circuitWindowMs ?? DEFAULT_CIRCUIT_WINDOW_MS;
|
|
15003
|
+
this.circuitCooldownMs = Math.max(0, options.circuitCooldownMs ?? DEFAULT_CIRCUIT_COOLDOWN_MS);
|
|
15004
|
+
this.circuitMaxCooldownMs = Math.max(this.circuitCooldownMs, options.circuitMaxCooldownMs ?? DEFAULT_CIRCUIT_MAX_COOLDOWN_MS);
|
|
15005
|
+
this.nextCircuitCooldownMs = this.circuitCooldownMs;
|
|
14977
15006
|
this.shutdownGraceMs = options.shutdownGraceMs ?? DEFAULT_SHUTDOWN_GRACE_MS;
|
|
14978
15007
|
this.fingerprintEnvironment = options.fingerprintEnvironment ?? fingerprintRuntimeEnvironment;
|
|
14979
15008
|
}
|
|
@@ -15026,13 +15055,15 @@ class AppServerSupervisor {
|
|
|
15026
15055
|
async ensureStarted() {
|
|
15027
15056
|
if (this.stopping)
|
|
15028
15057
|
throw new AppServerUnavailableError("stopped");
|
|
15029
|
-
if (this.
|
|
15058
|
+
if (this.startPromise)
|
|
15059
|
+
return this.startPromise;
|
|
15060
|
+
if (this.circuitOpen && this.now() < this.circuitProbeAt) {
|
|
15030
15061
|
throw new AppServerCircuitOpenError(this.restartFailures.length, this.lastError);
|
|
15031
15062
|
}
|
|
15032
15063
|
if (this.current && !this.current.client.isClosed() && this.state === "ready") {
|
|
15033
15064
|
return this.current;
|
|
15034
15065
|
}
|
|
15035
|
-
this.startPromise
|
|
15066
|
+
this.startPromise = this.startWithRetry(this.circuitOpen).finally(() => {
|
|
15036
15067
|
this.startPromise = null;
|
|
15037
15068
|
});
|
|
15038
15069
|
return this.startPromise;
|
|
@@ -15069,12 +15100,14 @@ class AppServerSupervisor {
|
|
|
15069
15100
|
return;
|
|
15070
15101
|
await this.current.client.respondWithError(id, code, message);
|
|
15071
15102
|
}
|
|
15072
|
-
async startWithRetry() {
|
|
15103
|
+
async startWithRetry(probe = false) {
|
|
15073
15104
|
let attempt = 0;
|
|
15074
15105
|
for (;; ) {
|
|
15075
15106
|
try {
|
|
15076
15107
|
const generation = await this.start();
|
|
15077
15108
|
this.restartFailures = [];
|
|
15109
|
+
this.circuitOpen = false;
|
|
15110
|
+
this.nextCircuitCooldownMs = this.circuitCooldownMs;
|
|
15078
15111
|
return generation;
|
|
15079
15112
|
} catch (error) {
|
|
15080
15113
|
this.lastError = error instanceof Error ? error.message : String(error);
|
|
@@ -15084,7 +15117,7 @@ class AppServerSupervisor {
|
|
|
15084
15117
|
this.setState("failed", this.lastError);
|
|
15085
15118
|
throw error;
|
|
15086
15119
|
}
|
|
15087
|
-
this.recordFailure();
|
|
15120
|
+
this.recordFailure(probe);
|
|
15088
15121
|
if (this.circuitOpen) {
|
|
15089
15122
|
this.setState("failed", this.lastError);
|
|
15090
15123
|
throw new AppServerCircuitOpenError(this.restartFailures.length, this.lastError);
|
|
@@ -15092,19 +15125,21 @@ class AppServerSupervisor {
|
|
|
15092
15125
|
const delay = this.backoffDelay(attempt);
|
|
15093
15126
|
attempt += 1;
|
|
15094
15127
|
this.setState("backoff", `retrying in ${delay}ms: ${this.lastError}`);
|
|
15095
|
-
await
|
|
15128
|
+
await sleepUnlessAborted(delay, this.stopController.signal);
|
|
15096
15129
|
if (this.stopping)
|
|
15097
15130
|
throw new AppServerUnavailableError("stopped");
|
|
15098
15131
|
}
|
|
15099
15132
|
}
|
|
15100
15133
|
}
|
|
15101
|
-
recordFailure() {
|
|
15134
|
+
recordFailure(probe = false) {
|
|
15102
15135
|
const now = this.now();
|
|
15103
15136
|
this.restartFailures = this.restartFailures.filter((at) => now - at <= this.circuitWindowMs);
|
|
15104
15137
|
this.restartFailures.push(now);
|
|
15105
|
-
if (this.restartFailures.length
|
|
15106
|
-
|
|
15107
|
-
|
|
15138
|
+
if (!probe && this.restartFailures.length < this.circuitThreshold)
|
|
15139
|
+
return;
|
|
15140
|
+
this.circuitOpen = true;
|
|
15141
|
+
this.circuitProbeAt = now + this.nextCircuitCooldownMs;
|
|
15142
|
+
this.nextCircuitCooldownMs = Math.min(this.circuitMaxCooldownMs, Math.max(1, this.nextCircuitCooldownMs) * 2);
|
|
15108
15143
|
}
|
|
15109
15144
|
backoffDelay(attempt) {
|
|
15110
15145
|
const base = this.backoffSchedule[Math.min(attempt, this.backoffSchedule.length - 1)] ?? 1000;
|
|
@@ -15349,6 +15384,7 @@ class AppServerSupervisor {
|
|
|
15349
15384
|
}
|
|
15350
15385
|
async stop() {
|
|
15351
15386
|
this.stopping = true;
|
|
15387
|
+
this.stopController.abort();
|
|
15352
15388
|
this.setState("draining", "bridge shutting down");
|
|
15353
15389
|
const pendingStart = this.startPromise;
|
|
15354
15390
|
const startingChild = this.startingChild;
|
|
@@ -15816,6 +15852,20 @@ function sleep(ms) {
|
|
|
15816
15852
|
timer.unref?.();
|
|
15817
15853
|
});
|
|
15818
15854
|
}
|
|
15855
|
+
function sleepUnlessAborted(ms, signal) {
|
|
15856
|
+
if (signal.aborted)
|
|
15857
|
+
return Promise.resolve();
|
|
15858
|
+
return new Promise((resolve) => {
|
|
15859
|
+
const wake = () => {
|
|
15860
|
+
clearTimeout(timer);
|
|
15861
|
+
signal.removeEventListener("abort", wake);
|
|
15862
|
+
resolve();
|
|
15863
|
+
};
|
|
15864
|
+
const timer = setTimeout(wake, ms);
|
|
15865
|
+
timer.unref?.();
|
|
15866
|
+
signal.addEventListener("abort", wake, { once: true });
|
|
15867
|
+
});
|
|
15868
|
+
}
|
|
15819
15869
|
|
|
15820
15870
|
// ../../bridges/codex-bridge/src/app-server/approvals.ts
|
|
15821
15871
|
var MAX_APPROVAL_AMENDMENTS = 16;
|
|
@@ -18153,6 +18203,11 @@ function codexProjectTrustConfig(policy, cwd) {
|
|
|
18153
18203
|
projects: Object.fromEntries([...roots].map((root) => [root, { trust_level: "untrusted" }]))
|
|
18154
18204
|
};
|
|
18155
18205
|
}
|
|
18206
|
+
function codexRequestUserInputConfig(policy) {
|
|
18207
|
+
if (!policy || policy.id === "pipeline")
|
|
18208
|
+
return {};
|
|
18209
|
+
return { "features.default_mode_request_user_input": true };
|
|
18210
|
+
}
|
|
18156
18211
|
var MAX_CODEX_DISABLED_SKILLS = 1024;
|
|
18157
18212
|
var KEPT_SKILL_SCOPES = new Set(["user", "system", "admin"]);
|
|
18158
18213
|
function codexProjectSkillsConfig(listed) {
|
|
@@ -19344,6 +19399,7 @@ class AppServerEngine {
|
|
|
19344
19399
|
const threadConfig = {
|
|
19345
19400
|
...codexNetworkDeniedConfig(config.policy),
|
|
19346
19401
|
...codexProjectTrustConfig(config.policy, cwd),
|
|
19402
|
+
...codexRequestUserInputConfig(config.policy),
|
|
19347
19403
|
...extraConfig,
|
|
19348
19404
|
...config.agentMcp ? {
|
|
19349
19405
|
...config.agentMcp.design ? {
|
|
@@ -19380,7 +19436,6 @@ class AppServerEngine {
|
|
|
19380
19436
|
sandbox: config.sandbox ?? (config.mode === "plan" ? "read-only" : "danger-full-access")
|
|
19381
19437
|
},
|
|
19382
19438
|
...config.model ? { model: config.model } : {},
|
|
19383
|
-
...config.personality ? { personality: config.personality } : {},
|
|
19384
19439
|
serviceTier: config.serviceTier ?? null,
|
|
19385
19440
|
...Object.keys(threadConfig).length > 0 ? { config: threadConfig } : {}
|
|
19386
19441
|
};
|
|
@@ -19913,8 +19968,6 @@ class AppServerEngine {
|
|
|
19913
19968
|
...options.config.model ? { model: options.config.model } : {},
|
|
19914
19969
|
...options.config.serviceTier !== undefined ? { serviceTier: options.config.serviceTier } : {},
|
|
19915
19970
|
...options.config.reasoningEffort ? { effort: options.config.reasoningEffort } : {},
|
|
19916
|
-
...options.config.reasoningSummary ? { summary: options.config.reasoningSummary } : {},
|
|
19917
|
-
...options.config.personality ? { personality: options.config.personality } : {},
|
|
19918
19971
|
...options.config.permissionProfile ? {} : { sandboxPolicy: toSandboxPolicy(options.config) }
|
|
19919
19972
|
};
|
|
19920
19973
|
const { result, generation } = await this.supervisor.requestWithGeneration("turn/start", params);
|
|
@@ -24626,9 +24679,6 @@ class CodexRuntimeLifecycle {
|
|
|
24626
24679
|
const policy = coordinatorReadOnly ? codexCoordinatorPolicy() : requestedPolicy;
|
|
24627
24680
|
const model = typeof body.model === "string" && body.model.trim().length > 0 ? body.model.trim() : undefined;
|
|
24628
24681
|
const reasoningEffort = typeof body.modelReasoningEffort === "string" ? body.modelReasoningEffort : undefined;
|
|
24629
|
-
const rawParameters = body.parameterValues && typeof body.parameterValues === "object" && !Array.isArray(body.parameterValues) ? body.parameterValues : {};
|
|
24630
|
-
const reasoningSummary = ["auto", "concise", "detailed", "none"].includes(String(rawParameters.summary ?? "")) ? rawParameters.summary : undefined;
|
|
24631
|
-
const personality = ["none", "friendly", "pragmatic"].includes(String(rawParameters.personality ?? "")) ? rawParameters.personality : undefined;
|
|
24632
24682
|
const rawAgentMcp = body.agentMcp;
|
|
24633
24683
|
let agentMcp;
|
|
24634
24684
|
if (rawAgentMcp && typeof rawAgentMcp === "object" && !Array.isArray(rawAgentMcp)) {
|
|
@@ -24652,8 +24702,6 @@ class CodexRuntimeLifecycle {
|
|
|
24652
24702
|
mode,
|
|
24653
24703
|
model,
|
|
24654
24704
|
reasoningEffort,
|
|
24655
|
-
reasoningSummary,
|
|
24656
|
-
personality,
|
|
24657
24705
|
serviceTier: body.fastMode === true ? "fast" : null,
|
|
24658
24706
|
cwd: this.ctx.options.cwd,
|
|
24659
24707
|
approvalPolicy: policy?.approvals === "ask" ? "on-request" : policy?.approvals === "deny" ? "never" : "never",
|
|
@@ -27678,7 +27726,7 @@ app.get("/session/:id/mcp", async (c) => {
|
|
|
27678
27726
|
...typeof server.pluginId === "string" ? { scope: "plugin" } : {},
|
|
27679
27727
|
toolCount: tools.length,
|
|
27680
27728
|
tools,
|
|
27681
|
-
...typeof server.error === "string" ? { error: server.error.slice(0, 1000) } : typeof server.toolsError === "string" ? { error: server.toolsError.slice(0, 1000) } : {},
|
|
27729
|
+
...typeof server.error === "string" ? { error: redactSecrets(server.error).slice(0, 1000) } : typeof server.toolsError === "string" ? { error: redactSecrets(server.toolsError).slice(0, 1000) } : {},
|
|
27682
27730
|
actions: status === "needs-auth" ? ["sign-in"] : ["reconnect"]
|
|
27683
27731
|
}
|
|
27684
27732
|
];
|