orkestrator 2.35.4-beta → 2.35.5-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.
@@ -28394,8 +28394,10 @@ function stackFrames(target, message) {
28394
28394
  `).filter((line) => /^\s*at\s/.test(line)).slice(0, MAX_STACK_FRAMES).map((line) => boundedText2(relativeFrame(line), MAX_FRAME_CHARS));
28395
28395
  return frames.length > 0 ? frames : undefined;
28396
28396
  }
28397
- function describe2(error, includeStack, depth) {
28397
+ function describe2(error, includeStack, includeMessage, depth) {
28398
28398
  if (typeof error !== "object" || error === null) {
28399
+ if (!includeMessage)
28400
+ return { name: "NonError" };
28399
28401
  return {
28400
28402
  name: "NonError",
28401
28403
  message: typeof error === "string" ? boundedText2(error, MAX_MESSAGE_CHARS) : `[${typeof error}]`
@@ -28412,7 +28414,7 @@ function describe2(error, includeStack, depth) {
28412
28414
  const details = { name };
28413
28415
  if (commandFailure)
28414
28416
  details.outputOmitted = true;
28415
- else if (message)
28417
+ else if (message && includeMessage)
28416
28418
  details.message = boundedText2(message, MAX_MESSAGE_CHARS);
28417
28419
  const code = read(error, "code");
28418
28420
  const safeCode = finite(code) ?? matching(code, CODE_PATTERN);
@@ -28440,13 +28442,13 @@ function describe2(error, includeStack, depth) {
28440
28442
  details.errorCount = members.length;
28441
28443
  const cause = read(error, "cause") ?? (Array.isArray(members) ? members[0] : undefined);
28442
28444
  if (cause !== undefined && cause !== null && depth < MAX_CAUSE_DEPTH) {
28443
- details.cause = describe2(cause, false, depth + 1);
28445
+ details.cause = describe2(cause, false, includeMessage, depth + 1);
28444
28446
  }
28445
28447
  return details;
28446
28448
  }
28447
28449
  function formatLogError(error, options = {}) {
28448
28450
  try {
28449
- return brand(describe2(error, options.stack !== false, 0));
28451
+ return brand(describe2(error, options.stack !== false, options.message !== false, 0));
28450
28452
  } catch {
28451
28453
  return brand({ name: "Error", message: "[unreadable]" });
28452
28454
  }
@@ -28478,7 +28480,16 @@ var AGENT_MAIL_LOG_AREAS = defineLogAreas({
28478
28480
  "agent-mail": {
28479
28481
  description: "Delivering agent mail into waiting agent sessions.",
28480
28482
  events: {
28481
- "delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged."
28483
+ "delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged.",
28484
+ "drain.new-mail-failed": "Draining newly received mail failed; the next sweep delivers it.",
28485
+ "presence.sync-failed": "Mailboxes could not be synchronized.",
28486
+ "inject.verified": "An injected message's delivery was checked. Ids and decisions only.",
28487
+ "inject.dispatched": "Messages were dispatched into a session. Ids and decisions only.",
28488
+ "stopped-worker.action-failed": "Nothing could act on mail for a stopped worker.",
28489
+ "coordinator.start-failed": "The main coordinator could not be started for a new message.",
28490
+ "message.placed": "A message was placed in a mailbox. Ids and decisions only, never subjects or bodies.",
28491
+ "budget.hold-notify-failed": "The coordinator could not be told about held worker mail.",
28492
+ "budget.reset-failed": "The mail budget could not be reset for a prompted tab."
28482
28493
  }
28483
28494
  }
28484
28495
  });
@@ -28500,6 +28511,30 @@ var BACKEND_LOG_AREAS = defineLogAreas({
28500
28511
  "job.failed": "One pass of the job named in `scope` failed; its next pass retries.",
28501
28512
  ...THROTTLE_LOG_EVENTS
28502
28513
  }
28514
+ },
28515
+ backend: {
28516
+ description: "The backend process: startup, background notices and shutdown.",
28517
+ events: {
28518
+ starting: "The backend process is starting.",
28519
+ "ssh-socket.resolved": "An SSH agent socket was found.",
28520
+ "ssh-socket.missing": "No usable SSH agent socket was found.",
28521
+ "standalone-updater.mismatch": "--standalone-updater does not match --data-dir, so self-update is off.",
28522
+ "instance.publish-failed": "The instance descriptor could not be published.",
28523
+ "instance.republish-failed": "The instance descriptor could not be republished; a later pass retries.",
28524
+ "parent.exited": "The parent process exited, so local servers are shutting down.",
28525
+ "startup.step-failed": "One part of startup failed and the backend carried on; `step` says which.",
28526
+ "startup.setup-fence-failed": "An environment's interrupted setup could not be fenced.",
28527
+ "startup.setup-adopt-failed": "An environment's pending setup could not be adopted.",
28528
+ "startup.deletion-pending": "An interrupted environment deletion stays pending. Its owning step logged the detail.",
28529
+ "startup.looped-review-pending": "Cleanup of the retired Looped Review stays pending.",
28530
+ "notice.failed": "A background notice after a turn or prompt failed; `step` says which.",
28531
+ "artifacts.live-unavailable": "Live interactive artifacts are unavailable.",
28532
+ "shutdown.step-failed": "One part of shutdown failed and the rest went on; `step` says which.",
28533
+ "shutdown.signal-received": "A signal started shutdown, which tells a clean quit from the backend being killed.",
28534
+ "shutdown.finished": "Shutdown finished, and the process exits with `code`.",
28535
+ "port-policy.second-backend": "Another backend serves the default data directory, so this one avoids its ports.",
28536
+ "port-policy.serve-on-free-port": "--tailscale-serve is on a free gateway port; pass --port with --strict-gateway-port to keep one."
28537
+ }
28503
28538
  }
28504
28539
  });
28505
28540
 
@@ -28507,11 +28542,12 @@ var BACKEND_LOG_AREAS = defineLogAreas({
28507
28542
  var MAX_BRIDGE_DIAGNOSTIC_BYTES = 8192;
28508
28543
  var BRIDGE_LOG_AREAS = defineLogAreas({
28509
28544
  "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.",
28545
+ 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
28546
  tag: "bridge-diagnostics",
28512
28547
  maxStringChars: MAX_BRIDGE_DIAGNOSTIC_BYTES,
28513
28548
  events: {
28514
- heartbeat: "The once-a-minute snapshot of a turn or process that is still open.",
28549
+ 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.",
28550
+ change: "At trace only: a snapshot written as soon as the phase, the pending tools or a counter past its threshold changes.",
28515
28551
  "send-started": "A turn or process diagnostic scope began.",
28516
28552
  "send-resolved": "The provider accepted a dispatch.",
28517
28553
  "cancel-requested": "Cancellation of a turn was requested.",
@@ -28810,7 +28846,7 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
28810
28846
  // ../protocol/src/log-vocabulary/environment.ts
28811
28847
  var ENVIRONMENT_LOG_AREAS = defineLogAreas({
28812
28848
  environment: {
28813
- description: "Environment naming, held setup and cleanup after deletion.",
28849
+ description: "Environment naming, setup, status, moves, deletion and cleanup afterwards.",
28814
28850
  events: {
28815
28851
  "cleanup.branch-kept": "A deleted environment's local branch was kept, as it may hold unmerged work.",
28816
28852
  "rename.failed": "Naming an environment from its pending prompt failed for the first time.",
@@ -28819,6 +28855,40 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
28819
28855
  "setup.attention-not-recorded": "Held setup could not be recorded as needing the user's attention.",
28820
28856
  "setup.coordinator-not-notified": "The worker's coordinator could not be told that its setup is held for approval.",
28821
28857
  "setup.unknown-environment": "The renderer was asked to act on the setup of an environment it does not hold.",
28858
+ "cleanup.rearmed": "A deleted environment's stopped cleanup is retried once under a new backend version.",
28859
+ "cleanup.exhausted": "A deleted environment's cleanup keeps failing after its attempts; written once per environment.",
28860
+ "cleanup.retry-not-admitted": "A cleanup retry was not admitted; the entry stays for the next start.",
28861
+ "cleanup.step-failed": "One step of a deleted environment's cleanup failed; a later reconcile retries it.",
28862
+ "cleanup.record-failed": "A finished cleanup step could not be recorded, so it may run again.",
28863
+ "cleanup.sweep-failed": "A cleanup sweep failed; written once per sweep.",
28864
+ "cleanup.reconcile-failed": "A cleanup reconcile pass failed; the next one retries.",
28865
+ "orphan-state.remove-failed": "An orphaned environment state directory could not be removed.",
28866
+ "orphan-state.removed": "Orphaned environment state directories were removed.",
28867
+ "orphan-state.sweep-failed": "Sweeping orphaned environment state failed.",
28868
+ "orphan-canvas.removed": "Orphaned design canvases were removed.",
28869
+ "orphan-canvas.sweep-failed": "Sweeping orphaned design canvases failed.",
28870
+ "orphan-branches.swept": "Orphaned environment branches were deleted, or kept as they may hold unmerged work.",
28871
+ "stray-workspace.remove-failed": "A stray workspace directory could not be removed.",
28872
+ "stray-workspace.removed": "Stray workspace directories were removed.",
28873
+ "stray-workspace.kept": "Unowned workspace directories that hold files were kept; remove them by hand if unneeded.",
28874
+ "temp-files.removed": "Abandoned temp files were removed.",
28875
+ "status.ownership-probe-failed": "A strict container ownership probe failed, so the stored status is kept.",
28876
+ "status.docker-error": "A transient Docker error stopped a status read, so the stored status is kept.",
28877
+ "setup.clear-launch-failed": "A pending agent launch could not be cleared after setup failed.",
28878
+ "setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
28879
+ "lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
28880
+ "tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
28881
+ "tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
28882
+ "orphan-session.reaped": "A native session no tab references was torn down.",
28883
+ "handoff-sweep.failed": "Sweeping transferred transcripts no tab references failed.",
28884
+ "delete.terminals-survived": "Terminal process trees outlived termination, so the deletion stops.",
28885
+ "delete.artifacts-left": "Graph run artifact directories were not removed.",
28886
+ "delete.worktrees-kept": "Graph runs kept branch worktrees.",
28887
+ "delete.step-failed": "One best-effort part of deleting an environment failed; `step` says which, and the rest goes on.",
28888
+ "merge-cleanup.resume-failed": "A merge cleanup interrupted by a restart could not be resumed.",
28889
+ "move.sessions-not-moved": "A provider's sessions could not follow a moved environment.",
28890
+ "move.recovery-failed": "Recovering an interrupted environment move failed.",
28891
+ "stop.settle-activity-failed": "Agent activity could not be settled after a runtime stopped.",
28822
28892
  ...THROTTLE_LOG_EVENTS
28823
28893
  }
28824
28894
  }
@@ -28827,10 +28897,50 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
28827
28897
  // ../protocol/src/log-vocabulary/gateway.ts
28828
28898
  var GATEWAY_LOG_AREAS = defineLogAreas({
28829
28899
  gateway: {
28830
- description: "The remote gateway other devices and browsers connect through.",
28900
+ description: "The gateway other devices, browsers and the desktop connect through.",
28831
28901
  events: {
28832
28902
  "remote.start-failed": "The desktop could not start the remote gateway.",
28833
- "remote.stop-failed": "The desktop could not stop the remote gateway cleanly."
28903
+ "remote.stop-failed": "The desktop could not stop the remote gateway cleanly.",
28904
+ disabled: "The gateway is disabled by its environment variable.",
28905
+ "tailscale.no-address": "No Tailscale address was found, so the gateway did not start.",
28906
+ "tailscale.no-address-fallback": "No Tailscale address was found, so the gateway binds its fallback address.",
28907
+ "control.listening": "The backend control listener is up.",
28908
+ "browser.listening": "The browser listener is up.",
28909
+ "browser.unavailable": "The browser listener could not start; control remains if started, or loopback is attempted.",
28910
+ "browser.unavailable-degraded": "No browser listener was started (`reason=no-tailscale-address`); control remains if started, or loopback is attempted.",
28911
+ "loopback.listening": "The loopback client listener is up.",
28912
+ "loopback.unavailable": "The loopback client listener could not start.",
28913
+ "auth-token.stored": "The gateway token's file was written. The path only, never the token.",
28914
+ "auth-token.persist-failed": "The gateway token could not be saved.",
28915
+ "port.fallback": "The preferred port was taken, so a nearby one is used.",
28916
+ "port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
28917
+ "request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
28918
+ "websocket.upgrade-failed": "A WebSocket upgrade failed.",
28919
+ "events.client-dropped": "An event-stream client buffered too much and was dropped; it reconnects and refetches.",
28920
+ "proxy.client-disconnected": "A proxy client went away, so its upstream request was aborted.",
28921
+ "throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
28922
+ "throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
28923
+ "throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
28924
+ }
28925
+ },
28926
+ "gateway.terminal": {
28927
+ description: "The gateway's terminal WebSocket.",
28928
+ events: {
28929
+ "upgrade-rejected": "A terminal WebSocket upgrade was refused.",
28930
+ "socket-error": "A terminal WebSocket reported an error.",
28931
+ "subscription-failed": "A terminal subscription failed.",
28932
+ "operation-failed": "A terminal operation failed. Fixed text: the operation can hold terminal input."
28933
+ }
28934
+ },
28935
+ "gateway.tailscale": {
28936
+ description: "Tailscale Serve for desktop web access and a standalone backend.",
28937
+ events: {
28938
+ "web-access.disable-failed": "Desktop web access could not be turned off.",
28939
+ "web-access.enable-failed": "Desktop web access could not be turned on.",
28940
+ "web-access.cleanup-failed": "Cleaning up after a failed enable also failed.",
28941
+ "web-access.reset-failed": "Desktop web access could not be reset.",
28942
+ "startup.init-failed": "Desktop web access could not be initialized at startup.",
28943
+ available: "Tailscale Serve is publishing the gateway."
28834
28944
  }
28835
28945
  }
28836
28946
  });
@@ -28841,6 +28951,18 @@ var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
28841
28951
  description: "Agent bridge processes the backend runs on the host.",
28842
28952
  events: {
28843
28953
  "bridge.not-answering": "A bridge with work in progress fails health checks, so it is not restarted yet.",
28954
+ "bridge-runtime.installing": "A bridge runtime is being installed.",
28955
+ "bridge-runtime.installed": "A bridge runtime finished installing.",
28956
+ "opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
28957
+ "server.stopping": "A local server is being stopped, for the fixed `reason` given.",
28958
+ "reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
28959
+ "reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
28960
+ "reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
28961
+ "reaper.runtime-root-remove-failed": "A claude-tmux runtime root could not be removed; it stays for a retry.",
28962
+ "reaper.server-unidentified": "An orphan candidate could not be identified, so its record is kept.",
28963
+ "reaper.server-refused": "An orphan candidate leads no process group, so it was not reaped.",
28964
+ "reaper.server-reaping": "An orphaned server is being stopped.",
28965
+ "reaper.server-kill-failed": "An orphaned server did not exit.",
28844
28966
  ...THROTTLE_LOG_EVENTS
28845
28967
  }
28846
28968
  }
@@ -28882,7 +29004,12 @@ var MODEL_LOG_AREAS = defineLogAreas({
28882
29004
  models: {
28883
29005
  description: "Agent model catalogues and their persistent caches.",
28884
29006
  events: {
28885
- "cache.write-failed": "A successful catalogue refresh could not update the host cache."
29007
+ "cache.write-failed": "A successful catalogue refresh could not update the host cache.",
29008
+ "seed.pi-failed": "The host Pi model catalogue could not be seeded; the next launch retries.",
29009
+ "bridge.not-ready": "The first-use catalogue bridge did not become ready.",
29010
+ "bridge.start-failed": "The first-use catalogue bridge failed to start.",
29011
+ "probe.exit-unclean": "A catalogue probe or sign-in server did not exit cleanly.",
29012
+ "download.deferred": "A model catalogue could not be downloaded yet."
28886
29013
  }
28887
29014
  }
28888
29015
  });
@@ -28893,8 +29020,61 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
28893
29020
  description: "Native agent sessions and what the backend reads from their bridges.",
28894
29021
  events: {
28895
29022
  "catalogue.outdated-bridge": "A bridge predates the command catalogue, so its commands stay unavailable.",
29023
+ "handoff.summary-read-failed": "Change summaries could not be read for a handoff, so the carrier says they are unmeasured.",
29024
+ "handoff.consume-failed": "A delivered handoff could not be marked consumed.",
29025
+ "job.pr-refresh-rollback-failed": "Rolling back a pull request refresh for a job failed.",
29026
+ "job.resend-queue-failed": "A resend could not be queued for a job.",
29027
+ "interaction.requests-dropped": "Interaction requests that could not be mapped were dropped.",
29028
+ "interaction.observe-failed": "Observing a session's interactions failed. Error class only.",
29029
+ "human-prompt.listener-failed": "A human prompt listener threw; the others still run.",
29030
+ "question.attention-record-failed": "Attention for an async question could not be recorded; the transcript stays readable.",
29031
+ "activity.reconcile-failed": "Reconciling an environment's activity failed. Error class only.",
29032
+ "activity.persist-failed": "An environment's activity could not be saved.",
29033
+ "pr-refresh.schedule-failed": "A pull request refresh after completion could not be scheduled.",
29034
+ "launch.startup-failed": "A startup launch failed; it retries unless `permanent`.",
29035
+ "queue.failing": "A native prompt queue keeps failing. The key and reason only, never the prompt.",
29036
+ "provider.retire-failed": "Retiring an obsolete provider failed.",
29037
+ "workflow-result.store-unavailable": "The workflow result store is unavailable, so the provider's result is used.",
29038
+ "catalogue.refresh-failed": "A provider's command catalogue could not be refreshed.",
29039
+ "dispatch.attach-failed": "Attaching an agent before dispatch failed; the prompt request answers authoritatively.",
29040
+ "coordinator-context.ack-failed": "Coordinator repository context could not be acknowledged.",
29041
+ "naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
29042
+ "interrupt.persist-failed": "A turn interrupt could not be saved, so automatic publication stays fenced.",
29043
+ "resume.close-replaced-failed": "The session a resume replaced could not be closed.",
29044
+ "sign-in.check-failed": "A turn could not be checked for a login refusal.",
29045
+ "sign-in.resend-failed": "Sending refused prompts after sign-in failed.",
29046
+ "sign-in.prompt-resend-failed": "One refused prompt could not be sent again after sign-in. Error class only.",
29047
+ "shutdown.checkpoints-skipped": "Shutdown skipped display-tail checkpoints; provider history stays authoritative. Count only.",
29048
+ "turn-recovery.failed": "Recovering an incomplete turn failed.",
29049
+ "turn-recovery.exhausted": "A turn failed again after automatic recovery and is left for the user.",
29050
+ "turn-recovery.retrying": "An incomplete or provider-failed turn is being retried automatically.",
29051
+ "usage-limit.resend-failed": "Resending after a usage limit failed. An unknown send stays in the journal.",
29052
+ "title.strategy-failed": "A session title strategy failed, so the next is tried. Content-free: the error can quote the prompt.",
28896
29053
  ...THROTTLE_LOG_EVENTS
28897
29054
  }
29055
+ },
29056
+ "native-agent.goal": {
29057
+ description: "The /goal loop: advancing goals and their verifiers.",
29058
+ events: {
29059
+ "advance.failed": "A goal could not advance; the next sweep retries.",
29060
+ "attention.record-failed": "Attention for a goal could not be recorded.",
29061
+ "turn-end.settle-failed": "Turn-end work for a goal could not be settled.",
29062
+ "verifier.finish-failed": "A verifier failed to finish; the goal stays verifying, so the next sweep runs it again.",
29063
+ "verifier.stop-failed": "An earlier verifier could not be stopped.",
29064
+ "recover.failed": "Goals could not be recovered at startup."
29065
+ }
29066
+ },
29067
+ "native-agent.opencode": {
29068
+ description: "The OpenCode provider: its request monitor, retries and agent tools.",
29069
+ events: {
29070
+ "retry.abort-failed": "Aborting an automatic retry failed. Error class only.",
29071
+ "retry.abort-not-scheduled": "An automatic retry abort could not be scheduled. Error class only.",
29072
+ "agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
29073
+ "coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
29074
+ "monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
29075
+ "worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
29076
+ "request.failed": "Handling a request event failed, so the stream restarts. Error class only."
29077
+ }
28898
29078
  }
28899
29079
  });
28900
29080
 
@@ -28917,6 +29097,17 @@ var PREVIEW_LOG_AREAS = defineLogAreas({
28917
29097
  "partitions.retry-forgotten-failed": "Retrying a forgotten preview cleanup failed.",
28918
29098
  "port-hints.persist-failed": "Preview port hints could not be saved.",
28919
29099
  "transport.close-failed": "A preview transport could not be closed.",
29100
+ "ca-bundle.read-failed": "The upstream CA bundle could not be read.",
29101
+ "publication.start-failed": "Private preview publication did not start.",
29102
+ "publication.reconfigure-failed": "Preview publication could not be reconfigured.",
29103
+ "publication.listening": "Private preview origins are listening.",
29104
+ "certificate.reloaded": "The preview certificate was reloaded.",
29105
+ "access.revoked-close-failed": "A revoked preview resource could not be closed. Error class only.",
29106
+ "registry.invalid-definition": "An invalid stored preview service definition was ignored.",
29107
+ "registry.environment-reconcile-failed": "An environment's preview services could not be reconciled.",
29108
+ "registry.resolver-failed": "A preview resolver failed. Error class only.",
29109
+ "registry.revocation-listener-failed": "A preview revocation listener threw. Error class only.",
29110
+ "registry.change-emit-failed": "A preview change event could not be emitted. Error class only.",
28920
29111
  ...THROTTLE_LOG_EVENTS
28921
29112
  }
28922
29113
  }
@@ -28935,9 +29126,33 @@ var RUNTIME_LOG_AREAS = defineLogAreas({
28935
29126
  // ../protocol/src/log-vocabulary/terminal.ts
28936
29127
  var TERMINAL_LOG_AREAS = defineLogAreas({
28937
29128
  terminal: {
28938
- description: "The renderer's terminal. Its lines stay in the browser console, never the saved log.",
29129
+ description: "Terminals. The renderer's lines stay in the browser console; the backend's reach the saved log.",
28939
29130
  events: {
28940
29131
  "input.undelivered": "A keystroke did not reach a shell: `no-session` or `not-delivered`.",
29132
+ "orphan.reaped": "A terminal no tab references was closed.",
29133
+ "agent-completion.notify-failed": "A terminal agent's completion could not be reported.",
29134
+ "activity.record-failed": "Terminal environment activity could not be recorded.",
29135
+ "pty.exit-listener-failed": "A terminal exit listener threw; the others still run.",
29136
+ "pty.exit-notify-failed": "Notifying a terminal's exit failed.",
29137
+ "pty.late-exit-listener-failed": "A listener added after a terminal exited threw.",
29138
+ "setup.pty-reused": "A setup terminal reused its existing PTY.",
29139
+ "setup.pty-spawning": "A setup terminal is spawning its PTY. The argument count only, never the arguments.",
29140
+ "setup.pty-spawned": "A setup terminal's PTY started.",
29141
+ "setup.pty-exited": "A setup terminal's PTY exited.",
29142
+ "setup.preparing": "Workspace preparation started in the setup terminal.",
29143
+ "setup.session-creating": "A setup session is being created.",
29144
+ "setup.intro-emitted": "The setup intro was written to the terminal.",
29145
+ "setup.completed": "Setup finished.",
29146
+ "setup.failed": "Setup failed.",
29147
+ "setup.already-complete": "Setup was requested but had already finished.",
29148
+ "setup.renderer-ensured": "The renderer asked for setup to be running.",
29149
+ "setup.renderer-requested": "The renderer asked for the setup session.",
29150
+ "setup.renderer-requested-none": "The renderer asked for a setup session that does not exist.",
29151
+ "setup.no-commands": "An environment has no setup commands to run.",
29152
+ "setup.already-running": "Setup was requested while it was already running.",
29153
+ "setup.held-for-approval": "Setup is held until its commands are approved.",
29154
+ "setup.renderer-checked-session": "The renderer asked whether a setup terminal session exists.",
29155
+ "setup.renderer-requested-buffer": "The renderer asked for a setup terminal's output buffer. A size only, never its contents.",
28941
29156
  "input.resume-failed": "Asking the backend to resume refused terminal input failed.",
28942
29157
  "input.write-failed": "Writing input to a terminal session threw.",
28943
29158
  "listener.remove-failed": "Removing a terminal output listener threw.",
@@ -29037,13 +29252,39 @@ var TERMINAL_LOG_AREAS = defineLogAreas({
29037
29252
  // ../protocol/src/log-vocabulary/tmux.ts
29038
29253
  var TMUX_LOG_AREAS = defineLogAreas({
29039
29254
  tmux: {
29040
- description: "The poll loop behind a Claude tmux tab.",
29255
+ description: "Claude tmux tabs: launch, the poll loop, cleanup and the tmux prompt queue.",
29041
29256
  events: {
29042
29257
  "poll.discovery-failed": "Finding the session's transcript failed; a later tick retries.",
29043
29258
  "poll.snapshot-failed": "Reading the hook and transcript state failed; the next tick retries.",
29044
29259
  "poll.drain-pending-failed": "Delivering pending hook events failed; the next tick retries.",
29045
29260
  "poll.drain-timeouts-failed": "Delivering hook timeouts failed; the next tick retries.",
29046
29261
  "poll.tail-failed": "Reading new transcript lines failed; the next tick retries.",
29262
+ "cleanup.session-stop-failed": "A tmux session could not be stopped while cleaning up an environment.",
29263
+ "cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
29264
+ "cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
29265
+ "cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
29266
+ "hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
29267
+ "hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
29268
+ "naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
29269
+ "orphans.skipped": "Orphan reconciliation was skipped because pane layouts are unreadable.",
29270
+ "orphan.reaped": "A tmux session no tab references was killed.",
29271
+ "orphan.kill-skipped": "An orphan tmux kill was skipped because the tmux server could not be reached.",
29272
+ "cli.thinking-display-probe-failed": "Probing the CLI for --thinking-display failed, so it launches without it.",
29273
+ "cli.fast-mode-unsupported": "The claude CLI lacks --settings, so it launches without fast mode.",
29274
+ "cli.effort-unsupported": "The claude CLI lacks --effort, so it launches without it.",
29275
+ "interactive.snapshot-failed": "An interactive snapshot failed; expected while a pane is closing.",
29276
+ "signal.arm-failed": "The Claude state signal could not be armed.",
29277
+ "signal.degraded": "The Claude state signal missed a change or rang too often, so polling stays at one second until it is re-armed.",
29278
+ "pr-refresh.schedule-failed": "A pull request refresh after a turn could not be scheduled.",
29279
+ "pr-probe.failed": "Probing for a pull request an agent created failed.",
29280
+ "activity.persist-failed": "Tmux tab activity could not be saved.",
29281
+ "fast-mode.persist-failed": "The launch fast mode could not be saved.",
29282
+ "fast-mode.repair-failed": "Fast mode metadata could not be repaired on a reattached session.",
29283
+ "pane.observe-failed": "A pane observation failed. Error class only: pane contents are sensitive.",
29284
+ "turn.failure-record-failed": "A failed turn could not be recorded.",
29285
+ "slash-command.settle-timeout": "Timed out waiting for a Claude slash command to settle.",
29286
+ "queue.failing": "A tmux prompt queue keeps failing to dispatch.",
29287
+ "queue.rename-failed": "An environment could not be named from its first prompt; the prompt still goes ahead.",
29047
29288
  ...THROTTLE_LOG_EVENTS
29048
29289
  }
29049
29290
  }
@@ -29070,7 +29311,8 @@ var UPDATER_LOG_AREAS = defineLogAreas({
29070
29311
  "remote.unavailable": "Updates requested by remote clients are unavailable in this session.",
29071
29312
  "restart-prompt.failed": "The restart prompt for a downloaded update failed.",
29072
29313
  unavailable: "Auto-update could not be set up in this session.",
29073
- "update.failed": "electron-updater reported an update error."
29314
+ "update.failed": "electron-updater reported an update error.",
29315
+ "standalone.restarting": "A standalone backend is restarting into a new version."
29074
29316
  }
29075
29317
  }
29076
29318
  });
@@ -29081,11 +29323,460 @@ var WEB_ANNOTATIONS_LOG_AREAS = defineLogAreas({
29081
29323
  description: "Web annotation requests and their background reconciler.",
29082
29324
  events: {
29083
29325
  "reconcile.failed": "A background reconcile pass failed; the next one retries.",
29326
+ "legacy.degraded": "Legacy annotation storage is damaged, so the previous committed copy is served read-only.",
29327
+ "legacy.draft-index-problem": "The legacy draft index could not be used; `status` says why.",
29328
+ "legacy.unreadable-records": "The legacy import found unreadable records; they stay unread.",
29329
+ "legacy.unavailable": "Legacy annotation storage could not be read.",
29330
+ "legacy.unreadable": "An environment's legacy annotation storage is unreadable.",
29331
+ "legacy.archive-failed": "Imported legacy annotation files could not be archived.",
29332
+ "legacy.files-archived": "Legacy files beside an imported environment were archived, not imported.",
29333
+ "migration.draft-failed": "Migrating one draft failed.",
29334
+ "draft-reconcile.deferred": "Draft reconciliation was deferred; a later pass retries.",
29335
+ "request.handoff-deferred": "A request's handoff was deferred; a later pass retries.",
29336
+ "evidence.materialize-failed": "Materializing a request's evidence failed; it backs off and retries.",
29337
+ "queue.publish-deferred": "Publishing a request to the queue was deferred; it retries under the same id.",
29338
+ "request.reconcile-failed": "Reconciling a request failed; the next pass retries.",
29339
+ "turn-end.reconcile-failed": "Reconciling a request at the end of a turn failed; the next pass retries.",
29340
+ "gc.failed": "Annotation garbage collection failed; the next pass retries.",
29341
+ "record.unavailable": "An annotation record is unavailable; written once per record.",
29342
+ "storage.unavailable": "An environment's annotation store is unreadable.",
29343
+ "change-hint.listener-failed": "A change hint listener threw.",
29344
+ "orphan.remove-failed": "An orphaned environment's annotation storage could not be removed.",
29345
+ "storage.load-failed": "An environment's annotation storage could not be loaded.",
29084
29346
  ...THROTTLE_LOG_EVENTS
29085
29347
  }
29086
29348
  }
29087
29349
  });
29088
29350
 
29351
+ // ../protocol/src/log-vocabulary/storage.ts
29352
+ var STORAGE_LOG_AREAS = defineLogAreas({
29353
+ storage: {
29354
+ description: "The SQLite-backed stores, their snapshots and imports from older formats.",
29355
+ events: {
29356
+ "usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
29357
+ "snapshot.integrity-failed": "An hourly database snapshot failed its integrity check and was discarded.",
29358
+ "snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
29359
+ "snapshot.failed": "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
29360
+ "listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
29361
+ "listener.change-failed": "A resource change listener threw; the committed mutation stands.",
29362
+ "kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
29363
+ "nodes.entries-dropped": "Unreadable node registry entries were ignored.",
29364
+ "preview-identity.reminted": "The data directory moved or was copied, so previews get a new backend identity.",
29365
+ "machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
29366
+ "permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
29367
+ "retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
29368
+ "handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
29369
+ "desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
29370
+ "legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
29371
+ "legacy-json.archive-failed": "Imported JSON store files could not be archived."
29372
+ }
29373
+ }
29374
+ });
29375
+
29376
+ // ../protocol/src/log-vocabulary/build-pipeline.ts
29377
+ var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
29378
+ "build-pipeline": {
29379
+ description: "Build pipelines: their supervision, stages, transcripts and sidebar state.",
29380
+ events: {
29381
+ "sidebar.reconcile-failed": "Sidebar activity for pipelines could not be reconciled.",
29382
+ "sidebar.update-failed": "The sidebar could not be updated for one pipeline.",
29383
+ "result.consume-deferred": "Consuming a stage's workflow result failed; it stays staged and is retried.",
29384
+ "consolidation.consume-deferred": "Consuming a review consolidation result failed; it stays pending and is retried.",
29385
+ "dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request does the same work and answers authoritatively.",
29386
+ "interaction.resolved": "A human interaction on a pipeline stage resolved. Metadata only.",
29387
+ "transcripts.migrated": "A transcript migration pass moved stage transcripts; counts only.",
29388
+ "transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
29389
+ "restore.skipped": "A pipeline could not be restored at startup and was skipped.",
29390
+ "criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
29391
+ "workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
29392
+ "rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
29393
+ "kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
29394
+ "usage.read-failed": "Reading a stage session's token usage failed.",
29395
+ "checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
29396
+ "checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
29397
+ "legacy-transcript.deferred": "Moving a legacy inline transcript failed; the inline body stays readable."
29398
+ }
29399
+ }
29400
+ });
29401
+
29402
+ // ../protocol/src/log-vocabulary/agent-branch.ts
29403
+ var AGENT_BRANCH_LOG_AREAS = defineLogAreas({
29404
+ "agent-branch": {
29405
+ description: "Agent branches shared by review fan-outs, graph agents and goal verifiers; `owner` names which.",
29406
+ events: {
29407
+ "observation.checkpoint-failed": "Checkpointing reviewer observations failed; the next pass retries.",
29408
+ "transcript.mirror-failed": "Mirroring a reviewer transcript failed.",
29409
+ "usage.read-failed": "Reading a reviewer's token usage failed.",
29410
+ "result.nudge-failed": "An agent with an uncommitted result could not be nudged.",
29411
+ "dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request answers authoritatively.",
29412
+ "result.consume-deferred": "Consuming a branch's workflow result failed; it stays staged and is retried."
29413
+ }
29414
+ }
29415
+ });
29416
+
29417
+ // ../protocol/src/log-vocabulary/change-tracking.ts
29418
+ var CHANGE_TRACKING_LOG_AREAS = defineLogAreas({
29419
+ "change-tracking": {
29420
+ description: "Change tracking: turn capture, evidence pulls and measurements.",
29421
+ events: {
29422
+ "journal-import.failed": "Importing surviving OpenCode command journals as legacy summaries failed.",
29423
+ "projection.failed": "Projecting a change event onto its environment failed.",
29424
+ "startup.reconcile-failed": "Reconciling change tracking at startup failed.",
29425
+ "turn-start.capture-failed": "Capturing a turn's start failed, so the turn is untracked.",
29426
+ "dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
29427
+ "turn.finalize-failed": "Finalizing a turn failed.",
29428
+ "turn.settle-failed": "Settling a late interrupted turn failed.",
29429
+ "evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
29430
+ "measurement.failed": "Recomputing a tool's measurement failed."
29431
+ }
29432
+ },
29433
+ "diff-stats": {
29434
+ description: "Environment diff stats and the worktree signals that drive them.",
29435
+ events: {
29436
+ "baseline.update-failed": "An environment's diff baseline could not be updated.",
29437
+ "scan.watcher-failed": "An environment's diff watcher failed; its scans fall back to polling.",
29438
+ "scan.failed": "A diff scan failed; the last results stay, marked stale, and the scan is retried.",
29439
+ "scan.freshness-read-failed": "Reading whether an environment's remote is fresh failed.",
29440
+ "scan.listener-failed": "A change-tracking scan listener threw; the scan itself stands.",
29441
+ "emit.diff-stats-failed": "A diff stats change could not be emitted to its sink.",
29442
+ "emit.worktree-snapshot-failed": "A worktree snapshot could not be emitted to its sink.",
29443
+ "signal.demoted": "A worktree signal stopped being trusted, so scans fall back to timers until it is re-armed."
29444
+ }
29445
+ }
29446
+ });
29447
+
29448
+ // ../protocol/src/log-vocabulary/coordinator.ts
29449
+ var COORDINATOR_LOG_AREAS = defineLogAreas({
29450
+ coordinator: {
29451
+ description: "Coordinators: delegations, status wakes and their store.",
29452
+ events: {
29453
+ "delegation.open-failed": "A delegation could not be opened; `source` says for what.",
29454
+ "deliver-now.drain-failed": "The mail delivery pass after deliverNow failed; the next sweep delivers.",
29455
+ "mail.move-failed": "Mail could not move to the new main coordinator.",
29456
+ "work.move-failed": "Work could not move to the main coordinator.",
29457
+ "wake.observe-remote-workflow-failed": "A remote workflow could not be observed for status wakes.",
29458
+ "wake.observe-pull-request-failed": "A pull request could not be observed for status wakes.",
29459
+ "wake.observe-workflow-failed": "A workflow could not be observed for status wakes.",
29460
+ "wake.deliver-failed": "A workflow status wake could not be delivered; the next pass retries.",
29461
+ "wake.waiting-check-failed": "A waiting worker could not be checked; the next pass retries.",
29462
+ "wake.resolve-report-failed": "A finished Resolve tab could not be reported.",
29463
+ "wake.waiting-report-failed": "A waiting worker could not be reported.",
29464
+ "wake.worker-outcomes-failed": "Coordinator-owned workers' merges and deletions could not be checked; the next sweep retries.",
29465
+ "store.malformed": "The coordinator store was malformed and is treated as empty.",
29466
+ "store.unsupported-version": "The coordinator store has an unsupported version and is treated as empty.",
29467
+ "store.invalid-workspace": "An invalid coordinator workspace record was ignored.",
29468
+ "store.workflows-cleared": "The workflow store was full, so a batch of its oldest finished records was removed.",
29469
+ "store.workflows-in-use": "The workflow store was full and every record was still in use, so new work was refused.",
29470
+ "remote-worker.settle-failed": "A remote worker could not be settled."
29471
+ }
29472
+ }
29473
+ });
29474
+
29475
+ // ../protocol/src/log-vocabulary/review.ts
29476
+ var REVIEW_LOG_AREAS = defineLogAreas({
29477
+ review: {
29478
+ description: "Multi Review workflows: scheduling, graph runs and interactive fix sessions.",
29479
+ events: {
29480
+ "fix-tab.publish-failed": "A fix request was delivered but its tab could not be opened; the user is told.",
29481
+ "graph-run.not-started": "A workflow's graph run did not start.",
29482
+ "reconcile.scan-failed": "A reconciliation scan failed; the next scan retries.",
29483
+ "graph-engine.unavailable": "The graph engine is selected but unavailable, so the bespoke engine runs.",
29484
+ "graph-run.cancel-failed": "Cancelling a graph run failed; the next pass projects how it ended.",
29485
+ "delete.cleanup-failed": "A cleanup step after deleting a workflow failed; stale tabs reconcile away on hydration.",
29486
+ "fix-session.read-failed": "Reading an interactive fix session's state failed.",
29487
+ "fix-outcome.read-failed": "Reading an interactive fix's outcome failed; it stays pending.",
29488
+ "fix-usage.read-failed": "Reading a fix session's token usage failed.",
29489
+ "result.consume-deferred": "Consuming a workflow result failed; it stays staged and is retried.",
29490
+ "failure-triage.failed": "Classifying a review package's failing tests failed; the package is sealed without the triage and says so."
29491
+ }
29492
+ },
29493
+ "pull-request": {
29494
+ description: "Pull request monitoring, auto-merge and the `gh` reads behind them.",
29495
+ events: {
29496
+ "merged-state.persist-failed": "A merged pull request's state could not be saved; GitHub stays authoritative and cleanup goes on.",
29497
+ "refresh.failed": "A pull request could not be refreshed; the armed flag stands.",
29498
+ "arm.track-failed": "An armed environment could not be tracked; the monitor's next sync retries.",
29499
+ "gh.pr-list-unparseable": "`gh pr list` returned nothing that parses. Sizes only, never the output.",
29500
+ "monitor.start-failed": "Monitoring could not start for a newly opened pull request.",
29501
+ "cleanup-scheduler.missing": "A merged pull request was seen, but this runtime has no merge cleanup scheduler.",
29502
+ "auto-merge.evaluation-failed": "Evaluating an environment for auto-merge failed.",
29503
+ "auto-merge.merge-failed": "Auto-merge could not merge a pull request; the attempt is held and retried.",
29504
+ "auto-merge.resolve-failed": "Auto-merge could not launch Resolve for a pull request; the attempt is held and retried.",
29505
+ "monitor.detection-failed": "Checking an environment for its pull request failed.",
29506
+ "monitor.detection-admission-failed": "A pull request check could not be admitted to the work pool.",
29507
+ "monitor.terminal-repair-failed": "Repairing a merged or closed pull request's side effects failed.",
29508
+ "monitor.terminal-resume-failed": "Resuming a merged or closed pull request's side effects failed.",
29509
+ "monitor.stale-reading-ignored": "A non-merged reading (`state`) for a pull request already merged was ignored as stale.",
29510
+ "monitor.state-persist-failed": "A pull request's observed state could not be saved.",
29511
+ "monitor.state-clear-failed": "A pull request's saved state could not be cleared.",
29512
+ "monitor.task-reconcile-failed": "Updating the Kanban task of a merged or closed (`state`) pull request failed.",
29513
+ "monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
29514
+ "monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
29515
+ }
29516
+ }
29517
+ });
29518
+
29519
+ // ../protocol/src/log-vocabulary/public-api.ts
29520
+ var PUBLIC_API_LOG_AREAS = defineLogAreas({
29521
+ "public-api": {
29522
+ description: "The public CLI's operations: their outcomes, reconciliation and exec workers.",
29523
+ events: {
29524
+ "outcome.record-failed": "A background operation's outcome could not be recorded; reconciliation settles it.",
29525
+ "goal-checks.stop-failed": "Goal checks could not be stopped.",
29526
+ "exec.list-failed": "Exec workers could not be listed.",
29527
+ "exec.cancel-failed": "An exec could not be cancelled.",
29528
+ "goal-workers.list-failed": "Goal check workers could not be listed.",
29529
+ "operation.reconcile-failed": "Reconciling one operation failed; the next pass retries.",
29530
+ "reconcile.pass-failed": "A reconciliation pass failed; the next one retries."
29531
+ }
29532
+ }
29533
+ });
29534
+
29535
+ // ../protocol/src/log-vocabulary/agent-accounts.ts
29536
+ var AGENT_ACCOUNTS_LOG_AREAS = defineLogAreas({
29537
+ "agent-accounts": {
29538
+ description: "Agent accounts: automatic switching, staged logins and plan usage.",
29539
+ events: {
29540
+ "switch-notice.failed": "A notice about an automatic account switch failed; the switch stands. `audience` says whose.",
29541
+ "auto-switch.check-failed": "An automatic account check failed; the next nudge retries.",
29542
+ "container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
29543
+ "last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
29544
+ "login-cleanup.failed": "A temporary login could not be cleaned up.",
29545
+ "login-refresh.deferred": "Containers were not told to refresh their login now; they reconcile from its durable generation."
29546
+ }
29547
+ }
29548
+ });
29549
+
29550
+ // ../protocol/src/log-vocabulary/docker.ts
29551
+ var DOCKER_LOG_AREAS = defineLogAreas({
29552
+ docker: {
29553
+ description: "Docker containers: lifecycle, starts, staged inputs and the login files they hold.",
29554
+ events: {
29555
+ "portable-inputs.relay-missing": "Docker is rootless and the image predates the staged-input relay, so the container cannot read them until rebuilt.",
29556
+ "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.",
29557
+ "opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
29558
+ "login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
29559
+ "login-keeper.refresh-failed": "Refreshing the host Claude login failed. Fixed text: CLI output can hold credentials.",
29560
+ "login-keeper.refresh-not-extended": "Refreshing the host Claude login did not extend its expiry.",
29561
+ "login-keeper.refresh-check-failed": "Checking the host Claude login after a refresh failed.",
29562
+ "login-watcher.pass-failed": "A container login file watcher pass failed; the next one retries.",
29563
+ "lifecycle.record-failure-failed": "A failed container operation could not be recorded.",
29564
+ "lifecycle.reconcile-failed": "Reconciling one environment's container operation failed; the next pass retries.",
29565
+ "replacement.clear-terminals-failed": "Terminal sessions could not be cleared after a container replacement.",
29566
+ "recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
29567
+ "github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
29568
+ "availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
29569
+ "start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports."
29570
+ }
29571
+ },
29572
+ "docker.reachability": {
29573
+ description: "Whether agents in containers can reach the backend's agent tools server.",
29574
+ events: {
29575
+ "check.crashed": "A reachability check crashed.",
29576
+ "check.started": "A reachability check started.",
29577
+ "check.finished": "A reachability check finished.",
29578
+ "check.probe": "One probe of a finished check.",
29579
+ "check.summary": "Content-free status and reason for a check that did not find the host reachable.",
29580
+ "check.remediation": "One command the user can run to unblock containers.",
29581
+ "shutdown.awaiting-network": "Shutdown is waiting for probe network preparation.",
29582
+ "shutdown.cleanup-deferred": "Probe network cleanup waits until its preparation settles.",
29583
+ "shutdown.removing-resources": "Shutdown is removing probe resources.",
29584
+ "shutdown.container-remove-failed": "A probe container could not be removed at shutdown.",
29585
+ "shutdown.network-remove-failed": "The probe network could not be removed at shutdown.",
29586
+ "probe.skipped": "A container probe was skipped because the agent tools server is not listening.",
29587
+ "preflight.refused": "A stage was refused because its container cannot reach the host.",
29588
+ "probe.prepare-failed": "A container could not be prepared for a probe.",
29589
+ "probe.result": "The outcome of probing one container.",
29590
+ "probe.contradicts-host": "A container probe disagrees with the host status, so the host is rechecked.",
29591
+ "topology.detected": "The Docker topology was read.",
29592
+ "firewall.detected": "The host firewall was read.",
29593
+ "probe-network.remove-failed": "The probe network could not be removed.",
29594
+ "probe-network.create-failed": "The probe network could not be created, so only the default bridge is checked.",
29595
+ "event.emit-failed": "A reachability event could not be emitted.",
29596
+ "host-addresses.list-failed": "Host addresses could not be listed.",
29597
+ "probe-image.present": "The probe image is already present.",
29598
+ "probe-image.pulling": "The probe image is being pulled.",
29599
+ "probe-image.pulled": "The probe image was pulled.",
29600
+ "probe-image.pull-failed": "The probe image could not be pulled.",
29601
+ "probe-image.fallback": "The environment image is used as the probe image.",
29602
+ "probe-image.missing": "No probe image is available.",
29603
+ "network.list-failed": "Docker networks could not be listed.",
29604
+ "network.inspect-failed": "A Docker network could not be inspected.",
29605
+ "stale-containers.removing": "Stale probe containers are being removed.",
29606
+ "stale-networks.removing": "Stale probe networks are being removed."
29607
+ }
29608
+ }
29609
+ });
29610
+
29611
+ // ../protocol/src/log-vocabulary/mcp.ts
29612
+ var MCP_LOG_AREAS = defineLogAreas({
29613
+ "control-mcp": {
29614
+ description: "The Control MCP server other agents and devices reach Orkestrator through.",
29615
+ events: {
29616
+ "listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
29617
+ "state-listener.failed": "A Control MCP state listener threw; the others still run.",
29618
+ "delegation.remote-open-failed": "A delegation could not be opened on another node.",
29619
+ "delegation.open-failed": "A coordinator delegation could not be opened."
29620
+ }
29621
+ },
29622
+ "mcp-management": {
29623
+ description: "Managed MCP configuration: its commands, overlays and apply loop.",
29624
+ events: {
29625
+ "command.failed": "An MCP management command failed; `ref` is the correlation id shown to the user.",
29626
+ "overlay.materialise-failed": "An MCP overlay could not be written.",
29627
+ "apply.tick-failed": "An MCP apply tick failed; the next one retries."
29628
+ }
29629
+ }
29630
+ });
29631
+
29632
+ // ../protocol/src/log-vocabulary/design.ts
29633
+ var DESIGN_LOG_AREAS = defineLogAreas({
29634
+ design: {
29635
+ description: "The design canvas: its library, renderer and session links.",
29636
+ events: {
29637
+ "change-signal.failed": "A design change signal failed.",
29638
+ "library.index-write-failed": "The design library index could not be written.",
29639
+ "library.refresh-failed": "The design library could not be refreshed.",
29640
+ "renderer.problem": "The renderer hit a limit or lost a browser; `problem` is a fixed name.",
29641
+ "task.failed": "A design background task failed.",
29642
+ "canvas.needs-recovery": "A design canvas is unreadable and marked for recovery.",
29643
+ "startup.step-failed": "One part of design startup failed; `step` says which.",
29644
+ "legacy.retire-failed": "A migrated legacy design could not be retired.",
29645
+ "profiles.swept": "Design startup removed stale browser profiles.",
29646
+ "session-link.record-failed": "A closing conversation could not be recorded on a design link."
29647
+ }
29648
+ }
29649
+ });
29650
+
29651
+ // ../protocol/src/log-vocabulary/graph.ts
29652
+ var GRAPH_LOG_AREAS = defineLogAreas({
29653
+ graph: {
29654
+ description: "Graph runs: launches, passes, rewinds, system actions and templates.",
29655
+ events: {
29656
+ "describe.pass-failed": "A graph describe pass failed. Content-free: never the description or draft.",
29657
+ "system.stop-failed": "A system action's work could not be stopped.",
29658
+ "system.action-failed": "A system action failed; `cause` is its fixed failure cause.",
29659
+ "attention.update-failed": "The sidebar could not be updated for a run.",
29660
+ "launch.ticket-link-failed": "A launched run's ticket could not be linked.",
29661
+ "launch.started": "A graph run was launched.",
29662
+ "launch.swept": "Runs that ended without an environment were removed.",
29663
+ "rewind.pending": "A run's code rewind has not finished.",
29664
+ "rewind.applied": "A run was restarted or rewound.",
29665
+ "rewind.waiting": "A run waits for its code rewind to finish.",
29666
+ "history.pruned": "Finished runs beyond an environment's history were removed.",
29667
+ "history.prune-failed": "Pruning an environment's run history failed.",
29668
+ "worktree.cleanup-failed": "A run's branch worktree cleanup failed.",
29669
+ "run.unreadable": "A run is unreadable, so it is not scheduled.",
29670
+ "run.pass-failed": "A pass over a run failed.",
29671
+ "transcript.capture-failed": "A run's transcript capture failed.",
29672
+ "ticket.link-failed": "A run's ticket could not be linked to its environment.",
29673
+ "template.skipped": "A built-in template was skipped as invalid or a duplicate."
29674
+ }
29675
+ }
29676
+ });
29677
+
29678
+ // ../protocol/src/log-vocabulary/nodes.ts
29679
+ var NODES_LOG_AREAS = defineLogAreas({
29680
+ nodes: {
29681
+ description: "Command nodes: links, handovers, leaf mail and project copies.",
29682
+ events: {
29683
+ "actions.resume-failed": "Approved actions could not be resumed; a later pass retries.",
29684
+ "project-copy.notify-failed": "The coordinator could not be told a project copy finished.",
29685
+ "mail.delivery-deferred": "Leaf mail could not reach a coordinator yet.",
29686
+ "command.post-step-failed": "A step after a routed command failed.",
29687
+ "seed-files.incomplete": "Seed files for a leaf environment were not all copied.",
29688
+ "contact.record-failed": "The latest controller contact could not be recorded.",
29689
+ "settings.send-failed": "Settings could not be sent to a node.",
29690
+ "verification.record-failed": "A node verification could not be recorded.",
29691
+ "profile.record-failed": "A node profile could not be recorded.",
29692
+ "detach.unconfirmed": "A forgotten node has not confirmed the detach yet.",
29693
+ "handover.recovery-pending": "Command handover recovery is still pending."
29694
+ }
29695
+ }
29696
+ });
29697
+
29698
+ // ../protocol/src/log-vocabulary/linear.ts
29699
+ var LINEAR_LOG_AREAS = defineLogAreas({
29700
+ linear: {
29701
+ description: "Linear issues read for build actions.",
29702
+ events: {
29703
+ "comments.load-failed": "An issue's comments could not be loaded; the issue still renders without them."
29704
+ }
29705
+ }
29706
+ });
29707
+
29708
+ // ../protocol/src/log-vocabulary/usage-history.ts
29709
+ var USAGE_HISTORY_LOG_AREAS = defineLogAreas({
29710
+ "usage-history": {
29711
+ description: "Recorded agent token usage.",
29712
+ events: {
29713
+ "record.failed": "Agent usage could not be recorded; a later read counts it.",
29714
+ "prune.failed": "Pruning recorded usage failed; the next prune retries."
29715
+ }
29716
+ }
29717
+ });
29718
+
29719
+ // ../protocol/src/log-vocabulary/feature.ts
29720
+ var FEATURE_LOG_AREAS = defineLogAreas({
29721
+ feature: {
29722
+ description: "Pipeline environments started from a feature, and feature planning.",
29723
+ events: {
29724
+ "naming.fallback": "Automatic naming failed, so a local fallback name is used. Error kind only: the description stays out.",
29725
+ "planning.legacy-adopt-failed": "Legacy planning conversations could not be adopted.",
29726
+ "planning.tick-retrying": "A planning tick failed on a transient error; the next tick retries."
29727
+ }
29728
+ }
29729
+ });
29730
+
29731
+ // ../protocol/src/log-vocabulary/host.ts
29732
+ var HOST_LOG_AREAS = defineLogAreas({
29733
+ host: {
29734
+ description: "The host machine: its executables, load, suspends and maintenance.",
29735
+ events: {
29736
+ "path.discovered": "Executable discovery finished. Counts and booleans only: PATH entries can hold private directory names.",
29737
+ "tool.available": "A host tool's availability was read.",
29738
+ "tool.missing": "A host tool was not found.",
29739
+ "maintenance.listener-failed": "A host maintenance listener threw; the others still run.",
29740
+ "suspend.reconcile-failed": "Reconciling due work after a host suspension failed.",
29741
+ "load.sample-failed": "Sampling machine load failed; the next sample retries."
29742
+ }
29743
+ }
29744
+ });
29745
+
29746
+ // ../protocol/src/log-vocabulary/transcript-artifacts.ts
29747
+ var TRANSCRIPT_ARTIFACTS_LOG_AREAS = defineLogAreas({
29748
+ "transcript-artifacts": {
29749
+ description: "Transcript artifacts: previews, printing, grants and their ledger. Ids, kinds, sizes and reason codes only.",
29750
+ events: {
29751
+ "announce-failed": "An artifact change could not be announced.",
29752
+ "cleanup-failed": "An artifact cleanup failed.",
29753
+ "grant-revocation-failed": "A grant could not be revoked.",
29754
+ "ledger-listener-failed": "A ledger listener threw.",
29755
+ "ledger-read-failed": "The ledger could not be read.",
29756
+ "operation-executor-failed": "A preview operation's executor failed.",
29757
+ "operation-failed": "A preview operation failed.",
29758
+ "pdf-preview": "A PDF preview was served.",
29759
+ "pdf-preview-failed": "A PDF preview failed.",
29760
+ "pdf-print-failed": "Printing an artifact to PDF failed.",
29761
+ "pdf-printed": "An artifact was printed to PDF.",
29762
+ "runtime-unavailable": "The artifact runtime could not be created."
29763
+ }
29764
+ }
29765
+ });
29766
+
29767
+ // ../protocol/src/log-vocabulary/scheduler.ts
29768
+ var SCHEDULER_LOG_AREAS = defineLogAreas({
29769
+ scheduler: {
29770
+ description: "Scheduled jobs and the backend-owned timing that fires them.",
29771
+ events: {
29772
+ "tick.failed": "A scheduler tick failed; the next tick retries.",
29773
+ "job.claim-failed": "A due job could not be claimed.",
29774
+ "fire.heartbeat-failed": "A running fire's heartbeat could not be recorded.",
29775
+ "fire.outcome-record-failed": "A finished fire's outcome could not be recorded."
29776
+ }
29777
+ }
29778
+ });
29779
+
29089
29780
  // ../protocol/src/log-vocabulary/web-app.ts
29090
29781
  var WEB_APP_LOG_AREAS = defineLogAreas({
29091
29782
  "web.app": {
@@ -29253,7 +29944,7 @@ var WEB_ENVIRONMENT_LOG_AREAS = defineLogAreas({
29253
29944
  "models.pi-seed-failed": "The create dialog could not seed the Pi model catalogue.",
29254
29945
  "models.opencode-cache-load-failed": "The create dialog could not read cached OpenCode models.",
29255
29946
  "github-credential.check-failed": "The GitHub credential check before creating failed.",
29256
- "feature-build.start-failed": "Starting a feature build from the dialog failed.",
29947
+ "feature-build.start-failed": "Starting a pipeline environment from the dialog failed.",
29257
29948
  "settings.extensions-load-failed": "The settings dialog could not load extensions.",
29258
29949
  "settings.container-reset-failed": "The settings dialog could not reset the container.",
29259
29950
  "settings.save-failed": "The settings dialog could not save.",
@@ -29545,6 +30236,25 @@ var LOG_VOCABULARY = {
29545
30236
  ...TMUX_LOG_AREAS,
29546
30237
  ...UPDATER_LOG_AREAS,
29547
30238
  ...WEB_ANNOTATIONS_LOG_AREAS,
30239
+ ...STORAGE_LOG_AREAS,
30240
+ ...BUILD_PIPELINE_LOG_AREAS,
30241
+ ...AGENT_BRANCH_LOG_AREAS,
30242
+ ...CHANGE_TRACKING_LOG_AREAS,
30243
+ ...COORDINATOR_LOG_AREAS,
30244
+ ...REVIEW_LOG_AREAS,
30245
+ ...PUBLIC_API_LOG_AREAS,
30246
+ ...AGENT_ACCOUNTS_LOG_AREAS,
30247
+ ...DOCKER_LOG_AREAS,
30248
+ ...MCP_LOG_AREAS,
30249
+ ...DESIGN_LOG_AREAS,
30250
+ ...GRAPH_LOG_AREAS,
30251
+ ...NODES_LOG_AREAS,
30252
+ ...LINEAR_LOG_AREAS,
30253
+ ...USAGE_HISTORY_LOG_AREAS,
30254
+ ...FEATURE_LOG_AREAS,
30255
+ ...HOST_LOG_AREAS,
30256
+ ...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
30257
+ ...SCHEDULER_LOG_AREAS,
29548
30258
  ...WEB_APP_LOG_AREAS,
29549
30259
  ...WEB_BUILD_PIPELINE_LOG_AREAS,
29550
30260
  ...WEB_CHAT_LOG_AREAS,
@@ -29722,7 +30432,10 @@ function deliver(record) {
29722
30432
  line: config2.format === "json" ? renderJson(record) : renderText(record),
29723
30433
  record
29724
30434
  });
29725
- } catch {}
30435
+ return true;
30436
+ } catch {
30437
+ return false;
30438
+ }
29726
30439
  }
29727
30440
  function buildRecord(level, area, event, fields) {
29728
30441
  const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
@@ -29878,6 +30591,19 @@ function resolveFields(fields) {
29878
30591
  return { fieldsFailed: true };
29879
30592
  }
29880
30593
  }
30594
+ function deliverEvent(level, area, event, fields) {
30595
+ const spec = areaSpec(area);
30596
+ if (!spec)
30597
+ return deliver(buildRecord(level, "logging", "unknown-area", undefined));
30598
+ if (!Object.hasOwn(spec.events, event))
30599
+ return deliver(buildRecord(level, area, "invalid-event", undefined));
30600
+ return deliver(buildRecord(level, area, event, fields));
30601
+ }
30602
+ function tryWriteLog(level, area, event, fields) {
30603
+ if (LEVEL_RANK[level] > thresholdRank(area))
30604
+ return false;
30605
+ return deliverEvent(level, area, event, resolveFields(fields));
30606
+ }
29881
30607
  function createLogger(area) {
29882
30608
  const spec = areaSpec(area);
29883
30609
  let seenGeneration = -1;
@@ -29890,13 +30616,7 @@ function createLogger(area) {
29890
30616
  return LEVEL_RANK[level] <= rank;
29891
30617
  };
29892
30618
  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
- }
30619
+ deliverEvent(level, area, event, resolved);
29900
30620
  };
29901
30621
  const write = (level, event, fields) => {
29902
30622
  if (!enabled(level))
@@ -30836,8 +31556,19 @@ import {
30836
31556
 
30837
31557
  // ../protocol/src/node/bridge-diagnostics.ts
30838
31558
  import { createHash as createHash2 } from "node:crypto";
30839
- var log3 = createLogger("bridge.diagnostics");
30840
- var INTERVAL_MS = 60000;
31559
+
31560
+ // ../protocol/src/event-loop-stall-monitor.ts
31561
+ var log3 = createLogger("event-loop");
31562
+ var EVENT_LOOP_STALL_ALWAYS_LOG_MS = 1e4;
31563
+
31564
+ // ../protocol/src/node/bridge-diagnostics.ts
31565
+ var log4 = createLogger("bridge.diagnostics");
31566
+ var BRIDGE_DIAGNOSTICS_INTERVAL_MS = 60000;
31567
+ var INTERVAL_MS = BRIDGE_DIAGNOSTICS_INTERVAL_MS;
31568
+ var STALL_NO_DELTA_MS = 2 * INTERVAL_MS;
31569
+ var STALL_TOOL_PENDING_MS = 10 * 60000;
31570
+ var STALL_TICK_DELAY_MS = EVENT_LOOP_STALL_ALWAYS_LOG_MS;
31571
+ var BRIDGE_DIAGNOSTICS_KEEPALIVE_MS = 10 * 60000;
30841
31572
  var MAX_PENDING_TOOLS = 128;
30842
31573
  var MAX_REPORTED_TOOLS = 8;
30843
31574
  var MAX_ID_LENGTH = 1024;
@@ -30898,6 +31629,28 @@ var UPDATE_KINDS = new Set([
30898
31629
  "step-started",
30899
31630
  "step-completed"
30900
31631
  ]);
31632
+ var COUNTER_CHANGE_THRESHOLDS = {
31633
+ stderrBytes: 4096,
31634
+ requestsSent: 1,
31635
+ responsesReceived: 1,
31636
+ timeouts: 1,
31637
+ notificationsReceived: Number.POSITIVE_INFINITY,
31638
+ protocolErrors: 1
31639
+ };
31640
+ var WAITING_PHASES = new Set([
31641
+ "sending",
31642
+ "following",
31643
+ "draining",
31644
+ "cancelling"
31645
+ ]);
31646
+ function sameSet(a, b) {
31647
+ if (a.size !== b.size)
31648
+ return false;
31649
+ for (const value of a)
31650
+ if (!b.has(value))
31651
+ return false;
31652
+ return true;
31653
+ }
30901
31654
  function identity(value) {
30902
31655
  if (typeof value !== "string" || !value || value.length > MAX_ID_LENGTH)
30903
31656
  return;
@@ -30973,26 +31726,35 @@ function safeDiagnosticMetrics(value) {
30973
31726
  result.state = value.state;
30974
31727
  return result;
30975
31728
  }
31729
+ function bridgeDiagnosticsChangesEnabled() {
31730
+ return log4.isEnabled("trace");
31731
+ }
30976
31732
  function writeBridgeDiagnostic({ bridge, event, payload }) {
30977
- log3.info(event, { bridge, payload });
31733
+ return tryWriteLog("info", "bridge.diagnostics", event, { bridge, payload });
30978
31734
  }
30979
31735
  function bridgeDiagnosticsActive() {
30980
- return log3.isEnabled("info");
31736
+ return log4.isEnabled("info");
31737
+ }
31738
+ function bridgeDiagnosticsStreamEnabled(bridge) {
31739
+ return bridgeDebugEnabled(bridge) || log4.isEnabled("debug");
30981
31740
  }
30982
31741
  function writeDiagnostic(bridge, event, payload, write) {
30983
31742
  try {
30984
31743
  const json = JSON.stringify({ bridge, event, ...payload });
30985
31744
  const bytes = Buffer.byteLength(json);
30986
31745
  if (bytes <= MAX_BRIDGE_DIAGNOSTIC_BYTES) {
30987
- write({ bridge, event, payload: json });
30988
- return;
31746
+ const accepted = write({ bridge, event, payload: json });
31747
+ return accepted !== false;
30989
31748
  }
30990
- write({
31749
+ const accepted = write({
30991
31750
  bridge,
30992
31751
  event: "snapshot-overflow",
30993
31752
  payload: JSON.stringify({ bridge, event: "snapshot-overflow", omittedBytes: bytes })
30994
31753
  });
30995
- } catch {}
31754
+ return accepted !== false;
31755
+ } catch {
31756
+ return false;
31757
+ }
30996
31758
  }
30997
31759
 
30998
31760
  class BridgeRunDiagnostics {
@@ -31024,6 +31786,7 @@ class BridgeRunDiagnostics {
31024
31786
  completedTools = 0;
31025
31787
  pending = new Map;
31026
31788
  phase = "sending";
31789
+ processScope = false;
31027
31790
  terminal = "pending";
31028
31791
  stream = "pending";
31029
31792
  cancellation = "none";
@@ -31031,6 +31794,8 @@ class BridgeRunDiagnostics {
31031
31794
  run;
31032
31795
  closed = false;
31033
31796
  wasActive;
31797
+ baseline;
31798
+ changeQueued = false;
31034
31799
  timer;
31035
31800
  constructor(bridge, state, now = Date.now, write = writeBridgeDiagnostic, intervalMs = INTERVAL_MS, metrics = () => ({}), active = () => true) {
31036
31801
  this.bridge = bridge;
@@ -31076,7 +31841,8 @@ class BridgeRunDiagnostics {
31076
31841
  return;
31077
31842
  }
31078
31843
  if (stage === "completed") {
31079
- this.pending.delete(key);
31844
+ if (this.pending.delete(key))
31845
+ this.changed();
31080
31846
  this.completedTools++;
31081
31847
  return;
31082
31848
  }
@@ -31091,13 +31857,23 @@ class BridgeRunDiagnostics {
31091
31857
  stage: stage === "started" || existing?.stage === "started" ? "started" : "partial",
31092
31858
  nested
31093
31859
  });
31860
+ if (!existing)
31861
+ this.changed();
31094
31862
  }
31095
31863
  checkpoint(phase) {
31864
+ if (phase === "attached")
31865
+ this.processScope = true;
31866
+ if (phase === this.phase)
31867
+ return;
31096
31868
  this.phase = phase;
31869
+ this.changed();
31097
31870
  }
31098
31871
  count(key, amount = 1) {
31099
- if (!this.closed && Number.isSafeInteger(amount) && amount >= 0)
31100
- this.counters[key] += amount;
31872
+ if (this.closed || !Number.isSafeInteger(amount) || amount < 0)
31873
+ return;
31874
+ this.counters[key] += amount;
31875
+ if (amount > 0 && Number.isFinite(COUNTER_CHANGE_THRESHOLDS[key]))
31876
+ this.changed();
31101
31877
  }
31102
31878
  translationFailed() {
31103
31879
  this.translationFailures++;
@@ -31113,8 +31889,10 @@ class BridgeRunDiagnostics {
31113
31889
  }
31114
31890
  terminalSettled(outcome) {
31115
31891
  this.terminal = outcome;
31116
- if (outcome === "resolved")
31892
+ if (outcome === "resolved" && this.phase !== "draining") {
31117
31893
  this.phase = "draining";
31894
+ this.changed();
31895
+ }
31118
31896
  }
31119
31897
  requestCancellation(reason = "user") {
31120
31898
  this.cancellation = "pending";
@@ -31136,12 +31914,38 @@ class BridgeRunDiagnostics {
31136
31914
  if (this.closed)
31137
31915
  return;
31138
31916
  const now = this.now();
31139
- const age = (time) => time === undefined ? null : Math.max(0, now - time);
31140
31917
  const tickDelayMs = event === "heartbeat" ? Math.max(0, now - this.lastTick - this.intervalMs) : 0;
31141
31918
  if (event === "heartbeat")
31142
31919
  this.lastTick = now;
31143
- if (!this.active() || !bridgeDiagnosticsActive())
31920
+ if (!bridgeDiagnosticsActive())
31921
+ return;
31922
+ const stall = this.stallState(now, tickDelayMs);
31923
+ if (event === "heartbeat" && !this.active() && !this.periodicDue(now, stall))
31924
+ return;
31925
+ this.writeSnapshot(event, now, tickDelayMs, stall);
31926
+ }
31927
+ changed() {
31928
+ if (this.closed || this.changeQueued || !bridgeDiagnosticsChangesEnabled())
31929
+ return;
31930
+ this.changeQueued = true;
31931
+ queueMicrotask(() => {
31932
+ this.changeQueued = false;
31933
+ this.reportChange();
31934
+ });
31935
+ }
31936
+ reportChange() {
31937
+ if (this.closed || !bridgeDiagnosticsChangesEnabled() || !bridgeDiagnosticsActive())
31144
31938
  return;
31939
+ const last = this.baseline;
31940
+ if (last && !this.changedSince(last))
31941
+ return;
31942
+ const now = this.now();
31943
+ try {
31944
+ this.writeSnapshot("change", now, 0, this.stallState(now, 0));
31945
+ } catch {}
31946
+ }
31947
+ writeSnapshot(event, now, tickDelayMs, stall) {
31948
+ const age = (time) => time === undefined ? null : Math.max(0, now - time);
31145
31949
  const pendingTools = Array.from(this.pending.entries()).slice(0, MAX_REPORTED_TOOLS).map(([id, tool]) => ({
31146
31950
  id,
31147
31951
  kind: tool.kind,
@@ -31150,7 +31954,7 @@ class BridgeRunDiagnostics {
31150
31954
  ageMs: age(tool.since)
31151
31955
  }));
31152
31956
  try {
31153
- writeDiagnostic(this.bridge, event, {
31957
+ const written = writeDiagnostic(this.bridge, event, {
31154
31958
  session: identity(this.state.id),
31155
31959
  run: this.run,
31156
31960
  phase: this.phase,
@@ -31177,8 +31981,64 @@ class BridgeRunDiagnostics {
31177
31981
  completedTools: this.completedTools,
31178
31982
  tickDelayMs
31179
31983
  }, this.write);
31984
+ if (!written)
31985
+ return;
31986
+ this.baseline = {
31987
+ at: now,
31988
+ phase: this.phase,
31989
+ pending: new Set(this.pending.keys()),
31990
+ counters: { ...this.counters },
31991
+ stall
31992
+ };
31180
31993
  } catch {}
31181
31994
  }
31995
+ periodicDue(now, stall) {
31996
+ if (stall.signals.has("tick-delay"))
31997
+ return true;
31998
+ const last = this.baseline;
31999
+ if (!last)
32000
+ return true;
32001
+ if (!sameSet(stall.signals, last.stall.signals) || !sameSet(stall.tools, last.stall.tools))
32002
+ return true;
32003
+ if (stall.signals.has("no-delta") && this.changedSince(last))
32004
+ return true;
32005
+ return now - last.at >= BRIDGE_DIAGNOSTICS_KEEPALIVE_MS;
32006
+ }
32007
+ changedSince(last) {
32008
+ if (this.phase !== last.phase)
32009
+ return true;
32010
+ if (this.pending.size !== last.pending.size)
32011
+ return true;
32012
+ for (const key of this.pending.keys())
32013
+ if (!last.pending.has(key))
32014
+ return true;
32015
+ for (const key of Object.keys(this.counters))
32016
+ if (this.counters[key] - last.counters[key] >= COUNTER_CHANGE_THRESHOLDS[key])
32017
+ return true;
32018
+ return false;
32019
+ }
32020
+ stallState(now, tickDelayMs) {
32021
+ const signals = new Set;
32022
+ const tools = new Set;
32023
+ let oldestPending;
32024
+ for (const [key, tool] of this.pending) {
32025
+ if (oldestPending === undefined || tool.since < oldestPending)
32026
+ oldestPending = tool.since;
32027
+ if (now - tool.since >= STALL_TOOL_PENDING_MS)
32028
+ tools.add(key);
32029
+ }
32030
+ const waitingSince = this.processScope ? oldestPending : WAITING_PHASES.has(this.phase) ? this.startedAt : undefined;
32031
+ if (waitingSince !== undefined) {
32032
+ const quietSince = Math.max(this.lastDelta ?? waitingSince, waitingSince);
32033
+ if (now - quietSince >= STALL_NO_DELTA_MS)
32034
+ signals.add("no-delta");
32035
+ }
32036
+ if (tools.size > 0)
32037
+ signals.add("tool-pending");
32038
+ if (tickDelayMs >= STALL_TICK_DELAY_MS)
32039
+ signals.add("tick-delay");
32040
+ return { signals, tools };
32041
+ }
31182
32042
  close(phase = "finished") {
31183
32043
  if (this.closed)
31184
32044
  return;
@@ -31190,6 +32050,7 @@ class BridgeRunDiagnostics {
31190
32050
  this.pending.clear();
31191
32051
  }
31192
32052
  }
32053
+ var bufferedFlushes = new Set;
31193
32054
 
31194
32055
  // ../../bridges/cursor-bridge/src/sdk-diagnostics.ts
31195
32056
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -31662,7 +32523,7 @@ class CursorRunDiagnostics extends BridgeRunDiagnostics {
31662
32523
  }
31663
32524
  }
31664
32525
  function createRunDiagnostics(state) {
31665
- return new CursorRunDiagnostics(state, undefined, undefined, undefined, () => bridgeDebugEnabled("cursor"));
32526
+ return new CursorRunDiagnostics(state, undefined, undefined, undefined, () => bridgeDiagnosticsStreamEnabled("cursor"));
31666
32527
  }
31667
32528
  var MAX_SETUP_DETAIL_BYTES = 300;
31668
32529
  function cursorSetupDebug(stage, error) {
@@ -33497,7 +34358,7 @@ function trackTurnEvidence(conversationId, options) {
33497
34358
  }
33498
34359
 
33499
34360
  // ../../bridges/cursor-bridge/src/agent-session.ts
33500
- var log4 = createLogger("bridge.cursor");
34361
+ var log5 = createLogger("bridge.cursor");
33501
34362
 
33502
34363
  class CredentialError extends Error {
33503
34364
  constructor(message) {
@@ -34042,7 +34903,7 @@ async function setResumableAgentArchived(agentId, archived) {
34042
34903
  const options = { cwd: workingDirectory };
34043
34904
  await (archived ? api.archive(agentId, options) : api.unarchive(agentId, options));
34044
34905
  } catch (error) {
34045
- log4.warn("agent.archive-failed", { archived, error: formatLogError(error, { stack: false }) });
34906
+ log5.warn("agent.archive-failed", { archived, error: formatLogError(error, { stack: false }) });
34046
34907
  return "failed";
34047
34908
  } finally {
34048
34909
  agentArchiveOperations.delete(agentId);
@@ -37502,7 +38363,7 @@ async function answerSessionActivityBatch(body, read, options = {}) {
37502
38363
  }
37503
38364
 
37504
38365
  // ../../bridges/cursor-bridge/src/http.ts
37505
- var log5 = createLogger("bridge.cursor");
38366
+ var log6 = createLogger("bridge.cursor");
37506
38367
 
37507
38368
  class HttpError extends Error {
37508
38369
  status;
@@ -37567,7 +38428,7 @@ async function route(request, response, clientSignal) {
37567
38428
  if (error instanceof PromptAttachmentError) {
37568
38429
  return json(response, 400, { error: error.message });
37569
38430
  }
37570
- log5.error("http.route-failed");
38431
+ log6.error("http.route-failed");
37571
38432
  return json(response, 500, { error: "Internal bridge error" });
37572
38433
  }
37573
38434
  }
@@ -38555,7 +39416,7 @@ function startParentWatchdog(options) {
38555
39416
  }
38556
39417
 
38557
39418
  // ../protocol/src/bridge-lifecycle.ts
38558
- var log6 = createLogger("bridge.lifecycle");
39419
+ var log7 = createLogger("bridge.lifecycle");
38559
39420
  var TERMINATION_SIGNALS = ["SIGTERM", "SIGINT"];
38560
39421
  function errorKind(error) {
38561
39422
  if (error instanceof Error)
@@ -38609,7 +39470,7 @@ class BridgeLifecycle {
38609
39470
  }
38610
39471
  requestExit() {
38611
39472
  this.#exit ??= this.shutdown().then(() => this.#options.exit(0), (error) => {
38612
- log6.error("shutdown.failed", {
39473
+ log7.error("shutdown.failed", {
38613
39474
  bridge: this.#options.label,
38614
39475
  errorClass: errorKind(error)
38615
39476
  });
@@ -38626,7 +39487,7 @@ class BridgeLifecycle {
38626
39487
  try {
38627
39488
  idleSweep.run();
38628
39489
  } catch (error) {
38629
- log6.warn("idle-sweep.failed", {
39490
+ log7.warn("idle-sweep.failed", {
38630
39491
  bridge: this.#options.label,
38631
39492
  errorClass: errorKind(error)
38632
39493
  });
@@ -38698,7 +39559,7 @@ async function settleIdleDetaches() {
38698
39559
  }
38699
39560
 
38700
39561
  // ../../bridges/cursor-bridge/src/server.ts
38701
- var log7 = createLogger("bridge.cursor");
39562
+ var log8 = createLogger("bridge.cursor");
38702
39563
  var IDLE_SWEEP_MS = 60 * 1000;
38703
39564
  var lifecycle;
38704
39565
  var server = createServer((request, response) => {
@@ -38733,7 +39594,7 @@ function lifecycleFor(listenPort, options) {
38733
39594
  applyWorkingDirectory();
38734
39595
  await loadPersistedState();
38735
39596
  finishRestoredTombstones().catch(() => {
38736
- log7.warn("startup.closes-failed");
39597
+ log8.warn("startup.closes-failed");
38737
39598
  });
38738
39599
  await new Promise((resolve) => server.listen(listenPort, hostname, resolve));
38739
39600
  },