orkestrator 2.38.1-beta → 2.38.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/README.md CHANGED
@@ -208,17 +208,22 @@ derives that list from the built artifacts, so adding a dependency the bundles d
208
208
  not resolve — or bumping one in `apps/backend` or `bridges/` without mirroring it
209
209
  here — fails the suite.
210
210
 
211
- Publish from the repository root:
211
+ Releases publish this package through the "Publish npm package" GitHub
212
+ workflow, which `mise run release:publish` starts (see
213
+ [releasing.md](../../docs/development/releasing.md#publishing-the-npm-package-from-github)).
214
+ From a workstation, as the fallback:
212
215
 
213
216
  ```bash
214
217
  mise run publish:cli
215
218
  ```
216
219
 
217
- That runs `smoke:cli` first, which packs the tarball, installs it into a scratch
218
- project, checks the unbundled dependencies resolve from the installed layout,
219
- runs client help/version/errors with no backend, starts the backend, drives a
220
- fixture project/environment lifecycle through the installed client, confirms
221
- only one backend ran, and stops it. It needs network access, which is why it is
220
+ Either way, a smoke test runs first: `smoke:cli` locally, and in the workflow
221
+ `smoke-packed.ts --tarball` on the tarball it is about to publish. It packs the
222
+ tarball (unless given one), installs it into a scratch project, checks the
223
+ unbundled dependencies resolve from the installed layout, runs client
224
+ help/version/errors with no backend, starts the backend, drives a fixture
225
+ project/environment lifecycle through the installed client, confirms only one
226
+ backend ran, and stops it. It needs network access, which is why it is
222
227
  a publish gate rather than part of `mise run test`.
223
228
 
224
229
  The npm dist-tag follows the version's update channel: `2.23.0` publishes as
@@ -36,6 +36,7 @@ import path from "node:path";
36
36
 
37
37
  const MAX_BOOT_ATTEMPTS = 2;
38
38
  const READY_TIMEOUT_MS = Number(process.env.ORKESTRATOR_LAUNCHER_READY_TIMEOUT_MS ?? 120_000);
39
+ const READY_POLL_MS = shorterInterval("ORKESTRATOR_LAUNCHER_READY_POLL_MS", 500);
39
40
  const RETRY_DELAY_MS = Number(process.env.ORKESTRATOR_LAUNCHER_RETRY_DELAY_MS ?? 2_000);
40
41
  const CRASH_DELAY_MS = Number(process.env.ORKESTRATOR_LAUNCHER_CRASH_DELAY_MS ?? 5_000);
41
42
  const STOP_TIMEOUT_MS = Number(process.env.ORKESTRATOR_LAUNCHER_STOP_TIMEOUT_MS ?? 10_000);
@@ -60,6 +61,25 @@ function log(message) {
60
61
  console.error(`[launcher] ${new Date().toISOString()} ${message}`);
61
62
  }
62
63
 
64
+ /**
65
+ * A test-only override that can only shorten `fallback`: a positive integer
66
+ * no larger than it. Anything else (empty, not a number, zero, negative,
67
+ * fractional or longer) keeps `fallback` and says so, rather than letting a
68
+ * typo poll every millisecond or stretch the cadence.
69
+ */
70
+ function shorterInterval(name, fallback) {
71
+ const raw = process.env[name];
72
+ if (raw === undefined) return fallback;
73
+ const value = Number(raw);
74
+ if (raw.trim() !== "" && Number.isSafeInteger(value) && value > 0 && value <= fallback) {
75
+ return value;
76
+ }
77
+ log(
78
+ `ignoring ${name}=${JSON.stringify(raw.slice(0, 32))}: it must be a positive integer of at most ${fallback}; using ${fallback} ms`,
79
+ );
80
+ return fallback;
81
+ }
82
+
63
83
  function readJson(file) {
64
84
  try {
65
85
  return JSON.parse(readFileSync(file, "utf8"));
@@ -146,7 +166,7 @@ async function waitForReady(pid, version, exited) {
146
166
  while (Date.now() < deadline && !exited()) {
147
167
  const instance = readJson(layout.instance);
148
168
  if (instance && instance.pid === pid && instance.appVersion === version) return true;
149
- await sleep(500);
169
+ await sleep(READY_POLL_MS);
150
170
  }
151
171
  return false;
152
172
  }
@@ -39,6 +39,23 @@
39
39
  "includes": {},
40
40
  "excludes": {}
41
41
  },
42
+ {
43
+ "comment": "Syscalls added after this profile's Playwright copy that Docker's default profile allows. runc 1.5 (libpathrs) needs faccessat2 to start the container at all; once faccessat2 is listed, runc no longer answers the lower-numbered clone3, close_range, openat2 and pidfd syscalls with ENOSYS, so they are named here or below",
44
+ "names": ["faccessat2", "close_range", "openat2", "pidfd_open", "pidfd_send_signal"],
45
+ "action": "SCMP_ACT_ALLOW",
46
+ "args": [],
47
+ "includes": {},
48
+ "excludes": {}
49
+ },
50
+ {
51
+ "comment": "As in Docker's default profile: without CAP_SYS_ADMIN, clone3 answers ENOSYS so glibc falls back to clone. This profile allows clone with no argument filter (the first rule, for Chromium's namespace sandbox), so the fallback admits every clone flag, namespace flags included; the boundary is the container's dropped capabilities, no-new-privileges and the rest of this profile, not a clone flag check",
52
+ "names": ["clone3"],
53
+ "action": "SCMP_ACT_ERRNO",
54
+ "errnoRet": 38,
55
+ "args": [],
56
+ "includes": {},
57
+ "excludes": {}
58
+ },
42
59
  {
43
60
  "names": [
44
61
  "accept",
@@ -39,6 +39,23 @@
39
39
  "includes": {},
40
40
  "excludes": {}
41
41
  },
42
+ {
43
+ "comment": "Syscalls added after this profile's Playwright copy that Docker's default profile allows. runc 1.5 (libpathrs) needs faccessat2 to start the container at all; once faccessat2 is listed, runc no longer answers the lower-numbered clone3, close_range, openat2 and pidfd syscalls with ENOSYS, so they are named here or below",
44
+ "names": ["faccessat2", "close_range", "openat2", "pidfd_open", "pidfd_send_signal"],
45
+ "action": "SCMP_ACT_ALLOW",
46
+ "args": [],
47
+ "includes": {},
48
+ "excludes": {}
49
+ },
50
+ {
51
+ "comment": "As in Docker's default profile: without CAP_SYS_ADMIN, clone3 answers ENOSYS so glibc falls back to clone. This profile allows clone with no argument filter (the first rule, for Chromium's namespace sandbox), so the fallback admits every clone flag, namespace flags included; the boundary is the container's dropped capabilities, no-new-privileges and the rest of this profile, not a clone flag check",
52
+ "names": ["clone3"],
53
+ "action": "SCMP_ACT_ERRNO",
54
+ "errnoRet": 38,
55
+ "args": [],
56
+ "includes": {},
57
+ "excludes": {}
58
+ },
42
59
  {
43
60
  "names": [
44
61
  "accept",
package/dist/client.js CHANGED
@@ -263,13 +263,27 @@ var init_bridge = __esm(() => {
263
263
  "plugins.read-failed": "Listing plugins failed; the route answered 500.",
264
264
  "prompt.accepted": "The route accepted a prompt and answered 202.",
265
265
  "prompt.failed": "A prompt turn failed; the session reports the error.",
266
- "prompt.processing-failed": "A prompt accepted by the route failed while processing.",
266
+ "prompt.processing-provider-refused": "A prompt accepted by the route ended on a provider refusal; the turn already logged prompt.provider-refused.",
267
+ "prompt.processing-failed": "A prompt accepted by the route failed while processing, before the turn could report it.",
268
+ "prompt.processing-reported": "A prompt accepted by the route failed; the turn already logged prompt.failed.",
267
269
  "prompt.processing-usage-limited": "A prompt accepted by the route ended on a usage limit; the turn already logged prompt.usage-limited.",
270
+ "prompt.provider-refused": "A prompt turn ended because Claude refused it on the account's or the service's state; `reason` is the SDK's API error code and the session reports the error.",
268
271
  "prompt.received": "A prompt reached the bridge; only its length is logged.",
269
272
  "prompt.send-failed": "A prompt request failed; the route answered with an error.",
270
273
  "prompt.usage-limited": "A prompt turn ended because the account's plan allowance is used up; the session reports the limit.",
271
274
  "query.close-failed": "Stopping the Claude query failed while closing a tab; the close stays pending.",
272
- "query.failed": "A Claude query ended with an error result.",
275
+ "query.failed": {
276
+ description: "A Claude query ended with an error result the bridge does not know to be the account's or the service's state: `subtype` and `isError` from the result, `reason` the SDK's API error code when the turn ended on one, `apiStatus` its HTTP status, `startupFailure` whether the CLI failed to start.",
277
+ essential: true,
278
+ fields: {
279
+ subtype: "label",
280
+ isError: "boolean",
281
+ reason: "label",
282
+ apiStatus: "number",
283
+ startupFailure: "boolean"
284
+ }
285
+ },
286
+ "query.provider-refused": "Claude refused a query on the account's or the service's state (a refused login, an account on hold, an overloaded or failing API); `reason` is the SDK's API error code and the turn reports the provider's words.",
273
287
  "query.usage-limited": "Claude refused a query because the account's plan allowance is used up; the turn reports the limit.",
274
288
  "question.answer-failed": "The answer-question route failed.",
275
289
  "question.answering": "Answering a parked question.",
@@ -294,7 +308,7 @@ var init_bridge = __esm(() => {
294
308
  "sessions.reconcile-failed": "Reconciling persisted sessions failed; the sessions already known are listed.",
295
309
  "sse.aborted": "The client closed an event stream.",
296
310
  "sse.cleanup": "An event stream connection was released.",
297
- "sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
311
+ "sse.closed": "An event stream was closed by the bridge; the client reconnects.",
298
312
  "sse.handshake-failed": "An event stream failed during its handshake; the client reconnects.",
299
313
  "sse.keepalive-failed": "An event stream keepalive failed, usually a client that has gone; the connection closes.",
300
314
  "sse.opened": "An event stream connection opened.",
@@ -328,6 +342,7 @@ var init_bridge = __esm(() => {
328
342
  "app-server.termination-unconfirmed": "app-server did not report an exit after SIGKILL; the restart or shutdown went on without it.",
329
343
  "approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
330
344
  "approval.present-failed": "Presenting an approval threw; it is auto-declined.",
345
+ "approval.refusal-check-failed": "Checking whether a read-only turn refuses an approval threw; it is declined.",
331
346
  "approval.resolved-callback-failed": "An approval resolved callback threw.",
332
347
  "command-changes.record-failed": "Recording line changes for a command failed; the turn carries on.",
333
348
  "dispatch.reconcile-failed": "A dispatch could not be reconciled against its thread; it stays recovering.",
@@ -354,6 +369,7 @@ var init_bridge = __esm(() => {
354
369
  "parent.gone": "The backend that launched this bridge has gone; stopping turns and shutting down.",
355
370
  "queue.overflow": "The notification queue passed a bound and dropped its backlog.",
356
371
  "queue.task-failed": "A task on a per-thread queue failed.",
372
+ "read-only-rules.write-failed": "Writing the read-only exec-policy rules failed; the turn's reads are declined instead.",
357
373
  "recorder.notice": "The notification recorder needs attention: it is on, or was asked for without its confirmation.",
358
374
  "recorder.threw": "The notification recorder threw.",
359
375
  "recorder.write-failed": "Writing a notification recording failed; its lines were dropped.",
@@ -366,12 +382,9 @@ var init_bridge = __esm(() => {
366
382
  "server-request.handoff-failed": "Handing a server request to the router threw.",
367
383
  "session.config-apply-failed": "Applying session configuration failed; the route answers unavailable.",
368
384
  "session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
369
- "sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
385
+ "sse.closed": "An event stream was closed by the bridge; the client reconnects.",
370
386
  "sse.keepalive-failed": "An event stream keepalive failed.",
371
- "sse.observer-failed": "An event stream observer failed; it reconnects.",
372
- "sse.payload-serialize-failed": "An event payload could not be serialized; a placeholder was sent.",
373
- "sse.payload-snapshot-failed": "An event payload could not be snapshotted; a placeholder was sent.",
374
- "sse.subscriber-failed": "An event stream subscriber failed; it reconnects and replays.",
387
+ "sse.subscriber-failed": "An event stream subscriber failed; it reconnects.",
375
388
  "subagent.activity-load-failed": "Sub-agent activity could not be loaded; the transcript renders without it.",
376
389
  "thread.archive-failed": "Archiving or unarchiving a thread failed.",
377
390
  "thread.fork-failed": "thread/fork failed; the route answers 503.",
@@ -899,6 +912,7 @@ var init_native_agent = __esm(() => {
899
912
  "title.strategy-failed": "A session title strategy failed, so the next is tried. Content-free: the error can quote the prompt.",
900
913
  "steer.qualification-failed": "A bridge's steer qualification failed or answered non-OK, so steering is not offered. Agent and status code or error class only.",
901
914
  "steer.capability-cleared": "A projection cleared `actions.steer` because its bridge did not qualify. Identifiers and turn status only.",
915
+ "queue.turn-not-running": "A projection holds queued prompts while its turn is not `running`; once per change of phase. Identifiers, phase and queue length only.",
902
916
  ...THROTTLE_LOG_EVENTS
903
917
  }
904
918
  },
@@ -1127,6 +1141,7 @@ var init_terminal = __esm(() => {
1127
1141
  "reconnect.setup-marker-found": "A reconnected tab's buffer already held the setup marker.",
1128
1142
  "reconnect.setup-marker-absent": "A reconnected first tab's buffer lacked the setup marker.",
1129
1143
  "reconnect.completed": "A terminal tab finished reconnecting to its session.",
1144
+ "reconnect.new-shell-failed": "A launched tab whose shell was gone could not get a new one automatically.",
1130
1145
  "restore.setup-marker-found": "A restored tab's buffer already held the setup marker.",
1131
1146
  "persistent-sessions.load-failed": "Listing an environment's saved sessions failed.",
1132
1147
  "persistent-session.restoring": "A tab began restoring from its saved session.",
@@ -1404,6 +1419,7 @@ var init_build_pipeline = __esm(() => {
1404
1419
  "sidebar.reconcile-failed": "Sidebar activity for pipelines could not be reconciled.",
1405
1420
  "sidebar.update-failed": "The sidebar could not be updated for one pipeline.",
1406
1421
  "result.consume-deferred": "Consuming a stage's workflow result failed; it stays staged and is retried.",
1422
+ "review.prompt-reads": "A review fan-out pass built or tried to build reviewer prompts; how many it built, and how often building them read the review instruction and project notes, failed reads included. Counts only.",
1407
1423
  "consolidation.consume-deferred": "Consuming a review consolidation result failed; it stays pending and is retried.",
1408
1424
  "dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request does the same work and answers authoritatively.",
1409
1425
  "interaction.resolved": "A human interaction on a pipeline stage resolved. Metadata only.",
@@ -1460,6 +1476,8 @@ var init_change_tracking = __esm(() => {
1460
1476
  "retention.failed": "A retention pass failed partway; what it deleted stands and the next pass goes on.",
1461
1477
  "projection.failed": "Projecting a change event onto its environment failed.",
1462
1478
  "startup.reconcile-failed": "Reconciling change tracking at startup failed.",
1479
+ "deleted-environments.purge-requested": "The startup reconcile found ledger rows of environments the environment store no longer holds and requested their purge.",
1480
+ "deleted-environments.reconcile-failed": "The startup reconcile of deleted environments could not read the environment store, so it requested no purge.",
1463
1481
  "turn-start.capture-failed": "Capturing a turn's start failed, so the turn is untracked.",
1464
1482
  "dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
1465
1483
  "turn.finalize-failed": "Finalizing a turn failed.",
@@ -1698,11 +1716,17 @@ var init_docker = __esm(() => {
1698
1716
  "login-watcher.opencode-renewal-failed": "OAuth logins a host OpenCode server refreshed could not be copied into the `auth.json` containers are handed; the files are still delivered and the next pass retries. Error class only.",
1699
1717
  "lifecycle.record-failure-failed": "A failed container operation could not be recorded.",
1700
1718
  "lifecycle.reconcile-failed": "Reconciling one environment's container operation failed; the next pass retries.",
1719
+ "replacement.copy-helper-stalled": "A rebuild copy step's helper was still running when its drain window after the `docker cp` producer closed ran out, so the step was abandoned and the helper removed. Fields: the producer's exit code, the bytes it sent, how long it streamed and the window.",
1720
+ "replacement.copy-helper-remove-failed": "An abandoned rebuild copy step's helper container (`helper`, its name) could not be removed, so the step failed rather than settle while the helper may still mount the new storage.",
1701
1721
  "replacement.clear-terminals-failed": "Terminal sessions could not be cleared after a container replacement.",
1702
1722
  "recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
1703
1723
  "github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
1704
1724
  "availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
1705
- "start.port-collision-retrying": "An automatic host port collided on start, so it is retried (up to three times): with fresh ports, or, when `backendChosen`, on the same backend-chosen port after a pause.",
1725
+ "start.port-collision-retrying": "An automatic host port collided on start, so it is retried: with fresh ports (up to ten times), or, when `backendChosen`, on the same backend-chosen port after a pause (up to three times).",
1726
+ "copy-in.snapshot-busy-retrying": "Docker could not mount a created or stopped container's filesystem to copy files into it (device or resource busy), so the copy is retried after a pause.",
1727
+ "copy-in.snapshot-busy-recovered": "A copy into a container that Docker had refused as busy succeeded on a retry; `retries` is how many it took.",
1728
+ "copy-in.snapshot-busy": "Docker still refused a copy into a container as busy after every retry, so it failed.",
1729
+ "start.port-collision-run": "A start that met host-port collisions ended: `collisions` is the run's length, with the fresh-port and same-port retries it used, the first and last colliding ports, and the `outcome` (started, exhausted, not-retryable, network-lost, or failed when a later attempt, inspection or network restore failed for another reason).",
1706
1730
  "host-ports.owned-list-failed": "Docker could not list the host ports the backend chose for this owner's other containers, so a new rootless container's ports were chosen avoiding only this process's recent choices.",
1707
1731
  "writer-lease.lost": {
1708
1732
  description: "This backend lost the registry writer lease, for the fixed `reason` given. Schedules stop and container changes are refused until it restarts.",
@@ -1714,9 +1738,15 @@ var init_docker = __esm(() => {
1714
1738
  essential: true,
1715
1739
  fields: { staleForMs: "number" }
1716
1740
  },
1717
- "writer-lease.listener-failed": "The callback told about a lost registry writer lease threw, so the schedules settings learn of the loss only at their next read.",
1741
+ "writer-lease.listener-failed": "The callback told about a lost, or a late-won, registry writer lease threw, so the schedules settings learn of the change only at their next read.",
1742
+ "writer-lease.acquired-late": {
1743
+ description: "A backend that started without the registry writer lease won it later, because its holder stopped refreshing it (most often a crash just before this backend started). Schedules fire and container changes are allowed from now on; the `writer-lease.regained` line before it gives the stale lease's age.",
1744
+ essential: true,
1745
+ fields: {}
1746
+ },
1747
+ "writer-lease.retry-failed": "A backend without the registry writer lease could not try for it again for a reason other than the lease being held (an unreadable data directory, say). It tries again on its next tick.",
1718
1748
  "writer-lease.not-acquired": {
1719
- description: "This backend started without the registry writer lease, for the fixed `reason` given. A second backend on one data directory is normal: it serves reads, runs no schedules and refuses container changes.",
1749
+ description: "This backend started without the registry writer lease, for the fixed `reason` given. A second backend on one data directory is normal: it serves reads, runs no schedules and refuses container changes. A `busy` one keeps trying and writes `writer-lease.acquired-late` if it wins the lease once its holder stops refreshing it.",
1720
1750
  essential: true,
1721
1751
  fields: { reason: "label" }
1722
1752
  },
@@ -1945,6 +1975,7 @@ var init_feature = __esm(() => {
1945
1975
  feature: {
1946
1976
  description: "Pipeline environments started from a feature, and feature planning.",
1947
1977
  events: {
1978
+ "debug-build.launched": "The debug button's pipeline environment was launched. Ids and counts only: no ticket text, transcript or screenshot.",
1948
1979
  "naming.fallback": "Automatic naming failed, so a local fallback name is used. Error kind only: the description stays out.",
1949
1980
  "planning.legacy-adopt-failed": "Legacy planning conversations could not be adopted.",
1950
1981
  "planning.tick-retrying": "A planning tick failed on a transient error; the next tick retries."
@@ -2049,7 +2080,6 @@ var init_web_app = __esm(() => {
2049
2080
  "docker.sync-failed": "Reconciling environments with Docker failed; non-fatal.",
2050
2081
  "prompt-queues.restore-failed": "An environment's prompt queues could not be restored.",
2051
2082
  "multi-reviews.restore-failed": "An environment's multi reviews could not be restored.",
2052
- "build-pipelines.migrate-failed": "Migrating legacy build pipelines failed; the next launch retries.",
2053
2083
  "build-pipelines.restore-failed": "A project's build pipelines could not be restored.",
2054
2084
  "macos-permissions.check-failed": "Reading macOS file permission status failed.",
2055
2085
  "cli-check.failed": "One startup CLI check failed; its result stays unknown.",
@@ -2105,7 +2135,6 @@ var init_web_build_pipeline = __esm(() => {
2105
2135
  "environment.project-mismatch": "A build's environment was not added: wrong project.",
2106
2136
  "environment.hydrate-failed": "A build's environment read failed; live sync can recover.",
2107
2137
  "transcript.load-failed": "A stage transcript read failed and will retry with backoff.",
2108
- "legacy.state-too-large": "Legacy pipeline state was over the limit and skipped.",
2109
2138
  "opencode-catalog.load-failed": "The cached OpenCode model list could not be loaded.",
2110
2139
  "model-catalog.hydrate-failed": "A node's cached model lists could not be loaded for a launcher.",
2111
2140
  "opencode-preferences.load-failed": "OpenCode model preferences could not be loaded.",
@@ -2676,7 +2705,7 @@ var init_log_vocabulary = __esm(() => {
2676
2705
  var init_renderer_errors = () => {};
2677
2706
 
2678
2707
  // ../protocol/src/log-essential-labels.ts
2679
- var ERROR_NAMES, ERROR_CODES, SYSCALLS, SIGNALS, PROVIDERS, BRIDGE_LISTENER_REASONS, UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", SOURCE, STORAGE_DATABASES, STORAGE_OPERATIONS, TRANSACTION_MODES, STORAGE_TABLES;
2708
+ var ERROR_NAMES, ERROR_CODES, SYSCALLS, SIGNALS, PROVIDERS, BRIDGE_LISTENER_REASONS, CLAUDE_RESULT_SUBTYPES, CLAUDE_API_ERRORS, UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", SOURCE, STORAGE_DATABASES, STORAGE_OPERATIONS, TRANSACTION_MODES, STORAGE_TABLES;
2680
2709
  var init_log_essential_labels = __esm(() => {
2681
2710
  init_log_vocabulary();
2682
2711
  init_renderer_errors();
@@ -2793,6 +2822,28 @@ var init_log_essential_labels = __esm(() => {
2793
2822
  "no-listener",
2794
2823
  "launch-exited"
2795
2824
  ]);
2825
+ CLAUDE_RESULT_SUBTYPES = new Set([
2826
+ "success",
2827
+ "error_during_execution",
2828
+ "error_max_turns",
2829
+ "error_max_budget_usd",
2830
+ "error_max_structured_output_retries"
2831
+ ]);
2832
+ CLAUDE_API_ERRORS = new Set([
2833
+ "authentication_failed",
2834
+ "oauth_org_not_allowed",
2835
+ "account_on_hold",
2836
+ "verification_required",
2837
+ "billing_error",
2838
+ "rate_limit",
2839
+ "overloaded",
2840
+ "invalid_request",
2841
+ "model_not_found",
2842
+ "server_error",
2843
+ "unknown",
2844
+ "max_output_tokens",
2845
+ "cloud_credential_error"
2846
+ ]);
2796
2847
  SOURCE = new RegExp(`^(?:claude|codex|opencode|cursor|grok|acp|pi):${UUID}$`, "i");
2797
2848
  STORAGE_DATABASES = new Set(["main", "ledger", "other"]);
2798
2849
  STORAGE_OPERATIONS = new Set([
@@ -13022,6 +13073,7 @@ async function collectBugReportMachineFacts(options2) {
13022
13073
  }
13023
13074
 
13024
13075
  // ../protocol/src/terminal-agent-launch.ts
13076
+ init_agent_platforms();
13025
13077
  var OPENCODE_PINNED_RUNTIME_ENV = Object.freeze({
13026
13078
  OPENCODE_DISABLE_AUTOUPDATE: "1"
13027
13079
  });
@@ -13204,7 +13256,7 @@ import path5 from "path";
13204
13256
  // ../../apps/backend/package.json
13205
13257
  var package_default = {
13206
13258
  name: "@orkestrator/backend",
13207
- version: "2.38.1-beta",
13259
+ version: "2.38.3-beta",
13208
13260
  private: true,
13209
13261
  type: "module",
13210
13262
  exports: {
@@ -14400,6 +14452,9 @@ var WORKFLOW_RESULT_TOOL_NAMES = {
14400
14452
  "subork-answer": "submit_subork_answer"
14401
14453
  };
14402
14454
  var WORKFLOW_RESULT_VALIDATION_TOOL_NAME = "validate_workflow_result";
14455
+ var WORKFLOW_RESULT_TOOL_META = Object.freeze({
14456
+ "anthropic/alwaysLoad": true
14457
+ });
14403
14458
  var GRAPH_PORT_SUBMIT_PREFIX = "submit_";
14404
14459
  var GRAPH_PORT_VALIDATE_PREFIX = "validate_";
14405
14460
  var WORKFLOW_RESULT_KIND_TOOLS = new Set(Object.values(WORKFLOW_RESULT_TOOL_NAMES));
@@ -27210,12 +27265,13 @@ function processIsAlive(pid) {
27210
27265
  }
27211
27266
  var DESCRIPTOR_START_BEFORE_TOLERANCE_MS = 60 * 60 * 1000;
27212
27267
  var DESCRIPTOR_START_AFTER_TOLERANCE_MS = 30 * 1000;
27268
+ var FIRST_LINUX_PROCESS_IDENTITY_RELEASE = "2.36.4-beta";
27213
27269
  async function descriptorProcessRefusal(descriptor, readStart = readProcessStartTime, alive = processIsAlive) {
27214
27270
  if (!alive(descriptor.pid))
27215
27271
  return "is not running as your user (its descriptor is stale)";
27216
27272
  if (process.platform === "linux" && readStart === readProcessStartTime) {
27217
27273
  if (!descriptor.processIdentity) {
27218
- return "cannot be confirmed: restart an upgraded backend to publish its Linux process identity";
27274
+ return `cannot be confirmed: it publishes no Linux process identity (Orkestrator ${FIRST_LINUX_PROCESS_IDENTITY_RELEASE} and later do). Update and restart that backend, or connect with --url <its URL> --credential-file <its data directory>/gateway-auth.json`;
27219
27275
  }
27220
27276
  const identity = await readLinuxProcessIdentity(descriptor.pid);
27221
27277
  if (identity === null)
@@ -27244,7 +27300,22 @@ async function descriptorTarget(name, kind, descriptor, expectedInstallationId,
27244
27300
  throw new CliError("identity-mismatch", `The backend at ${kind} '${name}' is a different installation than the one saved`, { details: { expected: expectedInstallationId, actual: descriptor.installationId } });
27245
27301
  }
27246
27302
  const baseUrl = normalizeBaseUrl(descriptor.url);
27247
- return {
27303
+ const original = async () => {
27304
+ const refusal = await descriptorProcessRefusal(descriptor, readStart);
27305
+ if (refusal)
27306
+ throw new CliError("connection-failed", `The backend for ${kind} '${name}' ${refusal}`);
27307
+ return readTokenFile(descriptor.authFile, true);
27308
+ };
27309
+ let successor = null;
27310
+ const adopt = (next) => {
27311
+ target.baseUrl = next.baseUrl;
27312
+ target.identity.endpoint = next.identity.endpoint;
27313
+ if (next.identity.generation)
27314
+ target.identity.generation = next.identity.generation;
27315
+ if (next.descriptorGeneration)
27316
+ target.descriptorGeneration = next.descriptorGeneration;
27317
+ };
27318
+ const target = {
27248
27319
  identity: {
27249
27320
  name,
27250
27321
  kind,
@@ -27254,15 +27325,41 @@ async function descriptorTarget(name, kind, descriptor, expectedInstallationId,
27254
27325
  },
27255
27326
  baseUrl,
27256
27327
  readToken: async () => {
27257
- const refusal = await descriptorProcessRefusal(descriptor, readStart);
27258
- if (refusal)
27259
- throw new CliError("connection-failed", `The backend for ${kind} '${name}' ${refusal}`);
27260
- return readTokenFile(descriptor.authFile, true);
27328
+ try {
27329
+ if (!successor)
27330
+ return await original();
27331
+ const token = await successor.readToken();
27332
+ adopt(successor);
27333
+ return token;
27334
+ } catch (error) {
27335
+ if (successor || !(error instanceof CliError) || error.code !== "connection-failed")
27336
+ throw error;
27337
+ const next = await refresh().catch((refreshError) => {
27338
+ if (refreshError instanceof CliError && refreshError.code === "identity-mismatch")
27339
+ throw refreshError;
27340
+ return null;
27341
+ });
27342
+ if (!next)
27343
+ throw error;
27344
+ if (next.expectedInstallationId !== descriptor.installationId) {
27345
+ throw new CliError("identity-mismatch", `The backend at ${kind} '${name}' is a different installation than the one resolved`, {
27346
+ details: {
27347
+ expected: descriptor.installationId,
27348
+ actual: next.expectedInstallationId ?? null
27349
+ }
27350
+ });
27351
+ }
27352
+ const token = await next.readToken();
27353
+ successor = next;
27354
+ adopt(next);
27355
+ return token;
27356
+ }
27261
27357
  },
27262
27358
  expectedInstallationId: descriptor.installationId,
27263
27359
  descriptorGeneration: descriptor.generation,
27264
27360
  refresh
27265
27361
  };
27362
+ return target;
27266
27363
  }
27267
27364
  async function resolveTarget(selection, store, env) {
27268
27365
  if (selection.profile !== undefined)