orkestrator 2.35.4-beta → 2.36.0

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.
@@ -6,6 +6,7 @@ var port = parsePort(process.env.PORT);
6
6
  var hostname = process.env.HOSTNAME?.trim() || "127.0.0.1";
7
7
  var workingDirectory = resolve(process.env.CWD?.trim() || process.cwd());
8
8
  var authToken = process.env.CURSOR_BRIDGE_TOKEN?.trim() || randomBytes(32).toString("base64url");
9
+ delete process.env.CURSOR_BRIDGE_TOKEN;
9
10
  function applyWorkingDirectory(directory = workingDirectory) {
10
11
  const target = resolve(directory);
11
12
  if (process.cwd() === target)
@@ -28290,7 +28291,7 @@ function newSessionState(clientSessionKey, policy) {
28290
28291
  // ../protocol/src/secret-redaction.ts
28291
28292
  var TEXT_RULES = [
28292
28293
  {
28293
- pattern: /([a-z][a-z0-9+.-]*:\/\/)[^/\s:@]+(?::[^/\s@]*)?@/gi,
28294
+ pattern: /(?<![a-z0-9+.-])([a-z][a-z0-9+.-]*:\/\/)[^/\s:@]+(?::[^/\s@]*)?@/gi,
28294
28295
  replacement: "$1[redacted]@"
28295
28296
  },
28296
28297
  {
@@ -28310,7 +28311,7 @@ var TEXT_RULES = [
28310
28311
  { pattern: /\bAKIA[0-9A-Z]{12,}/g, replacement: "[redacted]" },
28311
28312
  { pattern: /\bAIza[0-9A-Za-z_-]{20,}/g, replacement: "[redacted]" },
28312
28313
  {
28313
- pattern: /\b((?:[A-Za-z0-9]+[_-])*(?:api[_-]?key|apikey|access[_-]?token|refresh[_-]?token|auth[_-]?token|token|secret|client[_-]?secret|password|passwd|passphrase|authorization))("?\s*[:=]\s*)("?)(?!Bearer\b|Basic\b|\[redacted\])[^\s"',;)&]{6,}\3/gi,
28314
+ pattern: /(?<![A-Za-z0-9_-])(-*\b(?:[A-Za-z0-9]+[_-])*(?:api[_-]?key|apikey|access[_-]?token|refresh[_-]?token|auth[_-]?token|token|secret|client[_-]?secret|password|passwd|passphrase|authorization))("?\s*[:=]\s*)("?)(?!Bearer\b|Basic\b|\[redacted\])[^\s"',;)&]{6,}\3/gi,
28314
28315
  replacement: "$1$2[redacted]"
28315
28316
  }
28316
28317
  ];
@@ -28394,8 +28395,10 @@ function stackFrames(target, message) {
28394
28395
  `).filter((line) => /^\s*at\s/.test(line)).slice(0, MAX_STACK_FRAMES).map((line) => boundedText2(relativeFrame(line), MAX_FRAME_CHARS));
28395
28396
  return frames.length > 0 ? frames : undefined;
28396
28397
  }
28397
- function describe2(error, includeStack, depth) {
28398
+ function describe2(error, includeStack, includeMessage, depth) {
28398
28399
  if (typeof error !== "object" || error === null) {
28400
+ if (!includeMessage)
28401
+ return { name: "NonError" };
28399
28402
  return {
28400
28403
  name: "NonError",
28401
28404
  message: typeof error === "string" ? boundedText2(error, MAX_MESSAGE_CHARS) : `[${typeof error}]`
@@ -28412,7 +28415,7 @@ function describe2(error, includeStack, depth) {
28412
28415
  const details = { name };
28413
28416
  if (commandFailure)
28414
28417
  details.outputOmitted = true;
28415
- else if (message)
28418
+ else if (message && includeMessage)
28416
28419
  details.message = boundedText2(message, MAX_MESSAGE_CHARS);
28417
28420
  const code = read(error, "code");
28418
28421
  const safeCode = finite(code) ?? matching(code, CODE_PATTERN);
@@ -28440,13 +28443,13 @@ function describe2(error, includeStack, depth) {
28440
28443
  details.errorCount = members.length;
28441
28444
  const cause = read(error, "cause") ?? (Array.isArray(members) ? members[0] : undefined);
28442
28445
  if (cause !== undefined && cause !== null && depth < MAX_CAUSE_DEPTH) {
28443
- details.cause = describe2(cause, false, depth + 1);
28446
+ details.cause = describe2(cause, false, includeMessage, depth + 1);
28444
28447
  }
28445
28448
  return details;
28446
28449
  }
28447
28450
  function formatLogError(error, options = {}) {
28448
28451
  try {
28449
- return brand(describe2(error, options.stack !== false, 0));
28452
+ return brand(describe2(error, options.stack !== false, options.message !== false, 0));
28450
28453
  } catch {
28451
28454
  return brand({ name: "Error", message: "[unreadable]" });
28452
28455
  }
@@ -28478,7 +28481,16 @@ var AGENT_MAIL_LOG_AREAS = defineLogAreas({
28478
28481
  "agent-mail": {
28479
28482
  description: "Delivering agent mail into waiting agent sessions.",
28480
28483
  events: {
28481
- "delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged."
28484
+ "delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged.",
28485
+ "drain.new-mail-failed": "Draining newly received mail failed; the next sweep delivers it.",
28486
+ "presence.sync-failed": "Mailboxes could not be synchronized.",
28487
+ "inject.verified": "An injected message's delivery was checked. Ids and decisions only.",
28488
+ "inject.dispatched": "Messages were dispatched into a session. Ids and decisions only.",
28489
+ "stopped-worker.action-failed": "Nothing could act on mail for a stopped worker.",
28490
+ "coordinator.start-failed": "The main coordinator could not be started for a new message.",
28491
+ "message.placed": "A message was placed in a mailbox. Ids and decisions only, never subjects or bodies.",
28492
+ "budget.hold-notify-failed": "The coordinator could not be told about held worker mail.",
28493
+ "budget.reset-failed": "The mail budget could not be reset for a prompted tab."
28482
28494
  }
28483
28495
  }
28484
28496
  });
@@ -28500,6 +28512,30 @@ var BACKEND_LOG_AREAS = defineLogAreas({
28500
28512
  "job.failed": "One pass of the job named in `scope` failed; its next pass retries.",
28501
28513
  ...THROTTLE_LOG_EVENTS
28502
28514
  }
28515
+ },
28516
+ backend: {
28517
+ description: "The backend process: startup, background notices and shutdown.",
28518
+ events: {
28519
+ starting: "The backend process is starting.",
28520
+ "ssh-socket.resolved": "An SSH agent socket was found.",
28521
+ "ssh-socket.missing": "No usable SSH agent socket was found.",
28522
+ "standalone-updater.mismatch": "--standalone-updater does not match --data-dir, so self-update is off.",
28523
+ "instance.publish-failed": "The instance descriptor could not be published.",
28524
+ "instance.republish-failed": "The instance descriptor could not be republished; a later pass retries.",
28525
+ "parent.exited": "The parent process exited, so local servers are shutting down.",
28526
+ "startup.step-failed": "One part of startup failed and the backend carried on; `step` says which.",
28527
+ "startup.setup-fence-failed": "An environment's interrupted setup could not be fenced.",
28528
+ "startup.setup-adopt-failed": "An environment's pending setup could not be adopted.",
28529
+ "startup.deletion-pending": "An interrupted environment deletion stays pending. Its owning step logged the detail.",
28530
+ "startup.looped-review-pending": "Cleanup of the retired Looped Review stays pending.",
28531
+ "notice.failed": "A background notice after a turn or prompt failed; `step` says which.",
28532
+ "artifacts.live-unavailable": "Live interactive artifacts are unavailable.",
28533
+ "shutdown.step-failed": "One part of shutdown failed and the rest went on; `step` says which.",
28534
+ "shutdown.signal-received": "A signal started shutdown, which tells a clean quit from the backend being killed.",
28535
+ "shutdown.finished": "Shutdown finished, and the process exits with `code`.",
28536
+ "port-policy.second-backend": "Another backend serves the default data directory, so this one avoids its ports.",
28537
+ "port-policy.serve-on-free-port": "--tailscale-serve is on a free gateway port; pass --port with --strict-gateway-port to keep one."
28538
+ }
28503
28539
  }
28504
28540
  });
28505
28541
 
@@ -28507,11 +28543,12 @@ var BACKEND_LOG_AREAS = defineLogAreas({
28507
28543
  var MAX_BRIDGE_DIAGNOSTIC_BYTES = 8192;
28508
28544
  var BRIDGE_LOG_AREAS = defineLogAreas({
28509
28545
  "bridge.diagnostics": {
28510
- description: "Metadata snapshots of bridge turns and processes, written while Save Logs for Debugging is on. docs/architecture/bridge-diagnostics.md reads them.",
28546
+ description: "Metadata snapshots of bridge turns and processes: lifecycle, stalls and a keepalive at info, every minute at debug, and each change at trace. docs/architecture/bridge-diagnostics.md reads them.",
28511
28547
  tag: "bridge-diagnostics",
28512
28548
  maxStringChars: MAX_BRIDGE_DIAGNOSTIC_BYTES,
28513
28549
  events: {
28514
- heartbeat: "The once-a-minute snapshot of a turn or process that is still open.",
28550
+ heartbeat: "A periodic snapshot of an open turn or process: every minute at debug; at info only as stall evidence (a stall starting or clearing, a late timer, a change during a silent stall) or the ten-minute keepalive.",
28551
+ change: "At trace only: a snapshot written as soon as the phase, the pending tools or a counter past its threshold changes.",
28515
28552
  "send-started": "A turn or process diagnostic scope began.",
28516
28553
  "send-resolved": "The provider accepted a dispatch.",
28517
28554
  "cancel-requested": "Cancellation of a turn was requested.",
@@ -28592,6 +28629,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
28592
28629
  "session.created": "A session was created or recovered.",
28593
28630
  "session.delete-failed": "Deleting a session failed.",
28594
28631
  "session.fork-failed": "Forking a session failed.",
28632
+ "session.policy-widening-refused": "A config request tried to widen a live session's execution policy and was refused; widened names the axes.",
28595
28633
  "session.rename-failed": "Renaming a session failed.",
28596
28634
  "session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
28597
28635
  "session.rewind-failed": "Rewinding session files failed.",
@@ -28724,6 +28762,7 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
28724
28762
  "backend.keychain-link-remove-failed": "An agent-test profile kept a legacy link to the host keychain.",
28725
28763
  "backend.start-failed": "The Local backend did not start; continuing with remote machines.",
28726
28764
  "clipboard.write-failed": "Writing text to the system clipboard failed.",
28765
+ "dev-mode.ignored-packaged": "A packaged app was launched with ELECTRON_DEV=1 and ignored it; it loads its bundled renderer.",
28727
28766
  "instance.already-running": "Another instance holds this data directory; this one will quit.",
28728
28767
  "main-thread.stalled": "A timer fired late, so windows, IPC and the stdout reader waited.",
28729
28768
  "quit.stopping-backend": "The app is quitting and has asked the Local backend to stop.",
@@ -28796,7 +28835,8 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
28796
28835
  description: "Preparing the pinned agent toolchain at desktop startup.",
28797
28836
  events: {
28798
28837
  "bootstrap-progress.show-failed": "The toolchain progress window could not be shown.",
28799
- "prepare.failed": "Preparing the pinned agent tools failed."
28838
+ "prepare.failed": "Preparing the pinned agent tools failed.",
28839
+ "prepare.ready": "The pinned agent tools were verified and activated; durationMs is how long startup waited."
28800
28840
  }
28801
28841
  },
28802
28842
  "artifact-host": {
@@ -28810,7 +28850,7 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
28810
28850
  // ../protocol/src/log-vocabulary/environment.ts
28811
28851
  var ENVIRONMENT_LOG_AREAS = defineLogAreas({
28812
28852
  environment: {
28813
- description: "Environment naming, held setup and cleanup after deletion.",
28853
+ description: "Environment naming, setup, status, moves, deletion and cleanup afterwards.",
28814
28854
  events: {
28815
28855
  "cleanup.branch-kept": "A deleted environment's local branch was kept, as it may hold unmerged work.",
28816
28856
  "rename.failed": "Naming an environment from its pending prompt failed for the first time.",
@@ -28819,6 +28859,40 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
28819
28859
  "setup.attention-not-recorded": "Held setup could not be recorded as needing the user's attention.",
28820
28860
  "setup.coordinator-not-notified": "The worker's coordinator could not be told that its setup is held for approval.",
28821
28861
  "setup.unknown-environment": "The renderer was asked to act on the setup of an environment it does not hold.",
28862
+ "cleanup.rearmed": "A deleted environment's stopped cleanup is retried once under a new backend version.",
28863
+ "cleanup.exhausted": "A deleted environment's cleanup keeps failing after its attempts; written once per environment.",
28864
+ "cleanup.retry-not-admitted": "A cleanup retry was not admitted; the entry stays for the next start.",
28865
+ "cleanup.step-failed": "One step of a deleted environment's cleanup failed; a later reconcile retries it.",
28866
+ "cleanup.record-failed": "A finished cleanup step could not be recorded, so it may run again.",
28867
+ "cleanup.sweep-failed": "A cleanup sweep failed; written once per sweep.",
28868
+ "cleanup.reconcile-failed": "A cleanup reconcile pass failed; the next one retries.",
28869
+ "orphan-state.remove-failed": "An orphaned environment state directory could not be removed.",
28870
+ "orphan-state.removed": "Orphaned environment state directories were removed.",
28871
+ "orphan-state.sweep-failed": "Sweeping orphaned environment state failed.",
28872
+ "orphan-canvas.removed": "Orphaned design canvases were removed.",
28873
+ "orphan-canvas.sweep-failed": "Sweeping orphaned design canvases failed.",
28874
+ "orphan-branches.swept": "Orphaned environment branches were deleted, or kept as they may hold unmerged work.",
28875
+ "stray-workspace.remove-failed": "A stray workspace directory could not be removed.",
28876
+ "stray-workspace.removed": "Stray workspace directories were removed.",
28877
+ "stray-workspace.kept": "Unowned workspace directories that hold files were kept; remove them by hand if unneeded.",
28878
+ "temp-files.removed": "Abandoned temp files were removed.",
28879
+ "status.ownership-probe-failed": "A strict container ownership probe failed, so the stored status is kept.",
28880
+ "status.docker-error": "A transient Docker error stopped a status read, so the stored status is kept.",
28881
+ "setup.clear-launch-failed": "A pending agent launch could not be cleared after setup failed.",
28882
+ "setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
28883
+ "lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
28884
+ "tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
28885
+ "tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
28886
+ "orphan-session.reaped": "A native session no tab references was torn down.",
28887
+ "handoff-sweep.failed": "Sweeping transferred transcripts no tab references failed.",
28888
+ "delete.terminals-survived": "Terminal process trees outlived termination, so the deletion stops.",
28889
+ "delete.artifacts-left": "Graph run artifact directories were not removed.",
28890
+ "delete.worktrees-kept": "Graph runs kept branch worktrees.",
28891
+ "delete.step-failed": "One best-effort part of deleting an environment failed; `step` says which, and the rest goes on.",
28892
+ "merge-cleanup.resume-failed": "A merge cleanup interrupted by a restart could not be resumed.",
28893
+ "move.sessions-not-moved": "A provider's sessions could not follow a moved environment.",
28894
+ "move.recovery-failed": "Recovering an interrupted environment move failed.",
28895
+ "stop.settle-activity-failed": "Agent activity could not be settled after a runtime stopped.",
28822
28896
  ...THROTTLE_LOG_EVENTS
28823
28897
  }
28824
28898
  }
@@ -28827,10 +28901,50 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
28827
28901
  // ../protocol/src/log-vocabulary/gateway.ts
28828
28902
  var GATEWAY_LOG_AREAS = defineLogAreas({
28829
28903
  gateway: {
28830
- description: "The remote gateway other devices and browsers connect through.",
28904
+ description: "The gateway other devices, browsers and the desktop connect through.",
28831
28905
  events: {
28832
28906
  "remote.start-failed": "The desktop could not start the remote gateway.",
28833
- "remote.stop-failed": "The desktop could not stop the remote gateway cleanly."
28907
+ "remote.stop-failed": "The desktop could not stop the remote gateway cleanly.",
28908
+ disabled: "The gateway is disabled by its environment variable.",
28909
+ "tailscale.no-address": "No Tailscale address was found, so the gateway did not start.",
28910
+ "tailscale.no-address-fallback": "No Tailscale address was found, so the gateway binds its fallback address.",
28911
+ "control.listening": "The backend control listener is up.",
28912
+ "browser.listening": "The browser listener is up.",
28913
+ "browser.unavailable": "The browser listener could not start; control remains if started, or loopback is attempted.",
28914
+ "browser.unavailable-degraded": "No browser listener was started (`reason=no-tailscale-address`); control remains if started, or loopback is attempted.",
28915
+ "loopback.listening": "The loopback client listener is up.",
28916
+ "loopback.unavailable": "The loopback client listener could not start.",
28917
+ "auth-token.stored": "The gateway token's file was written. The path only, never the token.",
28918
+ "auth-token.persist-failed": "The gateway token could not be saved.",
28919
+ "port.fallback": "The preferred port was taken, so a nearby one is used.",
28920
+ "port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
28921
+ "request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
28922
+ "websocket.upgrade-failed": "A WebSocket upgrade failed.",
28923
+ "events.client-dropped": "An event-stream client buffered too much and was dropped; it reconnects and refetches.",
28924
+ "proxy.client-disconnected": "A proxy client went away, so its upstream request was aborted.",
28925
+ "throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
28926
+ "throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
28927
+ "throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
28928
+ }
28929
+ },
28930
+ "gateway.terminal": {
28931
+ description: "The gateway's terminal WebSocket.",
28932
+ events: {
28933
+ "upgrade-rejected": "A terminal WebSocket upgrade was refused.",
28934
+ "socket-error": "A terminal WebSocket reported an error.",
28935
+ "subscription-failed": "A terminal subscription failed.",
28936
+ "operation-failed": "A terminal operation failed. Fixed text: the operation can hold terminal input."
28937
+ }
28938
+ },
28939
+ "gateway.tailscale": {
28940
+ description: "Tailscale Serve for desktop web access and a standalone backend.",
28941
+ events: {
28942
+ "web-access.disable-failed": "Desktop web access could not be turned off.",
28943
+ "web-access.enable-failed": "Desktop web access could not be turned on.",
28944
+ "web-access.cleanup-failed": "Cleaning up after a failed enable also failed.",
28945
+ "web-access.reset-failed": "Desktop web access could not be reset.",
28946
+ "startup.init-failed": "Desktop web access could not be initialized at startup.",
28947
+ available: "Tailscale Serve is publishing the gateway."
28834
28948
  }
28835
28949
  }
28836
28950
  });
@@ -28841,6 +28955,18 @@ var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
28841
28955
  description: "Agent bridge processes the backend runs on the host.",
28842
28956
  events: {
28843
28957
  "bridge.not-answering": "A bridge with work in progress fails health checks, so it is not restarted yet.",
28958
+ "bridge-runtime.installing": "A bridge runtime is being installed.",
28959
+ "bridge-runtime.installed": "A bridge runtime finished installing.",
28960
+ "opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
28961
+ "server.stopping": "A local server is being stopped, for the fixed `reason` given.",
28962
+ "reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
28963
+ "reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
28964
+ "reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
28965
+ "reaper.runtime-root-remove-failed": "A claude-tmux runtime root could not be removed; it stays for a retry.",
28966
+ "reaper.server-unidentified": "An orphan candidate could not be identified, so its record is kept.",
28967
+ "reaper.server-refused": "An orphan candidate leads no process group, so it was not reaped.",
28968
+ "reaper.server-reaping": "An orphaned server is being stopped.",
28969
+ "reaper.server-kill-failed": "An orphaned server did not exit.",
28844
28970
  ...THROTTLE_LOG_EVENTS
28845
28971
  }
28846
28972
  }
@@ -28882,7 +29008,12 @@ var MODEL_LOG_AREAS = defineLogAreas({
28882
29008
  models: {
28883
29009
  description: "Agent model catalogues and their persistent caches.",
28884
29010
  events: {
28885
- "cache.write-failed": "A successful catalogue refresh could not update the host cache."
29011
+ "cache.write-failed": "A successful catalogue refresh could not update the host cache.",
29012
+ "seed.pi-failed": "The host Pi model catalogue could not be seeded; the next launch retries.",
29013
+ "bridge.not-ready": "The first-use catalogue bridge did not become ready.",
29014
+ "bridge.start-failed": "The first-use catalogue bridge failed to start.",
29015
+ "probe.exit-unclean": "A catalogue probe or sign-in server did not exit cleanly.",
29016
+ "download.deferred": "A model catalogue could not be downloaded yet."
28886
29017
  }
28887
29018
  }
28888
29019
  });
@@ -28893,8 +29024,62 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
28893
29024
  description: "Native agent sessions and what the backend reads from their bridges.",
28894
29025
  events: {
28895
29026
  "catalogue.outdated-bridge": "A bridge predates the command catalogue, so its commands stay unavailable.",
29027
+ "compact.instructions-ignored": "A bridge compacted without confirming the instructions sent with /compact: it predates them.",
29028
+ "handoff.summary-read-failed": "Change summaries could not be read for a handoff, so the carrier says they are unmeasured.",
29029
+ "handoff.consume-failed": "A delivered handoff could not be marked consumed.",
29030
+ "job.pr-refresh-rollback-failed": "Rolling back a pull request refresh for a job failed.",
29031
+ "job.resend-queue-failed": "A resend could not be queued for a job.",
29032
+ "interaction.requests-dropped": "Interaction requests that could not be mapped were dropped.",
29033
+ "interaction.observe-failed": "Observing a session's interactions failed. Error class only.",
29034
+ "human-prompt.listener-failed": "A human prompt listener threw; the others still run.",
29035
+ "question.attention-record-failed": "Attention for an async question could not be recorded; the transcript stays readable.",
29036
+ "activity.reconcile-failed": "Reconciling an environment's activity failed. Error class only.",
29037
+ "activity.persist-failed": "An environment's activity could not be saved.",
29038
+ "pr-refresh.schedule-failed": "A pull request refresh after completion could not be scheduled.",
29039
+ "launch.startup-failed": "A startup launch failed; it retries unless `permanent`.",
29040
+ "queue.failing": "A native prompt queue keeps failing. The key and reason only, never the prompt.",
29041
+ "provider.retire-failed": "Retiring an obsolete provider failed.",
29042
+ "workflow-result.store-unavailable": "The workflow result store is unavailable, so the provider's result is used.",
29043
+ "catalogue.refresh-failed": "A provider's command catalogue could not be refreshed.",
29044
+ "dispatch.attach-failed": "Attaching an agent before dispatch failed; the prompt request answers authoritatively.",
29045
+ "coordinator-context.ack-failed": "Coordinator repository context could not be acknowledged.",
29046
+ "naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
29047
+ "interrupt.persist-failed": "A turn interrupt could not be saved, so automatic publication stays fenced.",
29048
+ "resume.close-replaced-failed": "The session a resume replaced could not be closed.",
29049
+ "sign-in.check-failed": "A turn could not be checked for a login refusal.",
29050
+ "sign-in.resend-failed": "Sending refused prompts after sign-in failed.",
29051
+ "sign-in.prompt-resend-failed": "One refused prompt could not be sent again after sign-in. Error class only.",
29052
+ "shutdown.checkpoints-skipped": "Shutdown skipped display-tail checkpoints; provider history stays authoritative. Count only.",
29053
+ "turn-recovery.failed": "Recovering an incomplete turn failed.",
29054
+ "turn-recovery.exhausted": "A turn failed again after automatic recovery and is left for the user.",
29055
+ "turn-recovery.retrying": "An incomplete or provider-failed turn is being retried automatically.",
29056
+ "usage-limit.resend-failed": "Resending after a usage limit failed. An unknown send stays in the journal.",
29057
+ "title.strategy-failed": "A session title strategy failed, so the next is tried. Content-free: the error can quote the prompt.",
28896
29058
  ...THROTTLE_LOG_EVENTS
28897
29059
  }
29060
+ },
29061
+ "native-agent.goal": {
29062
+ description: "The /goal loop: advancing goals and their verifiers.",
29063
+ events: {
29064
+ "advance.failed": "A goal could not advance; the next sweep retries.",
29065
+ "attention.record-failed": "Attention for a goal could not be recorded.",
29066
+ "turn-end.settle-failed": "Turn-end work for a goal could not be settled.",
29067
+ "verifier.finish-failed": "A verifier failed to finish; the goal stays verifying, so the next sweep runs it again.",
29068
+ "verifier.stop-failed": "An earlier verifier could not be stopped.",
29069
+ "recover.failed": "Goals could not be recovered at startup."
29070
+ }
29071
+ },
29072
+ "native-agent.opencode": {
29073
+ description: "The OpenCode provider: its request monitor, retries and agent tools.",
29074
+ events: {
29075
+ "retry.abort-failed": "Aborting an automatic retry failed. Error class only.",
29076
+ "retry.abort-not-scheduled": "An automatic retry abort could not be scheduled. Error class only.",
29077
+ "agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
29078
+ "coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
29079
+ "monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
29080
+ "worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
29081
+ "request.failed": "Handling a request event failed, so the stream restarts. Error class only."
29082
+ }
28898
29083
  }
28899
29084
  });
28900
29085
 
@@ -28917,6 +29102,17 @@ var PREVIEW_LOG_AREAS = defineLogAreas({
28917
29102
  "partitions.retry-forgotten-failed": "Retrying a forgotten preview cleanup failed.",
28918
29103
  "port-hints.persist-failed": "Preview port hints could not be saved.",
28919
29104
  "transport.close-failed": "A preview transport could not be closed.",
29105
+ "ca-bundle.read-failed": "The upstream CA bundle could not be read.",
29106
+ "publication.start-failed": "Private preview publication did not start.",
29107
+ "publication.reconfigure-failed": "Preview publication could not be reconfigured.",
29108
+ "publication.listening": "Private preview origins are listening.",
29109
+ "certificate.reloaded": "The preview certificate was reloaded.",
29110
+ "access.revoked-close-failed": "A revoked preview resource could not be closed. Error class only.",
29111
+ "registry.invalid-definition": "An invalid stored preview service definition was ignored.",
29112
+ "registry.environment-reconcile-failed": "An environment's preview services could not be reconciled.",
29113
+ "registry.resolver-failed": "A preview resolver failed. Error class only.",
29114
+ "registry.revocation-listener-failed": "A preview revocation listener threw. Error class only.",
29115
+ "registry.change-emit-failed": "A preview change event could not be emitted. Error class only.",
28920
29116
  ...THROTTLE_LOG_EVENTS
28921
29117
  }
28922
29118
  }
@@ -28935,9 +29131,33 @@ var RUNTIME_LOG_AREAS = defineLogAreas({
28935
29131
  // ../protocol/src/log-vocabulary/terminal.ts
28936
29132
  var TERMINAL_LOG_AREAS = defineLogAreas({
28937
29133
  terminal: {
28938
- description: "The renderer's terminal. Its lines stay in the browser console, never the saved log.",
29134
+ description: "Terminals. The renderer's lines stay in the browser console; the backend's reach the saved log.",
28939
29135
  events: {
28940
29136
  "input.undelivered": "A keystroke did not reach a shell: `no-session` or `not-delivered`.",
29137
+ "orphan.reaped": "A terminal no tab references was closed.",
29138
+ "agent-completion.notify-failed": "A terminal agent's completion could not be reported.",
29139
+ "activity.record-failed": "Terminal environment activity could not be recorded.",
29140
+ "pty.exit-listener-failed": "A terminal exit listener threw; the others still run.",
29141
+ "pty.exit-notify-failed": "Notifying a terminal's exit failed.",
29142
+ "pty.late-exit-listener-failed": "A listener added after a terminal exited threw.",
29143
+ "setup.pty-reused": "A setup terminal reused its existing PTY.",
29144
+ "setup.pty-spawning": "A setup terminal is spawning its PTY. The argument count only, never the arguments.",
29145
+ "setup.pty-spawned": "A setup terminal's PTY started.",
29146
+ "setup.pty-exited": "A setup terminal's PTY exited.",
29147
+ "setup.preparing": "Workspace preparation started in the setup terminal.",
29148
+ "setup.session-creating": "A setup session is being created.",
29149
+ "setup.intro-emitted": "The setup intro was written to the terminal.",
29150
+ "setup.completed": "Setup finished.",
29151
+ "setup.failed": "Setup failed.",
29152
+ "setup.already-complete": "Setup was requested but had already finished.",
29153
+ "setup.renderer-ensured": "The renderer asked for setup to be running.",
29154
+ "setup.renderer-requested": "The renderer asked for the setup session.",
29155
+ "setup.renderer-requested-none": "The renderer asked for a setup session that does not exist.",
29156
+ "setup.no-commands": "An environment has no setup commands to run.",
29157
+ "setup.already-running": "Setup was requested while it was already running.",
29158
+ "setup.held-for-approval": "Setup is held until its commands are approved.",
29159
+ "setup.renderer-checked-session": "The renderer asked whether a setup terminal session exists.",
29160
+ "setup.renderer-requested-buffer": "The renderer asked for a setup terminal's output buffer. A size only, never its contents.",
28941
29161
  "input.resume-failed": "Asking the backend to resume refused terminal input failed.",
28942
29162
  "input.write-failed": "Writing input to a terminal session threw.",
28943
29163
  "listener.remove-failed": "Removing a terminal output listener threw.",
@@ -29037,13 +29257,41 @@ var TERMINAL_LOG_AREAS = defineLogAreas({
29037
29257
  // ../protocol/src/log-vocabulary/tmux.ts
29038
29258
  var TMUX_LOG_AREAS = defineLogAreas({
29039
29259
  tmux: {
29040
- description: "The poll loop behind a Claude tmux tab.",
29260
+ description: "Claude tmux tabs: launch, the poll loop, cleanup and the tmux prompt queue.",
29041
29261
  events: {
29042
29262
  "poll.discovery-failed": "Finding the session's transcript failed; a later tick retries.",
29043
29263
  "poll.snapshot-failed": "Reading the hook and transcript state failed; the next tick retries.",
29044
29264
  "poll.drain-pending-failed": "Delivering pending hook events failed; the next tick retries.",
29045
29265
  "poll.drain-timeouts-failed": "Delivering hook timeouts failed; the next tick retries.",
29046
29266
  "poll.tail-failed": "Reading new transcript lines failed; the next tick retries.",
29267
+ "cleanup.session-stop-failed": "A tmux session could not be stopped while cleaning up an environment.",
29268
+ "cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
29269
+ "cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
29270
+ "cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
29271
+ "hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
29272
+ "hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
29273
+ "naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
29274
+ "orphans.skipped": "Orphan reconciliation was skipped because pane layouts are unreadable.",
29275
+ "orphan.reaped": "A tmux session no tab references was killed.",
29276
+ "orphan.kill-skipped": "An orphan tmux kill was skipped because the tmux server could not be reached.",
29277
+ "cli.thinking-display-probe-failed": "Probing the CLI for --thinking-display failed, so it launches without it.",
29278
+ "cli.fast-mode-unsupported": "The claude CLI lacks --settings, so it launches without fast mode.",
29279
+ "cli.effort-unsupported": "The claude CLI lacks --effort, so it launches without it.",
29280
+ "interactive.snapshot-failed": "An interactive snapshot failed; expected while a pane is closing.",
29281
+ "signal.arm-failed": "The Claude state signal could not be armed.",
29282
+ "signal.degraded": "The Claude state signal missed a change or rang too often, so polling stays at one second until it is re-armed.",
29283
+ "hook-signal.arm-failed": "The tmux hook doorbell could not be armed.",
29284
+ "hook-signal.degraded": "The tmux hook doorbell missed a hook, so idle tabs poll every second until it is re-armed.",
29285
+ "pr-refresh.schedule-failed": "A pull request refresh after a turn could not be scheduled.",
29286
+ "pr-probe.failed": "Probing for a pull request an agent created failed.",
29287
+ "activity.persist-failed": "Tmux tab activity could not be saved.",
29288
+ "fast-mode.persist-failed": "The launch fast mode could not be saved.",
29289
+ "fast-mode.repair-failed": "Fast mode metadata could not be repaired on a reattached session.",
29290
+ "pane.observe-failed": "A pane observation failed. Error class only: pane contents are sensitive.",
29291
+ "turn.failure-record-failed": "A failed turn could not be recorded.",
29292
+ "slash-command.settle-timeout": "Timed out waiting for a Claude slash command to settle.",
29293
+ "queue.failing": "A tmux prompt queue keeps failing to dispatch.",
29294
+ "queue.rename-failed": "An environment could not be named from its first prompt; the prompt still goes ahead.",
29047
29295
  ...THROTTLE_LOG_EVENTS
29048
29296
  }
29049
29297
  }
@@ -29070,7 +29318,8 @@ var UPDATER_LOG_AREAS = defineLogAreas({
29070
29318
  "remote.unavailable": "Updates requested by remote clients are unavailable in this session.",
29071
29319
  "restart-prompt.failed": "The restart prompt for a downloaded update failed.",
29072
29320
  unavailable: "Auto-update could not be set up in this session.",
29073
- "update.failed": "electron-updater reported an update error."
29321
+ "update.failed": "electron-updater reported an update error.",
29322
+ "standalone.restarting": "A standalone backend is restarting into a new version."
29074
29323
  }
29075
29324
  }
29076
29325
  });
@@ -29081,11 +29330,473 @@ var WEB_ANNOTATIONS_LOG_AREAS = defineLogAreas({
29081
29330
  description: "Web annotation requests and their background reconciler.",
29082
29331
  events: {
29083
29332
  "reconcile.failed": "A background reconcile pass failed; the next one retries.",
29333
+ "legacy.degraded": "Legacy annotation storage is damaged, so the previous committed copy is served read-only.",
29334
+ "legacy.draft-index-problem": "The legacy draft index could not be used; `status` says why.",
29335
+ "legacy.unreadable-records": "The legacy import found unreadable records; they stay unread.",
29336
+ "legacy.unavailable": "Legacy annotation storage could not be read.",
29337
+ "legacy.unreadable": "An environment's legacy annotation storage is unreadable.",
29338
+ "legacy.archive-failed": "Imported legacy annotation files could not be archived.",
29339
+ "legacy.files-archived": "Legacy files beside an imported environment were archived, not imported.",
29340
+ "migration.draft-failed": "Migrating one draft failed.",
29341
+ "draft-reconcile.deferred": "Draft reconciliation was deferred; a later pass retries.",
29342
+ "request.handoff-deferred": "A request's handoff was deferred; a later pass retries.",
29343
+ "evidence.materialize-failed": "Materializing a request's evidence failed; it backs off and retries.",
29344
+ "queue.publish-deferred": "Publishing a request to the queue was deferred; it retries under the same id.",
29345
+ "request.reconcile-failed": "Reconciling a request failed; the next pass retries.",
29346
+ "turn-end.reconcile-failed": "Reconciling a request at the end of a turn failed; the next pass retries.",
29347
+ "gc.failed": "Annotation garbage collection failed; the next pass retries.",
29348
+ "record.unavailable": "An annotation record is unavailable; written once per record.",
29349
+ "storage.unavailable": "An environment's annotation store is unreadable.",
29350
+ "change-hint.listener-failed": "A change hint listener threw.",
29351
+ "orphan.remove-failed": "An orphaned environment's annotation storage could not be removed.",
29352
+ "storage.load-failed": "An environment's annotation storage could not be loaded.",
29084
29353
  ...THROTTLE_LOG_EVENTS
29085
29354
  }
29086
29355
  }
29087
29356
  });
29088
29357
 
29358
+ // ../protocol/src/log-vocabulary/storage.ts
29359
+ var STORAGE_LOG_AREAS = defineLogAreas({
29360
+ storage: {
29361
+ description: "The SQLite-backed stores, their snapshots and imports from older formats.",
29362
+ events: {
29363
+ "usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
29364
+ "snapshot.integrity-failed": "An hourly database snapshot failed its integrity check and was discarded.",
29365
+ "snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
29366
+ "snapshot.failed": "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
29367
+ "listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
29368
+ "listener.change-failed": "A resource change listener threw; the committed mutation stands.",
29369
+ "kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
29370
+ "nodes.entries-dropped": "Unreadable node registry entries were ignored.",
29371
+ "preview-identity.reminted": "The data directory moved or was copied, so previews get a new backend identity.",
29372
+ "machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
29373
+ "permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
29374
+ "retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
29375
+ "handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
29376
+ "desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
29377
+ "legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
29378
+ "legacy-json.archive-failed": "Imported JSON store files could not be archived."
29379
+ }
29380
+ }
29381
+ });
29382
+
29383
+ // ../protocol/src/log-vocabulary/build-pipeline.ts
29384
+ var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
29385
+ "build-pipeline": {
29386
+ description: "Build pipelines: their supervision, stages, transcripts and sidebar state.",
29387
+ events: {
29388
+ "sidebar.reconcile-failed": "Sidebar activity for pipelines could not be reconciled.",
29389
+ "sidebar.update-failed": "The sidebar could not be updated for one pipeline.",
29390
+ "result.consume-deferred": "Consuming a stage's workflow result failed; it stays staged and is retried.",
29391
+ "consolidation.consume-deferred": "Consuming a review consolidation result failed; it stays pending and is retried.",
29392
+ "dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request does the same work and answers authoritatively.",
29393
+ "interaction.resolved": "A human interaction on a pipeline stage resolved. Metadata only.",
29394
+ "transcripts.migrated": "A transcript migration pass moved stage transcripts; counts only.",
29395
+ "transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
29396
+ "restore.skipped": "A pipeline could not be restored at startup and was skipped.",
29397
+ "criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
29398
+ "workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
29399
+ "rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
29400
+ "kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
29401
+ "usage.read-failed": "Reading a stage session's token usage failed.",
29402
+ "checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
29403
+ "checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
29404
+ "legacy-transcript.deferred": "Moving a legacy inline transcript failed; the inline body stays readable."
29405
+ }
29406
+ }
29407
+ });
29408
+
29409
+ // ../protocol/src/log-vocabulary/agent-branch.ts
29410
+ var AGENT_BRANCH_LOG_AREAS = defineLogAreas({
29411
+ "agent-branch": {
29412
+ description: "Agent branches shared by review fan-outs, graph agents and goal verifiers; `owner` names which.",
29413
+ events: {
29414
+ "observation.checkpoint-failed": "Checkpointing reviewer observations failed; the next pass retries.",
29415
+ "transcript.mirror-failed": "Mirroring a reviewer transcript failed.",
29416
+ "usage.read-failed": "Reading a reviewer's token usage failed.",
29417
+ "result.nudge-failed": "An agent with an uncommitted result could not be nudged.",
29418
+ "dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request answers authoritatively.",
29419
+ "result.consume-deferred": "Consuming a branch's workflow result failed; it stays staged and is retried."
29420
+ }
29421
+ }
29422
+ });
29423
+
29424
+ // ../protocol/src/log-vocabulary/change-tracking.ts
29425
+ var CHANGE_TRACKING_LOG_AREAS = defineLogAreas({
29426
+ "change-tracking": {
29427
+ description: "Change tracking: turn capture, evidence pulls and measurements.",
29428
+ events: {
29429
+ "journal-import.failed": "Importing surviving OpenCode command journals as legacy summaries failed.",
29430
+ "projection.failed": "Projecting a change event onto its environment failed.",
29431
+ "startup.reconcile-failed": "Reconciling change tracking at startup failed.",
29432
+ "turn-start.capture-failed": "Capturing a turn's start failed, so the turn is untracked.",
29433
+ "dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
29434
+ "turn.finalize-failed": "Finalizing a turn failed.",
29435
+ "turn.settle-failed": "Settling a late interrupted turn failed.",
29436
+ "evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
29437
+ "measurement.failed": "Recomputing a tool's measurement failed."
29438
+ }
29439
+ },
29440
+ "diff-stats": {
29441
+ description: "Environment diff stats and the worktree signals that drive them.",
29442
+ events: {
29443
+ "baseline.update-failed": "An environment's diff baseline could not be updated.",
29444
+ "scan.watcher-failed": "An environment's diff watcher failed; its scans fall back to polling.",
29445
+ "scan.failed": "A diff scan failed; the last results stay, marked stale, and the scan is retried.",
29446
+ "scan.freshness-read-failed": "Reading whether an environment's remote is fresh failed.",
29447
+ "scan.listener-failed": "A change-tracking scan listener threw; the scan itself stands.",
29448
+ "emit.diff-stats-failed": "A diff stats change could not be emitted to its sink.",
29449
+ "emit.worktree-snapshot-failed": "A worktree snapshot could not be emitted to its sink.",
29450
+ "signal.demoted": "A worktree signal stopped being trusted, so scans fall back to timers until it is re-armed."
29451
+ }
29452
+ }
29453
+ });
29454
+
29455
+ // ../protocol/src/log-vocabulary/coordinator.ts
29456
+ var COORDINATOR_LOG_AREAS = defineLogAreas({
29457
+ coordinator: {
29458
+ description: "Coordinators: delegations, status wakes and their store.",
29459
+ events: {
29460
+ "delegation.open-failed": "A delegation could not be opened; `source` says for what.",
29461
+ "deliver-now.drain-failed": "The mail delivery pass after deliverNow failed; the next sweep delivers.",
29462
+ "mail.move-failed": "Mail could not move to the new main coordinator.",
29463
+ "work.move-failed": "Work could not move to the main coordinator.",
29464
+ "wake.observe-remote-workflow-failed": "A remote workflow could not be observed for status wakes.",
29465
+ "wake.observe-pull-request-failed": "A pull request could not be observed for status wakes.",
29466
+ "wake.observe-feature-plan-failed": "A feature plan could not be observed for status wakes.",
29467
+ "wake.observe-workflow-failed": "A workflow could not be observed for status wakes.",
29468
+ "wake.deliver-failed": "A workflow status wake could not be delivered; the next pass retries.",
29469
+ "wake.waiting-check-failed": "A waiting worker could not be checked; the next pass retries.",
29470
+ "wake.resolve-report-failed": "A finished Resolve tab could not be reported.",
29471
+ "wake.waiting-report-failed": "A waiting worker could not be reported.",
29472
+ "wake.worker-outcomes-failed": "Coordinator-owned workers' merges and deletions could not be checked; the next sweep retries.",
29473
+ "store.malformed": "The coordinator store was malformed and is treated as empty.",
29474
+ "store.unsupported-version": "The coordinator store has an unsupported version and is treated as empty.",
29475
+ "store.invalid-workspace": "An invalid coordinator workspace record was ignored.",
29476
+ "store.workflows-cleared": "The workflow store was full, so a batch of its oldest finished records was removed.",
29477
+ "store.workflows-in-use": "The workflow store was full and every record was still in use, so new work was refused.",
29478
+ "remote-worker.settle-failed": "A remote worker could not be settled.",
29479
+ "checkout.merge-followed": "After an environment's PR merged, the project checkout was fast-forwarded, or `outcome` says why not.",
29480
+ "checkout.merge-follow-failed": "Fast-forwarding the project checkout failed, after an environment's PR merged or before mail woke the main coordinator.",
29481
+ "checkout.mail-follow": "Before mail woke the main coordinator, the project checkout was fast-forwarded, or `outcome` says why not (`timed-out`, `failed`).",
29482
+ "checkout.mail-follow-failed": "Before mail woke the main coordinator, checking whether to fast-forward the project checkout failed; the mail was delivered anyway."
29483
+ }
29484
+ }
29485
+ });
29486
+
29487
+ // ../protocol/src/log-vocabulary/review.ts
29488
+ var REVIEW_LOG_AREAS = defineLogAreas({
29489
+ review: {
29490
+ description: "Multi Review workflows: scheduling, graph runs and interactive fix sessions.",
29491
+ events: {
29492
+ "fix-tab.publish-failed": "A fix request was delivered but its tab could not be opened; the user is told.",
29493
+ "graph-run.not-started": "A workflow's graph run did not start.",
29494
+ "reconcile.scan-failed": "A reconciliation scan failed; the next scan retries.",
29495
+ "graph-engine.unavailable": "The graph engine is selected but unavailable, so the bespoke engine runs.",
29496
+ "graph-run.cancel-failed": "Cancelling a graph run failed; the next pass projects how it ended.",
29497
+ "delete.cleanup-failed": "A cleanup step after deleting a workflow failed; stale tabs reconcile away on hydration.",
29498
+ "fix-session.read-failed": "Reading an interactive fix session's state failed.",
29499
+ "fix-outcome.read-failed": "Reading an interactive fix's outcome failed; it stays pending.",
29500
+ "fix-usage.read-failed": "Reading a fix session's token usage failed.",
29501
+ "result.consume-deferred": "Consuming a workflow result failed; it stays staged and is retried.",
29502
+ "failure-triage.failed": "Classifying a review package's failing tests failed; the package is sealed without the triage and says so."
29503
+ }
29504
+ },
29505
+ "pull-request": {
29506
+ description: "Pull request monitoring, auto-merge and the `gh` reads behind them.",
29507
+ events: {
29508
+ "merged-state.persist-failed": "A merged pull request's state could not be saved; GitHub stays authoritative and cleanup goes on.",
29509
+ "refresh.failed": "A pull request could not be refreshed; the armed flag stands.",
29510
+ "arm.track-failed": "An armed environment could not be tracked; the monitor's next sync retries.",
29511
+ "gh.pr-list-unparseable": "`gh pr list` returned nothing that parses. Sizes only, never the output.",
29512
+ "monitor.start-failed": "Monitoring could not start for a newly opened pull request.",
29513
+ "cleanup-scheduler.missing": "A merged pull request was seen, but this runtime has no merge cleanup scheduler.",
29514
+ "checkout.follow-merge-lookup-failed": "A merged pull request's project could not be read, so its checkout was not fast-forwarded.",
29515
+ "auto-merge.evaluation-failed": "Evaluating an environment for auto-merge failed.",
29516
+ "auto-merge.merge-failed": "Auto-merge could not merge a pull request; the attempt is held and retried.",
29517
+ "auto-merge.resolve-failed": "Auto-merge could not launch Resolve for a pull request; the attempt is held and retried.",
29518
+ "monitor.detection-failed": "Checking an environment for its pull request failed.",
29519
+ "monitor.detection-admission-failed": "A pull request check could not be admitted to the work pool.",
29520
+ "monitor.terminal-repair-failed": "Repairing a merged or closed pull request's side effects failed.",
29521
+ "monitor.terminal-resume-failed": "Resuming a merged or closed pull request's side effects failed.",
29522
+ "monitor.stale-reading-ignored": "A non-merged reading (`state`) for a pull request already merged was ignored as stale.",
29523
+ "monitor.state-persist-failed": "A pull request's observed state could not be saved.",
29524
+ "monitor.state-clear-failed": "A pull request's saved state could not be cleared.",
29525
+ "monitor.task-reconcile-failed": "Updating the Kanban task of a merged or closed (`state`) pull request failed.",
29526
+ "monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
29527
+ "monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
29528
+ }
29529
+ }
29530
+ });
29531
+
29532
+ // ../protocol/src/log-vocabulary/public-api.ts
29533
+ var PUBLIC_API_LOG_AREAS = defineLogAreas({
29534
+ "public-api": {
29535
+ description: "The public CLI's operations: their outcomes, reconciliation and exec workers.",
29536
+ events: {
29537
+ "outcome.record-failed": "A background operation's outcome could not be recorded; reconciliation settles it.",
29538
+ "goal-checks.stop-failed": "Goal checks could not be stopped.",
29539
+ "exec.list-failed": "Exec workers could not be listed.",
29540
+ "exec.cancel-failed": "An exec could not be cancelled.",
29541
+ "goal-workers.list-failed": "Goal check workers could not be listed.",
29542
+ "operation.reconcile-failed": "Reconciling one operation failed; the next pass retries.",
29543
+ "reconcile.pass-failed": "A reconciliation pass failed; the next one retries."
29544
+ }
29545
+ }
29546
+ });
29547
+
29548
+ // ../protocol/src/log-vocabulary/agent-accounts.ts
29549
+ var AGENT_ACCOUNTS_LOG_AREAS = defineLogAreas({
29550
+ "agent-accounts": {
29551
+ description: "Agent accounts: automatic switching, staged logins and plan usage.",
29552
+ events: {
29553
+ "switch-notice.failed": "A notice about an automatic account switch failed; the switch stands. `audience` says whose.",
29554
+ "auto-switch.check-failed": "An automatic account check failed; the next nudge retries.",
29555
+ "container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
29556
+ "last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
29557
+ "login-cleanup.failed": "A temporary login could not be cleaned up.",
29558
+ "login-renewal.failed": "Renewing an idle account's sign-in to read its usage failed; it is retried after a backoff.",
29559
+ "login-renewal.not-extended": "Claude Code ran to renew an idle account's sign-in, but its token is still lapsed.",
29560
+ "login-refresh.deferred": "Containers were not told to refresh their login now; they reconcile from its durable generation."
29561
+ }
29562
+ }
29563
+ });
29564
+
29565
+ // ../protocol/src/log-vocabulary/docker.ts
29566
+ var DOCKER_LOG_AREAS = defineLogAreas({
29567
+ docker: {
29568
+ description: "Docker containers: lifecycle, starts, staged inputs and the login files they hold.",
29569
+ events: {
29570
+ "portable-inputs.relay-missing": "Docker is rootless and the image predates the staged-input relay, so the container cannot read them until rebuilt.",
29571
+ "project-seed.refused": "A project .env, .env.local or opencode.json was not copied into a new container: a link, not a regular file, outside the project, too large or unreadable.",
29572
+ "opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
29573
+ "lifecycle-event.reconcile-failed": "Reconciling an environment after a container start or stop event failed; the next status read retries.",
29574
+ "login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
29575
+ "login-keeper.refresh-failed": "Refreshing the host Claude login failed. Fixed text: CLI output can hold credentials.",
29576
+ "login-keeper.refresh-not-extended": "Refreshing the host Claude login did not extend its expiry.",
29577
+ "login-keeper.refresh-check-failed": "Checking the host Claude login after a refresh failed.",
29578
+ "login-watcher.pass-failed": "A container login file watcher pass failed; the next one retries.",
29579
+ "lifecycle.record-failure-failed": "A failed container operation could not be recorded.",
29580
+ "lifecycle.reconcile-failed": "Reconciling one environment's container operation failed; the next pass retries.",
29581
+ "replacement.clear-terminals-failed": "Terminal sessions could not be cleared after a container replacement.",
29582
+ "recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
29583
+ "github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
29584
+ "availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
29585
+ "start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports."
29586
+ }
29587
+ },
29588
+ "docker.reachability": {
29589
+ description: "Whether agents in containers can reach the backend's agent tools server.",
29590
+ events: {
29591
+ "check.crashed": "A reachability check crashed.",
29592
+ "check.started": "A reachability check started.",
29593
+ "check.finished": "A reachability check finished.",
29594
+ "check.probe": "One probe of a finished check.",
29595
+ "check.summary": "Content-free status and reason for a check that did not find the host reachable.",
29596
+ "check.remediation": "One command the user can run to unblock containers.",
29597
+ "shutdown.awaiting-network": "Shutdown is waiting for probe network preparation.",
29598
+ "shutdown.cleanup-deferred": "Probe network cleanup waits until its preparation settles.",
29599
+ "shutdown.removing-resources": "Shutdown is removing probe resources.",
29600
+ "shutdown.container-remove-failed": "A probe container could not be removed at shutdown.",
29601
+ "shutdown.network-remove-failed": "The probe network could not be removed at shutdown.",
29602
+ "probe.skipped": "A container probe was skipped because the agent tools server is not listening.",
29603
+ "preflight.refused": "A stage was refused because its container cannot reach the host.",
29604
+ "probe.prepare-failed": "A container could not be prepared for a probe.",
29605
+ "probe.result": "The outcome of probing one container.",
29606
+ "probe.contradicts-host": "A container probe disagrees with the host status, so the host is rechecked.",
29607
+ "topology.detected": "The Docker topology was read.",
29608
+ "firewall.detected": "The host firewall was read.",
29609
+ "probe-network.remove-failed": "The probe network could not be removed.",
29610
+ "probe-network.create-failed": "The probe network could not be created, so only the default bridge is checked.",
29611
+ "event.emit-failed": "A reachability event could not be emitted.",
29612
+ "host-addresses.list-failed": "Host addresses could not be listed.",
29613
+ "probe-image.present": "The probe image is already present.",
29614
+ "probe-image.pulling": "The probe image is being pulled.",
29615
+ "probe-image.pulled": "The probe image was pulled.",
29616
+ "probe-image.pull-failed": "The probe image could not be pulled.",
29617
+ "probe-image.fallback": "The environment image is used as the probe image.",
29618
+ "probe-image.missing": "No probe image is available.",
29619
+ "network.list-failed": "Docker networks could not be listed.",
29620
+ "network.inspect-failed": "A Docker network could not be inspected.",
29621
+ "stale-containers.removing": "Stale probe containers are being removed.",
29622
+ "stale-networks.removing": "Stale probe networks are being removed."
29623
+ }
29624
+ }
29625
+ });
29626
+
29627
+ // ../protocol/src/log-vocabulary/mcp.ts
29628
+ var MCP_LOG_AREAS = defineLogAreas({
29629
+ "control-mcp": {
29630
+ description: "The Control MCP server other agents and devices reach Orkestrator through.",
29631
+ events: {
29632
+ "listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
29633
+ "state-listener.failed": "A Control MCP state listener threw; the others still run.",
29634
+ "delegation.remote-open-failed": "A delegation could not be opened on another node.",
29635
+ "delegation.open-failed": "A coordinator delegation could not be opened."
29636
+ }
29637
+ },
29638
+ "mcp-management": {
29639
+ description: "Managed MCP configuration: its commands, overlays and apply loop.",
29640
+ events: {
29641
+ "command.failed": "An MCP management command failed; `ref` is the correlation id shown to the user.",
29642
+ "overlay.materialise-failed": "An MCP overlay could not be written.",
29643
+ "apply.tick-failed": "An MCP apply tick failed; the next one retries."
29644
+ }
29645
+ }
29646
+ });
29647
+
29648
+ // ../protocol/src/log-vocabulary/design.ts
29649
+ var DESIGN_LOG_AREAS = defineLogAreas({
29650
+ design: {
29651
+ description: "The design canvas: its library, renderer and session links.",
29652
+ events: {
29653
+ "change-signal.failed": "A design change signal failed.",
29654
+ "library.index-write-failed": "The design library index could not be written.",
29655
+ "library.refresh-failed": "The design library could not be refreshed.",
29656
+ "renderer.problem": "The renderer hit a limit or lost a browser; `problem` is a fixed name.",
29657
+ "task.failed": "A design background task failed.",
29658
+ "canvas.needs-recovery": "A design canvas is unreadable and marked for recovery.",
29659
+ "startup.step-failed": "One part of design startup failed; `step` says which.",
29660
+ "legacy.retire-failed": "A migrated legacy design could not be retired.",
29661
+ "profiles.swept": "Design startup removed stale browser profiles.",
29662
+ "session-link.record-failed": "A closing conversation could not be recorded on a design link."
29663
+ }
29664
+ }
29665
+ });
29666
+
29667
+ // ../protocol/src/log-vocabulary/graph.ts
29668
+ var GRAPH_LOG_AREAS = defineLogAreas({
29669
+ graph: {
29670
+ description: "Graph runs: launches, passes, rewinds, system actions and templates.",
29671
+ events: {
29672
+ "describe.pass-failed": "A graph describe pass failed. Content-free: never the description or draft.",
29673
+ "system.stop-failed": "A system action's work could not be stopped.",
29674
+ "system.action-failed": "A system action failed; `cause` is its fixed failure cause.",
29675
+ "attention.update-failed": "The sidebar could not be updated for a run.",
29676
+ "launch.ticket-link-failed": "A launched run's ticket could not be linked.",
29677
+ "launch.started": "A graph run was launched.",
29678
+ "launch.swept": "Runs that ended without an environment were removed.",
29679
+ "rewind.pending": "A run's code rewind has not finished.",
29680
+ "rewind.applied": "A run was restarted or rewound.",
29681
+ "rewind.waiting": "A run waits for its code rewind to finish.",
29682
+ "history.pruned": "Finished runs beyond an environment's history were removed.",
29683
+ "history.prune-failed": "Pruning an environment's run history failed.",
29684
+ "worktree.cleanup-failed": "A run's branch worktree cleanup failed.",
29685
+ "run.unreadable": "A run is unreadable, so it is not scheduled.",
29686
+ "run.pass-failed": "A pass over a run failed.",
29687
+ "transcript.capture-failed": "A run's transcript capture failed.",
29688
+ "ticket.link-failed": "A run's ticket could not be linked to its environment.",
29689
+ "template.skipped": "A built-in template was skipped as invalid or a duplicate."
29690
+ }
29691
+ }
29692
+ });
29693
+
29694
+ // ../protocol/src/log-vocabulary/nodes.ts
29695
+ var NODES_LOG_AREAS = defineLogAreas({
29696
+ nodes: {
29697
+ description: "Command nodes: links, handovers, leaf mail, ticket sync and project copies.",
29698
+ events: {
29699
+ "actions.resume-failed": "Approved actions could not be resumed; a later pass retries.",
29700
+ "project-copy.notify-failed": "The coordinator could not be told a project copy finished.",
29701
+ "mail.delivery-deferred": "Leaf mail could not reach a coordinator yet.",
29702
+ "command.post-step-failed": "A step after a routed command failed.",
29703
+ "seed-files.incomplete": "Seed files for a leaf environment were not all copied.",
29704
+ "contact.record-failed": "The latest controller contact could not be recorded.",
29705
+ "settings.send-failed": "Settings could not be sent to a node.",
29706
+ "verification.record-failed": "A node verification could not be recorded.",
29707
+ "profile.record-failed": "A node profile could not be recorded.",
29708
+ "detach.unconfirmed": "A forgotten node has not confirmed the detach yet.",
29709
+ "handover.recovery-pending": "Command handover recovery is still pending.",
29710
+ "ticket-sync.work-record-failed": "A remote build started but its ticket work location could not be saved.",
29711
+ "ticket-sync.failed": "A Kanban sync with a node failed; it is retried.",
29712
+ "ticket-sync.unknown-project": "A node sent ticket changes for a project that no longer exists here.",
29713
+ "ticket-sync.forget-failed": "A detached command node's ticket copies could not be released."
29714
+ }
29715
+ }
29716
+ });
29717
+
29718
+ // ../protocol/src/log-vocabulary/linear.ts
29719
+ var LINEAR_LOG_AREAS = defineLogAreas({
29720
+ linear: {
29721
+ description: "Linear issues read for build actions.",
29722
+ events: {
29723
+ "comments.load-failed": "An issue's comments could not be loaded; the issue still renders without them."
29724
+ }
29725
+ }
29726
+ });
29727
+
29728
+ // ../protocol/src/log-vocabulary/usage-history.ts
29729
+ var USAGE_HISTORY_LOG_AREAS = defineLogAreas({
29730
+ "usage-history": {
29731
+ description: "Recorded agent token usage.",
29732
+ events: {
29733
+ "record.failed": "Agent usage could not be recorded; a later read counts it.",
29734
+ "prune.failed": "Pruning recorded usage failed; the next prune retries."
29735
+ }
29736
+ }
29737
+ });
29738
+
29739
+ // ../protocol/src/log-vocabulary/feature.ts
29740
+ var FEATURE_LOG_AREAS = defineLogAreas({
29741
+ feature: {
29742
+ description: "Pipeline environments started from a feature, and feature planning.",
29743
+ events: {
29744
+ "naming.fallback": "Automatic naming failed, so a local fallback name is used. Error kind only: the description stays out.",
29745
+ "planning.legacy-adopt-failed": "Legacy planning conversations could not be adopted.",
29746
+ "planning.tick-retrying": "A planning tick failed on a transient error; the next tick retries."
29747
+ }
29748
+ }
29749
+ });
29750
+
29751
+ // ../protocol/src/log-vocabulary/host.ts
29752
+ var HOST_LOG_AREAS = defineLogAreas({
29753
+ host: {
29754
+ description: "The host machine: its executables, load, suspends and maintenance.",
29755
+ events: {
29756
+ "path.discovered": "Executable discovery finished. Counts and booleans only: PATH entries can hold private directory names.",
29757
+ "tool.available": "A host tool's availability was read.",
29758
+ "tool.missing": "A host tool was not found.",
29759
+ "maintenance.listener-failed": "A host maintenance listener threw; the others still run.",
29760
+ "suspend.reconcile-failed": "Reconciling due work after a host suspension failed.",
29761
+ "load.sample-failed": "Sampling machine load failed; the next sample retries."
29762
+ }
29763
+ }
29764
+ });
29765
+
29766
+ // ../protocol/src/log-vocabulary/transcript-artifacts.ts
29767
+ var TRANSCRIPT_ARTIFACTS_LOG_AREAS = defineLogAreas({
29768
+ "transcript-artifacts": {
29769
+ description: "Transcript artifacts: previews, printing, grants and their ledger. Ids, kinds, sizes and reason codes only.",
29770
+ events: {
29771
+ "announce-failed": "An artifact change could not be announced.",
29772
+ "cleanup-failed": "An artifact cleanup failed.",
29773
+ "grant-revocation-failed": "A grant could not be revoked.",
29774
+ "ledger-listener-failed": "A ledger listener threw.",
29775
+ "ledger-read-failed": "The ledger could not be read.",
29776
+ "operation-executor-failed": "A preview operation's executor failed.",
29777
+ "operation-failed": "A preview operation failed.",
29778
+ "pdf-preview": "A PDF preview was served.",
29779
+ "pdf-preview-failed": "A PDF preview failed.",
29780
+ "pdf-print-failed": "Printing an artifact to PDF failed.",
29781
+ "pdf-printed": "An artifact was printed to PDF.",
29782
+ "runtime-unavailable": "The artifact runtime could not be created."
29783
+ }
29784
+ }
29785
+ });
29786
+
29787
+ // ../protocol/src/log-vocabulary/scheduler.ts
29788
+ var SCHEDULER_LOG_AREAS = defineLogAreas({
29789
+ scheduler: {
29790
+ description: "Scheduled jobs and the backend-owned timing that fires them.",
29791
+ events: {
29792
+ "tick.failed": "A scheduler tick failed; the next tick retries.",
29793
+ "job.claim-failed": "A due job could not be claimed.",
29794
+ "fire.heartbeat-failed": "A running fire's heartbeat could not be recorded.",
29795
+ "fire.outcome-record-failed": "A finished fire's outcome could not be recorded."
29796
+ }
29797
+ }
29798
+ });
29799
+
29089
29800
  // ../protocol/src/log-vocabulary/web-app.ts
29090
29801
  var WEB_APP_LOG_AREAS = defineLogAreas({
29091
29802
  "web.app": {
@@ -29253,7 +29964,7 @@ var WEB_ENVIRONMENT_LOG_AREAS = defineLogAreas({
29253
29964
  "models.pi-seed-failed": "The create dialog could not seed the Pi model catalogue.",
29254
29965
  "models.opencode-cache-load-failed": "The create dialog could not read cached OpenCode models.",
29255
29966
  "github-credential.check-failed": "The GitHub credential check before creating failed.",
29256
- "feature-build.start-failed": "Starting a feature build from the dialog failed.",
29967
+ "feature-build.start-failed": "Starting a pipeline environment from the dialog failed.",
29257
29968
  "settings.extensions-load-failed": "The settings dialog could not load extensions.",
29258
29969
  "settings.container-reset-failed": "The settings dialog could not reset the container.",
29259
29970
  "settings.save-failed": "The settings dialog could not save.",
@@ -29545,6 +30256,25 @@ var LOG_VOCABULARY = {
29545
30256
  ...TMUX_LOG_AREAS,
29546
30257
  ...UPDATER_LOG_AREAS,
29547
30258
  ...WEB_ANNOTATIONS_LOG_AREAS,
30259
+ ...STORAGE_LOG_AREAS,
30260
+ ...BUILD_PIPELINE_LOG_AREAS,
30261
+ ...AGENT_BRANCH_LOG_AREAS,
30262
+ ...CHANGE_TRACKING_LOG_AREAS,
30263
+ ...COORDINATOR_LOG_AREAS,
30264
+ ...REVIEW_LOG_AREAS,
30265
+ ...PUBLIC_API_LOG_AREAS,
30266
+ ...AGENT_ACCOUNTS_LOG_AREAS,
30267
+ ...DOCKER_LOG_AREAS,
30268
+ ...MCP_LOG_AREAS,
30269
+ ...DESIGN_LOG_AREAS,
30270
+ ...GRAPH_LOG_AREAS,
30271
+ ...NODES_LOG_AREAS,
30272
+ ...LINEAR_LOG_AREAS,
30273
+ ...USAGE_HISTORY_LOG_AREAS,
30274
+ ...FEATURE_LOG_AREAS,
30275
+ ...HOST_LOG_AREAS,
30276
+ ...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
30277
+ ...SCHEDULER_LOG_AREAS,
29548
30278
  ...WEB_APP_LOG_AREAS,
29549
30279
  ...WEB_BUILD_PIPELINE_LOG_AREAS,
29550
30280
  ...WEB_CHAT_LOG_AREAS,
@@ -29722,7 +30452,10 @@ function deliver(record) {
29722
30452
  line: config2.format === "json" ? renderJson(record) : renderText(record),
29723
30453
  record
29724
30454
  });
29725
- } catch {}
30455
+ return true;
30456
+ } catch {
30457
+ return false;
30458
+ }
29726
30459
  }
29727
30460
  function buildRecord(level, area, event, fields) {
29728
30461
  const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
@@ -29878,6 +30611,19 @@ function resolveFields(fields) {
29878
30611
  return { fieldsFailed: true };
29879
30612
  }
29880
30613
  }
30614
+ function deliverEvent(level, area, event, fields) {
30615
+ const spec = areaSpec(area);
30616
+ if (!spec)
30617
+ return deliver(buildRecord(level, "logging", "unknown-area", undefined));
30618
+ if (!Object.hasOwn(spec.events, event))
30619
+ return deliver(buildRecord(level, area, "invalid-event", undefined));
30620
+ return deliver(buildRecord(level, area, event, fields));
30621
+ }
30622
+ function tryWriteLog(level, area, event, fields) {
30623
+ if (LEVEL_RANK[level] > thresholdRank(area))
30624
+ return false;
30625
+ return deliverEvent(level, area, event, resolveFields(fields));
30626
+ }
29881
30627
  function createLogger(area) {
29882
30628
  const spec = areaSpec(area);
29883
30629
  let seenGeneration = -1;
@@ -29890,13 +30636,7 @@ function createLogger(area) {
29890
30636
  return LEVEL_RANK[level] <= rank;
29891
30637
  };
29892
30638
  const writeResolved = (level, event, resolved) => {
29893
- if (!spec) {
29894
- deliver(buildRecord(level, "logging", "unknown-area", undefined));
29895
- } else if (Object.hasOwn(spec.events, event)) {
29896
- deliver(buildRecord(level, area, event, resolved));
29897
- } else {
29898
- deliver(buildRecord(level, area, "invalid-event", undefined));
29899
- }
30639
+ deliverEvent(level, area, event, resolved);
29900
30640
  };
29901
30641
  const write = (level, event, fields) => {
29902
30642
  if (!enabled(level))
@@ -30836,8 +31576,19 @@ import {
30836
31576
 
30837
31577
  // ../protocol/src/node/bridge-diagnostics.ts
30838
31578
  import { createHash as createHash2 } from "node:crypto";
30839
- var log3 = createLogger("bridge.diagnostics");
30840
- var INTERVAL_MS = 60000;
31579
+
31580
+ // ../protocol/src/event-loop-stall-monitor.ts
31581
+ var log3 = createLogger("event-loop");
31582
+ var EVENT_LOOP_STALL_ALWAYS_LOG_MS = 1e4;
31583
+
31584
+ // ../protocol/src/node/bridge-diagnostics.ts
31585
+ var log4 = createLogger("bridge.diagnostics");
31586
+ var BRIDGE_DIAGNOSTICS_INTERVAL_MS = 60000;
31587
+ var INTERVAL_MS = BRIDGE_DIAGNOSTICS_INTERVAL_MS;
31588
+ var STALL_NO_DELTA_MS = 2 * INTERVAL_MS;
31589
+ var STALL_TOOL_PENDING_MS = 10 * 60000;
31590
+ var STALL_TICK_DELAY_MS = EVENT_LOOP_STALL_ALWAYS_LOG_MS;
31591
+ var BRIDGE_DIAGNOSTICS_KEEPALIVE_MS = 10 * 60000;
30841
31592
  var MAX_PENDING_TOOLS = 128;
30842
31593
  var MAX_REPORTED_TOOLS = 8;
30843
31594
  var MAX_ID_LENGTH = 1024;
@@ -30898,6 +31649,28 @@ var UPDATE_KINDS = new Set([
30898
31649
  "step-started",
30899
31650
  "step-completed"
30900
31651
  ]);
31652
+ var COUNTER_CHANGE_THRESHOLDS = {
31653
+ stderrBytes: 4096,
31654
+ requestsSent: 1,
31655
+ responsesReceived: 1,
31656
+ timeouts: 1,
31657
+ notificationsReceived: Number.POSITIVE_INFINITY,
31658
+ protocolErrors: 1
31659
+ };
31660
+ var WAITING_PHASES = new Set([
31661
+ "sending",
31662
+ "following",
31663
+ "draining",
31664
+ "cancelling"
31665
+ ]);
31666
+ function sameSet(a, b) {
31667
+ if (a.size !== b.size)
31668
+ return false;
31669
+ for (const value of a)
31670
+ if (!b.has(value))
31671
+ return false;
31672
+ return true;
31673
+ }
30901
31674
  function identity(value) {
30902
31675
  if (typeof value !== "string" || !value || value.length > MAX_ID_LENGTH)
30903
31676
  return;
@@ -30973,26 +31746,35 @@ function safeDiagnosticMetrics(value) {
30973
31746
  result.state = value.state;
30974
31747
  return result;
30975
31748
  }
31749
+ function bridgeDiagnosticsChangesEnabled() {
31750
+ return log4.isEnabled("trace");
31751
+ }
30976
31752
  function writeBridgeDiagnostic({ bridge, event, payload }) {
30977
- log3.info(event, { bridge, payload });
31753
+ return tryWriteLog("info", "bridge.diagnostics", event, { bridge, payload });
30978
31754
  }
30979
31755
  function bridgeDiagnosticsActive() {
30980
- return log3.isEnabled("info");
31756
+ return log4.isEnabled("info");
31757
+ }
31758
+ function bridgeDiagnosticsStreamEnabled(bridge) {
31759
+ return bridgeDebugEnabled(bridge) || log4.isEnabled("debug");
30981
31760
  }
30982
31761
  function writeDiagnostic(bridge, event, payload, write) {
30983
31762
  try {
30984
31763
  const json = JSON.stringify({ bridge, event, ...payload });
30985
31764
  const bytes = Buffer.byteLength(json);
30986
31765
  if (bytes <= MAX_BRIDGE_DIAGNOSTIC_BYTES) {
30987
- write({ bridge, event, payload: json });
30988
- return;
31766
+ const accepted = write({ bridge, event, payload: json });
31767
+ return accepted !== false;
30989
31768
  }
30990
- write({
31769
+ const accepted = write({
30991
31770
  bridge,
30992
31771
  event: "snapshot-overflow",
30993
31772
  payload: JSON.stringify({ bridge, event: "snapshot-overflow", omittedBytes: bytes })
30994
31773
  });
30995
- } catch {}
31774
+ return accepted !== false;
31775
+ } catch {
31776
+ return false;
31777
+ }
30996
31778
  }
30997
31779
 
30998
31780
  class BridgeRunDiagnostics {
@@ -31024,6 +31806,7 @@ class BridgeRunDiagnostics {
31024
31806
  completedTools = 0;
31025
31807
  pending = new Map;
31026
31808
  phase = "sending";
31809
+ processScope = false;
31027
31810
  terminal = "pending";
31028
31811
  stream = "pending";
31029
31812
  cancellation = "none";
@@ -31031,6 +31814,8 @@ class BridgeRunDiagnostics {
31031
31814
  run;
31032
31815
  closed = false;
31033
31816
  wasActive;
31817
+ baseline;
31818
+ changeQueued = false;
31034
31819
  timer;
31035
31820
  constructor(bridge, state, now = Date.now, write = writeBridgeDiagnostic, intervalMs = INTERVAL_MS, metrics = () => ({}), active = () => true) {
31036
31821
  this.bridge = bridge;
@@ -31076,7 +31861,8 @@ class BridgeRunDiagnostics {
31076
31861
  return;
31077
31862
  }
31078
31863
  if (stage === "completed") {
31079
- this.pending.delete(key);
31864
+ if (this.pending.delete(key))
31865
+ this.changed();
31080
31866
  this.completedTools++;
31081
31867
  return;
31082
31868
  }
@@ -31091,13 +31877,23 @@ class BridgeRunDiagnostics {
31091
31877
  stage: stage === "started" || existing?.stage === "started" ? "started" : "partial",
31092
31878
  nested
31093
31879
  });
31880
+ if (!existing)
31881
+ this.changed();
31094
31882
  }
31095
31883
  checkpoint(phase) {
31884
+ if (phase === "attached")
31885
+ this.processScope = true;
31886
+ if (phase === this.phase)
31887
+ return;
31096
31888
  this.phase = phase;
31889
+ this.changed();
31097
31890
  }
31098
31891
  count(key, amount = 1) {
31099
- if (!this.closed && Number.isSafeInteger(amount) && amount >= 0)
31100
- this.counters[key] += amount;
31892
+ if (this.closed || !Number.isSafeInteger(amount) || amount < 0)
31893
+ return;
31894
+ this.counters[key] += amount;
31895
+ if (amount > 0 && Number.isFinite(COUNTER_CHANGE_THRESHOLDS[key]))
31896
+ this.changed();
31101
31897
  }
31102
31898
  translationFailed() {
31103
31899
  this.translationFailures++;
@@ -31113,8 +31909,10 @@ class BridgeRunDiagnostics {
31113
31909
  }
31114
31910
  terminalSettled(outcome) {
31115
31911
  this.terminal = outcome;
31116
- if (outcome === "resolved")
31912
+ if (outcome === "resolved" && this.phase !== "draining") {
31117
31913
  this.phase = "draining";
31914
+ this.changed();
31915
+ }
31118
31916
  }
31119
31917
  requestCancellation(reason = "user") {
31120
31918
  this.cancellation = "pending";
@@ -31136,12 +31934,38 @@ class BridgeRunDiagnostics {
31136
31934
  if (this.closed)
31137
31935
  return;
31138
31936
  const now = this.now();
31139
- const age = (time) => time === undefined ? null : Math.max(0, now - time);
31140
31937
  const tickDelayMs = event === "heartbeat" ? Math.max(0, now - this.lastTick - this.intervalMs) : 0;
31141
31938
  if (event === "heartbeat")
31142
31939
  this.lastTick = now;
31143
- if (!this.active() || !bridgeDiagnosticsActive())
31940
+ if (!bridgeDiagnosticsActive())
31941
+ return;
31942
+ const stall = this.stallState(now, tickDelayMs);
31943
+ if (event === "heartbeat" && !this.active() && !this.periodicDue(now, stall))
31944
+ return;
31945
+ this.writeSnapshot(event, now, tickDelayMs, stall);
31946
+ }
31947
+ changed() {
31948
+ if (this.closed || this.changeQueued || !bridgeDiagnosticsChangesEnabled())
31949
+ return;
31950
+ this.changeQueued = true;
31951
+ queueMicrotask(() => {
31952
+ this.changeQueued = false;
31953
+ this.reportChange();
31954
+ });
31955
+ }
31956
+ reportChange() {
31957
+ if (this.closed || !bridgeDiagnosticsChangesEnabled() || !bridgeDiagnosticsActive())
31144
31958
  return;
31959
+ const last = this.baseline;
31960
+ if (last && !this.changedSince(last))
31961
+ return;
31962
+ const now = this.now();
31963
+ try {
31964
+ this.writeSnapshot("change", now, 0, this.stallState(now, 0));
31965
+ } catch {}
31966
+ }
31967
+ writeSnapshot(event, now, tickDelayMs, stall) {
31968
+ const age = (time) => time === undefined ? null : Math.max(0, now - time);
31145
31969
  const pendingTools = Array.from(this.pending.entries()).slice(0, MAX_REPORTED_TOOLS).map(([id, tool]) => ({
31146
31970
  id,
31147
31971
  kind: tool.kind,
@@ -31150,7 +31974,7 @@ class BridgeRunDiagnostics {
31150
31974
  ageMs: age(tool.since)
31151
31975
  }));
31152
31976
  try {
31153
- writeDiagnostic(this.bridge, event, {
31977
+ const written = writeDiagnostic(this.bridge, event, {
31154
31978
  session: identity(this.state.id),
31155
31979
  run: this.run,
31156
31980
  phase: this.phase,
@@ -31177,8 +32001,64 @@ class BridgeRunDiagnostics {
31177
32001
  completedTools: this.completedTools,
31178
32002
  tickDelayMs
31179
32003
  }, this.write);
32004
+ if (!written)
32005
+ return;
32006
+ this.baseline = {
32007
+ at: now,
32008
+ phase: this.phase,
32009
+ pending: new Set(this.pending.keys()),
32010
+ counters: { ...this.counters },
32011
+ stall
32012
+ };
31180
32013
  } catch {}
31181
32014
  }
32015
+ periodicDue(now, stall) {
32016
+ if (stall.signals.has("tick-delay"))
32017
+ return true;
32018
+ const last = this.baseline;
32019
+ if (!last)
32020
+ return true;
32021
+ if (!sameSet(stall.signals, last.stall.signals) || !sameSet(stall.tools, last.stall.tools))
32022
+ return true;
32023
+ if (stall.signals.has("no-delta") && this.changedSince(last))
32024
+ return true;
32025
+ return now - last.at >= BRIDGE_DIAGNOSTICS_KEEPALIVE_MS;
32026
+ }
32027
+ changedSince(last) {
32028
+ if (this.phase !== last.phase)
32029
+ return true;
32030
+ if (this.pending.size !== last.pending.size)
32031
+ return true;
32032
+ for (const key of this.pending.keys())
32033
+ if (!last.pending.has(key))
32034
+ return true;
32035
+ for (const key of Object.keys(this.counters))
32036
+ if (this.counters[key] - last.counters[key] >= COUNTER_CHANGE_THRESHOLDS[key])
32037
+ return true;
32038
+ return false;
32039
+ }
32040
+ stallState(now, tickDelayMs) {
32041
+ const signals = new Set;
32042
+ const tools = new Set;
32043
+ let oldestPending;
32044
+ for (const [key, tool] of this.pending) {
32045
+ if (oldestPending === undefined || tool.since < oldestPending)
32046
+ oldestPending = tool.since;
32047
+ if (now - tool.since >= STALL_TOOL_PENDING_MS)
32048
+ tools.add(key);
32049
+ }
32050
+ const waitingSince = this.processScope ? oldestPending : WAITING_PHASES.has(this.phase) ? this.startedAt : undefined;
32051
+ if (waitingSince !== undefined) {
32052
+ const quietSince = Math.max(this.lastDelta ?? waitingSince, waitingSince);
32053
+ if (now - quietSince >= STALL_NO_DELTA_MS)
32054
+ signals.add("no-delta");
32055
+ }
32056
+ if (tools.size > 0)
32057
+ signals.add("tool-pending");
32058
+ if (tickDelayMs >= STALL_TICK_DELAY_MS)
32059
+ signals.add("tick-delay");
32060
+ return { signals, tools };
32061
+ }
31182
32062
  close(phase = "finished") {
31183
32063
  if (this.closed)
31184
32064
  return;
@@ -31190,6 +32070,7 @@ class BridgeRunDiagnostics {
31190
32070
  this.pending.clear();
31191
32071
  }
31192
32072
  }
32073
+ var bufferedFlushes = new Set;
31193
32074
 
31194
32075
  // ../../bridges/cursor-bridge/src/sdk-diagnostics.ts
31195
32076
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -31662,7 +32543,7 @@ class CursorRunDiagnostics extends BridgeRunDiagnostics {
31662
32543
  }
31663
32544
  }
31664
32545
  function createRunDiagnostics(state) {
31665
- return new CursorRunDiagnostics(state, undefined, undefined, undefined, () => bridgeDebugEnabled("cursor"));
32546
+ return new CursorRunDiagnostics(state, undefined, undefined, undefined, () => bridgeDiagnosticsStreamEnabled("cursor"));
31666
32547
  }
31667
32548
  var MAX_SETUP_DETAIL_BYTES = 300;
31668
32549
  function cursorSetupDebug(stage, error) {
@@ -33497,7 +34378,7 @@ function trackTurnEvidence(conversationId, options) {
33497
34378
  }
33498
34379
 
33499
34380
  // ../../bridges/cursor-bridge/src/agent-session.ts
33500
- var log4 = createLogger("bridge.cursor");
34381
+ var log5 = createLogger("bridge.cursor");
33501
34382
 
33502
34383
  class CredentialError extends Error {
33503
34384
  constructor(message) {
@@ -34042,7 +34923,7 @@ async function setResumableAgentArchived(agentId, archived) {
34042
34923
  const options = { cwd: workingDirectory };
34043
34924
  await (archived ? api.archive(agentId, options) : api.unarchive(agentId, options));
34044
34925
  } catch (error) {
34045
- log4.warn("agent.archive-failed", { archived, error: formatLogError(error, { stack: false }) });
34926
+ log5.warn("agent.archive-failed", { archived, error: formatLogError(error, { stack: false }) });
34046
34927
  return "failed";
34047
34928
  } finally {
34048
34929
  agentArchiveOperations.delete(agentId);
@@ -37502,7 +38383,7 @@ async function answerSessionActivityBatch(body, read, options = {}) {
37502
38383
  }
37503
38384
 
37504
38385
  // ../../bridges/cursor-bridge/src/http.ts
37505
- var log5 = createLogger("bridge.cursor");
38386
+ var log6 = createLogger("bridge.cursor");
37506
38387
 
37507
38388
  class HttpError extends Error {
37508
38389
  status;
@@ -37567,7 +38448,7 @@ async function route(request, response, clientSignal) {
37567
38448
  if (error instanceof PromptAttachmentError) {
37568
38449
  return json(response, 400, { error: error.message });
37569
38450
  }
37570
- log5.error("http.route-failed");
38451
+ log6.error("http.route-failed");
37571
38452
  return json(response, 500, { error: "Internal bridge error" });
37572
38453
  }
37573
38454
  }
@@ -38555,7 +39436,7 @@ function startParentWatchdog(options) {
38555
39436
  }
38556
39437
 
38557
39438
  // ../protocol/src/bridge-lifecycle.ts
38558
- var log6 = createLogger("bridge.lifecycle");
39439
+ var log7 = createLogger("bridge.lifecycle");
38559
39440
  var TERMINATION_SIGNALS = ["SIGTERM", "SIGINT"];
38560
39441
  function errorKind(error) {
38561
39442
  if (error instanceof Error)
@@ -38609,7 +39490,7 @@ class BridgeLifecycle {
38609
39490
  }
38610
39491
  requestExit() {
38611
39492
  this.#exit ??= this.shutdown().then(() => this.#options.exit(0), (error) => {
38612
- log6.error("shutdown.failed", {
39493
+ log7.error("shutdown.failed", {
38613
39494
  bridge: this.#options.label,
38614
39495
  errorClass: errorKind(error)
38615
39496
  });
@@ -38626,7 +39507,7 @@ class BridgeLifecycle {
38626
39507
  try {
38627
39508
  idleSweep.run();
38628
39509
  } catch (error) {
38629
- log6.warn("idle-sweep.failed", {
39510
+ log7.warn("idle-sweep.failed", {
38630
39511
  bridge: this.#options.label,
38631
39512
  errorClass: errorKind(error)
38632
39513
  });
@@ -38698,7 +39579,7 @@ async function settleIdleDetaches() {
38698
39579
  }
38699
39580
 
38700
39581
  // ../../bridges/cursor-bridge/src/server.ts
38701
- var log7 = createLogger("bridge.cursor");
39582
+ var log8 = createLogger("bridge.cursor");
38702
39583
  var IDLE_SWEEP_MS = 60 * 1000;
38703
39584
  var lifecycle;
38704
39585
  var server = createServer((request, response) => {
@@ -38733,7 +39614,7 @@ function lifecycleFor(listenPort, options) {
38733
39614
  applyWorkingDirectory();
38734
39615
  await loadPersistedState();
38735
39616
  finishRestoredTombstones().catch(() => {
38736
- log7.warn("startup.closes-failed");
39617
+ log8.warn("startup.closes-failed");
38737
39618
  });
38738
39619
  await new Promise((resolve) => server.listen(listenPort, hostname, resolve));
38739
39620
  },