orkestrator 2.37.0-alpha → 2.37.3-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/dist/client.js +5803 -200
- package/dist/main.js +75526 -64086
- package/package.json +3 -3
- package/resources/acp-bridge/dist/index.js +123 -25
- package/resources/claude-bridge/dist/index.js +96 -16
- package/resources/codex-bridge/dist/index.js +140 -19
- package/resources/cursor-bridge/dist/index.js +38 -2
- package/resources/cursor-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/dist/index.js +108 -17
- package/resources/pi-bridge/runtime/bun.lock +13 -13
- package/resources/pi-bridge/runtime/install.json +1 -1
- package/resources/release-runtime/bun.lock +2 -2
|
@@ -1150,6 +1150,7 @@ var BACKEND_LOG_AREAS = defineLogAreas({
|
|
|
1150
1150
|
"instance.republish-failed": "The instance descriptor could not be republished; a later pass retries.",
|
|
1151
1151
|
"parent.exited": "The parent process exited, so local servers are shutting down.",
|
|
1152
1152
|
"startup.step-failed": "One part of startup failed and the backend carried on; `step` says which.",
|
|
1153
|
+
"startup.failed": "Startup failed; the backend released what it had started and exits with code 1.",
|
|
1153
1154
|
"startup.setup-fence-failed": "An environment's interrupted setup could not be fenced.",
|
|
1154
1155
|
"startup.setup-adopt-failed": "An environment's pending setup could not be adopted.",
|
|
1155
1156
|
"startup.deletion-pending": "An interrupted environment deletion stays pending. Its owning step logged the detail.",
|
|
@@ -1314,6 +1315,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
1314
1315
|
"app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
|
|
1315
1316
|
"app-server.stderr": "Metadata of an app-server stderr line, never its content.",
|
|
1316
1317
|
"app-server.stderr-suppressed": "app-server stderr lines beyond the budget were counted, not described.",
|
|
1318
|
+
"app-server.termination-unconfirmed": "app-server did not report an exit after SIGKILL; the restart or shutdown went on without it.",
|
|
1317
1319
|
"approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
|
|
1318
1320
|
"approval.present-failed": "Presenting an approval threw; it is auto-declined.",
|
|
1319
1321
|
"approval.resolved-callback-failed": "An approval resolved callback threw.",
|
|
@@ -1599,6 +1601,9 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
|
1599
1601
|
"setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
|
|
1600
1602
|
"setup.tab-publish-failed": "The setup terminal's tab could not be published.",
|
|
1601
1603
|
"lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
|
|
1604
|
+
"git-https-probe.failed": "Checking whether a project's GitHub remote works over HTTPS failed; `reason` says why.",
|
|
1605
|
+
"git-https-remedy.failed": "Deciding whether to offer HTTPS after an SSH failure threw; no remedy is offered.",
|
|
1606
|
+
"git-origin.switched-to-https": "A project's origin remote was switched from GitHub SSH to HTTPS at the user's request.",
|
|
1602
1607
|
"tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
|
|
1603
1608
|
"tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
|
|
1604
1609
|
"orphan-session.reaped": "A native session no tab references was torn down.",
|
|
@@ -1871,7 +1876,34 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
|
|
|
1871
1876
|
"monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
|
|
1872
1877
|
"worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
|
|
1873
1878
|
"request.failed": "Handling a request event failed, so the stream restarts. Error class only.",
|
|
1874
|
-
"credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why."
|
|
1879
|
+
"credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why.",
|
|
1880
|
+
"host-database.separated": "Host OpenCode uses Orkestrator's own database because the shared one has no `session` table (an OpenCode 2 database); `reason` says why.",
|
|
1881
|
+
"host-database.unreadable": "The shared OpenCode database could not be inspected, so host OpenCode opens it as usual. Error class only.",
|
|
1882
|
+
"login.opencode2-mirror-failed": "A provider sign-in change reached OpenCode 1 but could not be copied into the OpenCode 2 database; the user is told to retry. Error class only."
|
|
1883
|
+
}
|
|
1884
|
+
},
|
|
1885
|
+
"native-agent.opencode2": {
|
|
1886
|
+
description: "The OpenCode 2.x provider: its event monitor, steering, routing, host and container servers.",
|
|
1887
|
+
events: {
|
|
1888
|
+
"events.dropped": "The 2.x event stream ended or failed, so reads go to the server until it reconnects. Error class only.",
|
|
1889
|
+
"steer.unconfirmed": "A 2.x steer got no definite answer, so its delivery is reconciled from history. Error class only.",
|
|
1890
|
+
"provider.dispose-failed": "Disposing the 2.x provider of a replaced server failed. Error class only.",
|
|
1891
|
+
"transcript.unknown-row": "A 2.x history row of a kind the transcript does not know was dropped (a newer server). Its kind name only, once per kind.",
|
|
1892
|
+
"mcp.remove-failed": "Removing a closed session's Orkestrator MCP server from the 2.x server failed. Error class only.",
|
|
1893
|
+
"protocol.select-failed": "A workflow could not read the OpenCode line setting, so its new session takes 1.x. Error class only.",
|
|
1894
|
+
"host-server.ready": "A local environment's (or a coordinator conversation's) 2.x server answered `/api/info` as 2.x. Environment id, pid and whether it is a coordinator's only.",
|
|
1895
|
+
"coordinator-research.unavailable": "A coordinator's 2.x server could not register its research servers, so the conversation runs without them until the server restarts. Error class only.",
|
|
1896
|
+
"host-server.terminate-failed": "A 2.x server that did not become ready could not be stopped; its process entry is kept for shutdown. Error class only.",
|
|
1897
|
+
"container-server.launched": "The start script of a container environment's 2.x server was run. Container port only.",
|
|
1898
|
+
"container-server.ready": "A container environment's 2.x server this backend started answered `/api/info` as 2.x. Environment id only.",
|
|
1899
|
+
"container-server.warm-incomplete": "The first workspace request to a container's new 2.x server failed, so its plugins load on the next one. Error class only.",
|
|
1900
|
+
"resume-list.unavailable": "The 2.x sessions could not be listed for the resume picker, so it shows the 1.x list alone. Error class only.",
|
|
1901
|
+
"credential.mirrored": "A provider sign-in change was copied into the 2.x database. `outcome` (written, removed, unchanged, skipped) only; never a provider id or value.",
|
|
1902
|
+
"credential.server-exit-unclean": "The private 2.x server started to copy a sign-in did not stop cleanly. Error class only.",
|
|
1903
|
+
"user-config.mirror-failed": "The user's global OpenCode configuration could not be mirrored for a host 2.x server, which starts without it. Error class only.",
|
|
1904
|
+
"user-config.unreadable": "A file of the user's OpenCode configuration could not be read for the 2.x mirror. `source`, the file's name and the error code only.",
|
|
1905
|
+
"user-config.rejected": "Files of the user's OpenCode configuration are not a JSONC object, so the 2.x mirror leaves them out. `source` and file names only, never contents.",
|
|
1906
|
+
"user-config.plugins-withheld": "The user's OpenCode configuration lists plugins, which the 2.x mirror leaves out (1.x plugins do not run on 2.x). `source` only."
|
|
1875
1907
|
}
|
|
1876
1908
|
}
|
|
1877
1909
|
});
|
|
@@ -2829,6 +2861,7 @@ var WEB_BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
|
2829
2861
|
"transcript.load-failed": "A stage transcript read failed and will retry with backoff.",
|
|
2830
2862
|
"legacy.state-too-large": "Legacy pipeline state was over the limit and skipped.",
|
|
2831
2863
|
"opencode-catalog.load-failed": "The cached OpenCode model list could not be loaded.",
|
|
2864
|
+
"model-catalog.hydrate-failed": "A node's cached model lists could not be loaded for a launcher.",
|
|
2832
2865
|
"opencode-preferences.load-failed": "OpenCode model preferences could not be loaded."
|
|
2833
2866
|
}
|
|
2834
2867
|
}
|
|
@@ -8517,7 +8550,8 @@ var SHARED_RULES = [
|
|
|
8517
8550
|
["auth-failed", /terminal prompts disabled|invalid username or password|bad credentials/i],
|
|
8518
8551
|
["auth-failed", /permission denied \(|permission to \S+ denied|host key verification failed/i],
|
|
8519
8552
|
["auth-failed", /gh auth login|not logged in|unauthorized|http 401|returned error: 40[13]/i],
|
|
8520
|
-
["network-failed", /could not resolve host|connection
|
|
8553
|
+
["network-failed", /could not resolve host|(?:connection|operation) timed out/i],
|
|
8554
|
+
["network-failed", /connection (?:refused|reset)/i],
|
|
8521
8555
|
["network-failed", /network is unreachable|no route to host|temporary failure in name/i],
|
|
8522
8556
|
["network-failed", /early eof|failed to connect|remote end hung up/i],
|
|
8523
8557
|
["network-failed", /unable to access ['"]?https?:\/\//i],
|
|
@@ -9746,6 +9780,7 @@ function parseNumstatZ(output) {
|
|
|
9746
9780
|
var WORKFLOW_RESULT_MAX_BYTES = 384 * 1024;
|
|
9747
9781
|
var WORKFLOW_RESULT_MAX_PENDING_BYTES = 8 * 1024 * 1024;
|
|
9748
9782
|
var WORKFLOW_RESULT_KINDS = [
|
|
9783
|
+
"auto-pipeline-draft",
|
|
9749
9784
|
"feature-plan-state",
|
|
9750
9785
|
"story-refinement",
|
|
9751
9786
|
"validation-plan",
|
|
@@ -9761,6 +9796,7 @@ var WORKFLOW_RESULT_KINDS = [
|
|
|
9761
9796
|
"graph-template"
|
|
9762
9797
|
];
|
|
9763
9798
|
var WORKFLOW_RESULT_TOOL_NAMES = {
|
|
9799
|
+
"auto-pipeline-draft": "submit_auto_pipeline_draft",
|
|
9764
9800
|
"feature-plan-state": "submit_feature_plan_state",
|
|
9765
9801
|
"story-refinement": "submit_story_refinement",
|
|
9766
9802
|
"validation-plan": "submit_validation_plan",
|
|
@@ -17737,12 +17773,13 @@ function rolloutCommandExecutionParts(item) {
|
|
|
17737
17773
|
});
|
|
17738
17774
|
return adapted?.type === "command_execution" ? commandExecutionParts(adapted) : null;
|
|
17739
17775
|
}
|
|
17740
|
-
|
|
17741
17776
|
// ../protocol/src/coordinator.ts
|
|
17742
17777
|
var COORDINATOR_CODEX_USER_SKILLS_DIR_ENV = "ORKESTRATOR_COORDINATOR_CODEX_USER_SKILLS_DIR";
|
|
17743
17778
|
var COORDINATOR_OTHER_ENVIRONMENTS_SETTING_LABEL = "Let the coordinator use environments it did not create";
|
|
17744
17779
|
var COORDINATOR_ENVIRONMENT_ORIGIN_REFUSAL = `Not done: this coordinator did not create that environment, so it may not send it work. Do not retry. Use an environment this coordinator launched, or start a new one. If the user wants this coordinator to work in environments it did not create, tell them to turn on "${COORDINATOR_OTHER_ENVIRONMENTS_SETTING_LABEL}" in this project's settings, under Coordinator.`;
|
|
17745
17780
|
var COORDINATOR_CONTROL_TOOL_NAMES = Object.freeze([
|
|
17781
|
+
"mark_topic",
|
|
17782
|
+
"mark_question",
|
|
17746
17783
|
"ack_message",
|
|
17747
17784
|
"add_ticket_comment",
|
|
17748
17785
|
"address_multi_review",
|
|
@@ -21432,6 +21469,7 @@ var DEFAULT_CIRCUIT_WINDOW_MS = 60000;
|
|
|
21432
21469
|
var DEFAULT_CIRCUIT_COOLDOWN_MS = 5 * 60000;
|
|
21433
21470
|
var DEFAULT_CIRCUIT_MAX_COOLDOWN_MS = 30 * 60000;
|
|
21434
21471
|
var DEFAULT_SHUTDOWN_GRACE_MS = 5000;
|
|
21472
|
+
var DEFAULT_KILL_CONFIRM_MS = 1000;
|
|
21435
21473
|
var INCOMPLETE_PIDFILE_GRACE_MS = 1000;
|
|
21436
21474
|
var PID_OWNERSHIP_TTL_MS = 24 * 60 * 60 * 1000;
|
|
21437
21475
|
var PID_ACQUISITION_MAX_ATTEMPTS = 5;
|
|
@@ -21448,6 +21486,7 @@ class AppServerSupervisor {
|
|
|
21448
21486
|
circuitCooldownMs;
|
|
21449
21487
|
circuitMaxCooldownMs;
|
|
21450
21488
|
shutdownGraceMs;
|
|
21489
|
+
killConfirmMs;
|
|
21451
21490
|
fingerprintEnvironment;
|
|
21452
21491
|
notificationQueue;
|
|
21453
21492
|
state = "stopped";
|
|
@@ -21468,7 +21507,9 @@ class AppServerSupervisor {
|
|
|
21468
21507
|
stopping = false;
|
|
21469
21508
|
unknownNotifications = 0;
|
|
21470
21509
|
unknownServerRequests = 0;
|
|
21510
|
+
unconfirmedTerminations = 0;
|
|
21471
21511
|
drainPromise = null;
|
|
21512
|
+
terminating = null;
|
|
21472
21513
|
pidOwnerToken = randomUUID7();
|
|
21473
21514
|
pidOwnershipHeld = false;
|
|
21474
21515
|
constructor(options) {
|
|
@@ -21481,6 +21522,7 @@ class AppServerSupervisor {
|
|
|
21481
21522
|
this.circuitMaxCooldownMs = Math.max(this.circuitCooldownMs, options.circuitMaxCooldownMs ?? DEFAULT_CIRCUIT_MAX_COOLDOWN_MS);
|
|
21482
21523
|
this.nextCircuitCooldownMs = this.circuitCooldownMs;
|
|
21483
21524
|
this.shutdownGraceMs = options.shutdownGraceMs ?? DEFAULT_SHUTDOWN_GRACE_MS;
|
|
21525
|
+
this.killConfirmMs = Math.max(0, options.killConfirmMs ?? DEFAULT_KILL_CONFIRM_MS);
|
|
21484
21526
|
this.fingerprintEnvironment = options.fingerprintEnvironment ?? fingerprintRuntimeEnvironment;
|
|
21485
21527
|
this.notificationQueue = new SerialQueue({
|
|
21486
21528
|
maxDepth: options.notificationQueueMaxDepth,
|
|
@@ -21514,7 +21556,8 @@ class AppServerSupervisor {
|
|
|
21514
21556
|
notificationQueueDepth: this.notificationQueue.pendingDepth,
|
|
21515
21557
|
notificationQueueHighWaterMark: this.notificationQueue.highWaterMark,
|
|
21516
21558
|
unknownNotifications: this.unknownNotifications,
|
|
21517
|
-
unknownServerRequests: this.unknownServerRequests
|
|
21559
|
+
unknownServerRequests: this.unknownServerRequests,
|
|
21560
|
+
unconfirmedTerminations: this.unconfirmedTerminations
|
|
21518
21561
|
};
|
|
21519
21562
|
}
|
|
21520
21563
|
recordUnknownNotification() {
|
|
@@ -21539,6 +21582,10 @@ class AppServerSupervisor {
|
|
|
21539
21582
|
throw new AppServerUnavailableError("stopped");
|
|
21540
21583
|
if (this.startPromise)
|
|
21541
21584
|
return this.startPromise;
|
|
21585
|
+
if (this.terminating) {
|
|
21586
|
+
await this.terminating;
|
|
21587
|
+
return this.ensureStarted();
|
|
21588
|
+
}
|
|
21542
21589
|
if (this.circuitOpen && this.now() < this.circuitProbeAt) {
|
|
21543
21590
|
throw new AppServerCircuitOpenError(this.restartFailures.length, this.lastError);
|
|
21544
21591
|
}
|
|
@@ -21879,11 +21926,23 @@ class AppServerSupervisor {
|
|
|
21879
21926
|
const previous = this.current;
|
|
21880
21927
|
this.current = null;
|
|
21881
21928
|
if (previous) {
|
|
21882
|
-
|
|
21883
|
-
|
|
21884
|
-
|
|
21885
|
-
|
|
21886
|
-
|
|
21929
|
+
const retire = (async () => {
|
|
21930
|
+
previous.client.close(new AppServerProcessExitError(`app-server restarting: ${reason}`, {
|
|
21931
|
+
generation: previous.id
|
|
21932
|
+
}));
|
|
21933
|
+
await previous.recorder?.close();
|
|
21934
|
+
await this.terminateChild(previous.child);
|
|
21935
|
+
})();
|
|
21936
|
+
const terminating = retire.catch(() => {
|
|
21937
|
+
return;
|
|
21938
|
+
});
|
|
21939
|
+
this.terminating = terminating;
|
|
21940
|
+
try {
|
|
21941
|
+
await retire;
|
|
21942
|
+
} finally {
|
|
21943
|
+
if (this.terminating === terminating)
|
|
21944
|
+
this.terminating = null;
|
|
21945
|
+
}
|
|
21887
21946
|
}
|
|
21888
21947
|
if (this.stopping)
|
|
21889
21948
|
return;
|
|
@@ -21903,6 +21962,8 @@ class AppServerSupervisor {
|
|
|
21903
21962
|
});
|
|
21904
21963
|
const generation = this.current;
|
|
21905
21964
|
this.current = null;
|
|
21965
|
+
if (this.terminating)
|
|
21966
|
+
await this.terminating;
|
|
21906
21967
|
if (generation) {
|
|
21907
21968
|
generation.client.close(new AppServerProcessExitError("bridge shutting down", {
|
|
21908
21969
|
generation: generation.id
|
|
@@ -21934,7 +21995,17 @@ class AppServerSupervisor {
|
|
|
21934
21995
|
]);
|
|
21935
21996
|
if (timedOut) {
|
|
21936
21997
|
this.signalProcessTree(child, "SIGKILL");
|
|
21937
|
-
await Promise.race([
|
|
21998
|
+
const confirmed = await Promise.race([
|
|
21999
|
+
exited.then(() => true),
|
|
22000
|
+
sleep(this.killConfirmMs).then(() => false)
|
|
22001
|
+
]);
|
|
22002
|
+
if (!confirmed) {
|
|
22003
|
+
this.unconfirmedTerminations += 1;
|
|
22004
|
+
log10.warn("app-server.termination-unconfirmed", {
|
|
22005
|
+
pid: child.pid,
|
|
22006
|
+
waitedMs: this.shutdownGraceMs + this.killConfirmMs
|
|
22007
|
+
});
|
|
22008
|
+
}
|
|
21938
22009
|
}
|
|
21939
22010
|
}
|
|
21940
22011
|
signalProcessTree(child, signal) {
|
|
@@ -24988,6 +25059,7 @@ async function waitForMcpToolAvailability(list, serverName, toolName, options =
|
|
|
24988
25059
|
list(remainingMs),
|
|
24989
25060
|
new Promise((resolve) => {
|
|
24990
25061
|
timer = setTimeout(() => resolve(expired), remainingMs);
|
|
25062
|
+
timer.unref?.();
|
|
24991
25063
|
})
|
|
24992
25064
|
]);
|
|
24993
25065
|
} catch {
|
|
@@ -25000,7 +25072,9 @@ async function waitForMcpToolAvailability(list, serverName, toolName, options =
|
|
|
25000
25072
|
const availability = classifyMcpToolAvailability(response, serverName, toolName);
|
|
25001
25073
|
if (availability)
|
|
25002
25074
|
return availability;
|
|
25003
|
-
await new Promise((resolve) =>
|
|
25075
|
+
await new Promise((resolve) => {
|
|
25076
|
+
setTimeout(resolve, Math.min(pollMs, deadline - now())).unref?.();
|
|
25077
|
+
});
|
|
25004
25078
|
}
|
|
25005
25079
|
}
|
|
25006
25080
|
|
|
@@ -29978,6 +30052,8 @@ class CodexRuntimeContext {
|
|
|
29978
30052
|
now;
|
|
29979
30053
|
started = false;
|
|
29980
30054
|
startPromise = null;
|
|
30055
|
+
sessionRestore = "not-started";
|
|
30056
|
+
sessionsRestored = Promise.withResolvers();
|
|
29981
30057
|
stopping = false;
|
|
29982
30058
|
sweepTimer = null;
|
|
29983
30059
|
detachedThreads = 0;
|
|
@@ -30536,6 +30612,11 @@ class CodexRuntimeLifecycle {
|
|
|
30536
30612
|
async start() {
|
|
30537
30613
|
if (this.ctx.started)
|
|
30538
30614
|
return;
|
|
30615
|
+
if (this.ctx.sessionRestore === "failed") {
|
|
30616
|
+
this.ctx.sessionsRestored = Promise.withResolvers();
|
|
30617
|
+
}
|
|
30618
|
+
if (this.ctx.sessionRestore !== "restored")
|
|
30619
|
+
this.ctx.sessionRestore = "restoring";
|
|
30539
30620
|
if (this.ctx.startPromise)
|
|
30540
30621
|
return this.ctx.startPromise;
|
|
30541
30622
|
const startPromise = this.startOnce();
|
|
@@ -30543,6 +30624,12 @@ class CodexRuntimeLifecycle {
|
|
|
30543
30624
|
try {
|
|
30544
30625
|
await startPromise;
|
|
30545
30626
|
this.ctx.started = true;
|
|
30627
|
+
} catch (error) {
|
|
30628
|
+
if (this.ctx.sessionRestore === "restoring") {
|
|
30629
|
+
this.ctx.sessionRestore = "failed";
|
|
30630
|
+
this.ctx.sessionsRestored.resolve(false);
|
|
30631
|
+
}
|
|
30632
|
+
throw error;
|
|
30546
30633
|
} finally {
|
|
30547
30634
|
if (this.ctx.startPromise === startPromise)
|
|
30548
30635
|
this.ctx.startPromise = null;
|
|
@@ -30582,6 +30669,8 @@ class CodexRuntimeLifecycle {
|
|
|
30582
30669
|
if (record.threadId)
|
|
30583
30670
|
this.ctx.threadsAwaitingDispatchRecovery.add(record.threadId);
|
|
30584
30671
|
}
|
|
30672
|
+
this.ctx.sessionRestore = "restored";
|
|
30673
|
+
this.ctx.sessionsRestored.resolve(true);
|
|
30585
30674
|
try {
|
|
30586
30675
|
await this.ctx.options.engine.start();
|
|
30587
30676
|
await this.ctx.generationRecovery;
|
|
@@ -30602,6 +30691,22 @@ class CodexRuntimeLifecycle {
|
|
|
30602
30691
|
this.ctx.sweepTimer.unref?.();
|
|
30603
30692
|
}
|
|
30604
30693
|
}
|
|
30694
|
+
async whenSessionsRestored(timeoutMs) {
|
|
30695
|
+
if (this.ctx.sessionRestore === "failed")
|
|
30696
|
+
return false;
|
|
30697
|
+
if (this.ctx.sessionRestore !== "restoring")
|
|
30698
|
+
return true;
|
|
30699
|
+
let timer;
|
|
30700
|
+
const timedOut = new Promise((resolve) => {
|
|
30701
|
+
timer = setTimeout(() => resolve(false), timeoutMs);
|
|
30702
|
+
timer.unref?.();
|
|
30703
|
+
});
|
|
30704
|
+
try {
|
|
30705
|
+
return await Promise.race([this.ctx.sessionsRestored.promise, timedOut]);
|
|
30706
|
+
} finally {
|
|
30707
|
+
clearTimeout(timer);
|
|
30708
|
+
}
|
|
30709
|
+
}
|
|
30605
30710
|
async stop() {
|
|
30606
30711
|
this.ctx.stopping = true;
|
|
30607
30712
|
for (const state of this.ctx.threadState.values())
|
|
@@ -33481,6 +33586,9 @@ class AppServerRuntime {
|
|
|
33481
33586
|
start(...args) {
|
|
33482
33587
|
return this.lifecycle.start(...args);
|
|
33483
33588
|
}
|
|
33589
|
+
whenSessionsRestored(...args) {
|
|
33590
|
+
return this.lifecycle.whenSessionsRestored(...args);
|
|
33591
|
+
}
|
|
33484
33592
|
stop(...args) {
|
|
33485
33593
|
return this.lifecycle.stop(...args);
|
|
33486
33594
|
}
|
|
@@ -34023,16 +34131,16 @@ function logUnhandledRejection(reason) {
|
|
|
34023
34131
|
// ../protocol/src/codex-model-catalog.ts
|
|
34024
34132
|
var CODEX_FALLBACK_MODEL_CATALOG = [
|
|
34025
34133
|
{
|
|
34026
|
-
id: "gpt-
|
|
34027
|
-
name: "
|
|
34028
|
-
description: "Latest
|
|
34134
|
+
id: "gpt-6.1-sol",
|
|
34135
|
+
name: "GPT-6.1-Sol",
|
|
34136
|
+
description: "Latest workhorse model for coding and everyday work.",
|
|
34029
34137
|
reasoningEfforts: ["low", "medium", "high", "xhigh"],
|
|
34030
34138
|
defaultReasoningEffort: "high"
|
|
34031
34139
|
},
|
|
34032
34140
|
{
|
|
34033
|
-
id: "gpt-
|
|
34034
|
-
name: "GPT-
|
|
34035
|
-
description: "
|
|
34141
|
+
id: "gpt-6-luna",
|
|
34142
|
+
name: "GPT-6-Luna",
|
|
34143
|
+
description: "Fast and affordable model for easier tasks.",
|
|
34036
34144
|
reasoningEfforts: ["low", "medium", "high", "xhigh"],
|
|
34037
34145
|
defaultReasoningEffort: "high"
|
|
34038
34146
|
}
|
|
@@ -34678,6 +34786,7 @@ var __testing = {
|
|
|
34678
34786
|
sseRouteTestHooks = hooks;
|
|
34679
34787
|
},
|
|
34680
34788
|
startBridgeServerForTesting: startBridgeServer,
|
|
34789
|
+
startBridgeForTesting: startBridge,
|
|
34681
34790
|
startSelectedEngineForTesting: startSelectedEngine,
|
|
34682
34791
|
stopSelectedEngineForTesting: stopSelectedEngine,
|
|
34683
34792
|
startSseKeepaliveForTesting: startSseKeepalive,
|
|
@@ -34779,6 +34888,15 @@ app.use("*", async (c, next) => {
|
|
|
34779
34888
|
}
|
|
34780
34889
|
await next();
|
|
34781
34890
|
});
|
|
34891
|
+
var SESSION_RESTORE_WAIT_MS = 1e4;
|
|
34892
|
+
var awaitRestoredSessions = async (c, next) => {
|
|
34893
|
+
if (!await appServerRuntime.whenSessionsRestored(SESSION_RESTORE_WAIT_MS)) {
|
|
34894
|
+
return c.json({ error: "The Codex bridge is still restoring its sessions" }, 503);
|
|
34895
|
+
}
|
|
34896
|
+
await next();
|
|
34897
|
+
};
|
|
34898
|
+
app.use("/session/*", awaitRestoredSessions);
|
|
34899
|
+
app.use("/sessions/*", awaitRestoredSessions);
|
|
34782
34900
|
app.use("/session/:id/messages", async (c, next) => {
|
|
34783
34901
|
await next();
|
|
34784
34902
|
c.res.headers.append("Vary", "Accept-Encoding");
|
|
@@ -35514,6 +35632,10 @@ function startBridgeServer(env = process.env, start = serve) {
|
|
|
35514
35632
|
hostname: env.HOSTNAME || "0.0.0.0"
|
|
35515
35633
|
});
|
|
35516
35634
|
}
|
|
35635
|
+
function startBridge(env = process.env, listen = serve, runtime = appServerRuntime) {
|
|
35636
|
+
startSelectedEngine(env, runtime);
|
|
35637
|
+
return startBridgeServer(env, listen);
|
|
35638
|
+
}
|
|
35517
35639
|
var shutdownHandler = createShutdownHandler(cleanupTimer);
|
|
35518
35640
|
for (const signal of ["SIGTERM", "SIGINT"]) {
|
|
35519
35641
|
process.on(signal, shutdownHandler);
|
|
@@ -35530,8 +35652,7 @@ if (parentPid !== null) {
|
|
|
35530
35652
|
}
|
|
35531
35653
|
});
|
|
35532
35654
|
}
|
|
35533
|
-
|
|
35534
|
-
startSelectedEngine();
|
|
35655
|
+
startBridge();
|
|
35535
35656
|
export {
|
|
35536
35657
|
MAX_CODEX_TRANSCRIPT_RESPONSE_BYTES,
|
|
35537
35658
|
MAX_REPLAY_SSE_BYTES,
|
|
@@ -328,6 +328,7 @@ var BACKEND_LOG_AREAS = defineLogAreas({
|
|
|
328
328
|
"instance.republish-failed": "The instance descriptor could not be republished; a later pass retries.",
|
|
329
329
|
"parent.exited": "The parent process exited, so local servers are shutting down.",
|
|
330
330
|
"startup.step-failed": "One part of startup failed and the backend carried on; `step` says which.",
|
|
331
|
+
"startup.failed": "Startup failed; the backend released what it had started and exits with code 1.",
|
|
331
332
|
"startup.setup-fence-failed": "An environment's interrupted setup could not be fenced.",
|
|
332
333
|
"startup.setup-adopt-failed": "An environment's pending setup could not be adopted.",
|
|
333
334
|
"startup.deletion-pending": "An interrupted environment deletion stays pending. Its owning step logged the detail.",
|
|
@@ -492,6 +493,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
|
492
493
|
"app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
|
|
493
494
|
"app-server.stderr": "Metadata of an app-server stderr line, never its content.",
|
|
494
495
|
"app-server.stderr-suppressed": "app-server stderr lines beyond the budget were counted, not described.",
|
|
496
|
+
"app-server.termination-unconfirmed": "app-server did not report an exit after SIGKILL; the restart or shutdown went on without it.",
|
|
495
497
|
"approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
|
|
496
498
|
"approval.present-failed": "Presenting an approval threw; it is auto-declined.",
|
|
497
499
|
"approval.resolved-callback-failed": "An approval resolved callback threw.",
|
|
@@ -777,6 +779,9 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
|
777
779
|
"setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
|
|
778
780
|
"setup.tab-publish-failed": "The setup terminal's tab could not be published.",
|
|
779
781
|
"lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
|
|
782
|
+
"git-https-probe.failed": "Checking whether a project's GitHub remote works over HTTPS failed; `reason` says why.",
|
|
783
|
+
"git-https-remedy.failed": "Deciding whether to offer HTTPS after an SSH failure threw; no remedy is offered.",
|
|
784
|
+
"git-origin.switched-to-https": "A project's origin remote was switched from GitHub SSH to HTTPS at the user's request.",
|
|
780
785
|
"tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
|
|
781
786
|
"tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
|
|
782
787
|
"orphan-session.reaped": "A native session no tab references was torn down.",
|
|
@@ -1049,7 +1054,34 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
|
|
|
1049
1054
|
"monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
|
|
1050
1055
|
"worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
|
|
1051
1056
|
"request.failed": "Handling a request event failed, so the stream restarts. Error class only.",
|
|
1052
|
-
"credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why."
|
|
1057
|
+
"credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why.",
|
|
1058
|
+
"host-database.separated": "Host OpenCode uses Orkestrator's own database because the shared one has no `session` table (an OpenCode 2 database); `reason` says why.",
|
|
1059
|
+
"host-database.unreadable": "The shared OpenCode database could not be inspected, so host OpenCode opens it as usual. Error class only.",
|
|
1060
|
+
"login.opencode2-mirror-failed": "A provider sign-in change reached OpenCode 1 but could not be copied into the OpenCode 2 database; the user is told to retry. Error class only."
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
"native-agent.opencode2": {
|
|
1064
|
+
description: "The OpenCode 2.x provider: its event monitor, steering, routing, host and container servers.",
|
|
1065
|
+
events: {
|
|
1066
|
+
"events.dropped": "The 2.x event stream ended or failed, so reads go to the server until it reconnects. Error class only.",
|
|
1067
|
+
"steer.unconfirmed": "A 2.x steer got no definite answer, so its delivery is reconciled from history. Error class only.",
|
|
1068
|
+
"provider.dispose-failed": "Disposing the 2.x provider of a replaced server failed. Error class only.",
|
|
1069
|
+
"transcript.unknown-row": "A 2.x history row of a kind the transcript does not know was dropped (a newer server). Its kind name only, once per kind.",
|
|
1070
|
+
"mcp.remove-failed": "Removing a closed session's Orkestrator MCP server from the 2.x server failed. Error class only.",
|
|
1071
|
+
"protocol.select-failed": "A workflow could not read the OpenCode line setting, so its new session takes 1.x. Error class only.",
|
|
1072
|
+
"host-server.ready": "A local environment's (or a coordinator conversation's) 2.x server answered `/api/info` as 2.x. Environment id, pid and whether it is a coordinator's only.",
|
|
1073
|
+
"coordinator-research.unavailable": "A coordinator's 2.x server could not register its research servers, so the conversation runs without them until the server restarts. Error class only.",
|
|
1074
|
+
"host-server.terminate-failed": "A 2.x server that did not become ready could not be stopped; its process entry is kept for shutdown. Error class only.",
|
|
1075
|
+
"container-server.launched": "The start script of a container environment's 2.x server was run. Container port only.",
|
|
1076
|
+
"container-server.ready": "A container environment's 2.x server this backend started answered `/api/info` as 2.x. Environment id only.",
|
|
1077
|
+
"container-server.warm-incomplete": "The first workspace request to a container's new 2.x server failed, so its plugins load on the next one. Error class only.",
|
|
1078
|
+
"resume-list.unavailable": "The 2.x sessions could not be listed for the resume picker, so it shows the 1.x list alone. Error class only.",
|
|
1079
|
+
"credential.mirrored": "A provider sign-in change was copied into the 2.x database. `outcome` (written, removed, unchanged, skipped) only; never a provider id or value.",
|
|
1080
|
+
"credential.server-exit-unclean": "The private 2.x server started to copy a sign-in did not stop cleanly. Error class only.",
|
|
1081
|
+
"user-config.mirror-failed": "The user's global OpenCode configuration could not be mirrored for a host 2.x server, which starts without it. Error class only.",
|
|
1082
|
+
"user-config.unreadable": "A file of the user's OpenCode configuration could not be read for the 2.x mirror. `source`, the file's name and the error code only.",
|
|
1083
|
+
"user-config.rejected": "Files of the user's OpenCode configuration are not a JSONC object, so the 2.x mirror leaves them out. `source` and file names only, never contents.",
|
|
1084
|
+
"user-config.plugins-withheld": "The user's OpenCode configuration lists plugins, which the 2.x mirror leaves out (1.x plugins do not run on 2.x). `source` only."
|
|
1053
1085
|
}
|
|
1054
1086
|
}
|
|
1055
1087
|
});
|
|
@@ -2007,6 +2039,7 @@ var WEB_BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
|
2007
2039
|
"transcript.load-failed": "A stage transcript read failed and will retry with backoff.",
|
|
2008
2040
|
"legacy.state-too-large": "Legacy pipeline state was over the limit and skipped.",
|
|
2009
2041
|
"opencode-catalog.load-failed": "The cached OpenCode model list could not be loaded.",
|
|
2042
|
+
"model-catalog.hydrate-failed": "A node's cached model lists could not be loaded for a launcher.",
|
|
2010
2043
|
"opencode-preferences.load-failed": "OpenCode model preferences could not be loaded."
|
|
2011
2044
|
}
|
|
2012
2045
|
}
|
|
@@ -29011,6 +29044,7 @@ var ORKESTRATOR_ARTIFACT_MCP_PATH = "/artifact-mcp";
|
|
|
29011
29044
|
var WORKFLOW_RESULT_MAX_BYTES = 384 * 1024;
|
|
29012
29045
|
var WORKFLOW_RESULT_MAX_PENDING_BYTES = 8 * 1024 * 1024;
|
|
29013
29046
|
var WORKFLOW_RESULT_KINDS = [
|
|
29047
|
+
"auto-pipeline-draft",
|
|
29014
29048
|
"feature-plan-state",
|
|
29015
29049
|
"story-refinement",
|
|
29016
29050
|
"validation-plan",
|
|
@@ -29026,6 +29060,7 @@ var WORKFLOW_RESULT_KINDS = [
|
|
|
29026
29060
|
"graph-template"
|
|
29027
29061
|
];
|
|
29028
29062
|
var WORKFLOW_RESULT_TOOL_NAMES = {
|
|
29063
|
+
"auto-pipeline-draft": "submit_auto_pipeline_draft",
|
|
29029
29064
|
"feature-plan-state": "submit_feature_plan_state",
|
|
29030
29065
|
"story-refinement": "submit_story_refinement",
|
|
29031
29066
|
"validation-plan": "submit_validation_plan",
|
|
@@ -36901,7 +36936,8 @@ var SHARED_RULES = [
|
|
|
36901
36936
|
["auth-failed", /terminal prompts disabled|invalid username or password|bad credentials/i],
|
|
36902
36937
|
["auth-failed", /permission denied \(|permission to \S+ denied|host key verification failed/i],
|
|
36903
36938
|
["auth-failed", /gh auth login|not logged in|unauthorized|http 401|returned error: 40[13]/i],
|
|
36904
|
-
["network-failed", /could not resolve host|connection
|
|
36939
|
+
["network-failed", /could not resolve host|(?:connection|operation) timed out/i],
|
|
36940
|
+
["network-failed", /connection (?:refused|reset)/i],
|
|
36905
36941
|
["network-failed", /network is unreachable|no route to host|temporary failure in name/i],
|
|
36906
36942
|
["network-failed", /early eof|failed to connect|remote end hung up/i],
|
|
36907
36943
|
["network-failed", /unable to access ['"]?https?:\/\//i],
|