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.
@@ -1,226 +1,6 @@
1
1
  // ../protocol/src/node/bridge-diagnostics.ts
2
2
  import { createHash } from "node:crypto";
3
3
 
4
- // ../protocol/src/log-vocabulary/define.ts
5
- var THROTTLE_LOG_EVENTS = {
6
- "throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
7
- "throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
8
- "throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
9
- };
10
- function defineLogAreas(areas) {
11
- return areas;
12
- }
13
-
14
- // ../protocol/src/log-vocabulary/bridge.ts
15
- var MAX_BRIDGE_DIAGNOSTIC_BYTES = 8192;
16
- var BRIDGE_LOG_AREAS = defineLogAreas({
17
- "bridge.diagnostics": {
18
- description: "Metadata snapshots of bridge turns and processes, written while Save Logs for Debugging is on. docs/architecture/bridge-diagnostics.md reads them.",
19
- tag: "bridge-diagnostics",
20
- maxStringChars: MAX_BRIDGE_DIAGNOSTIC_BYTES,
21
- events: {
22
- heartbeat: "The once-a-minute snapshot of a turn or process that is still open.",
23
- "send-started": "A turn or process diagnostic scope began.",
24
- "send-resolved": "The provider accepted a dispatch.",
25
- "cancel-requested": "Cancellation of a turn was requested.",
26
- "cancel-settled": "The provider's cancel call returned or failed.",
27
- closed: "A diagnostic scope ended, with its final counters.",
28
- "snapshot-overflow": "A snapshot exceeded the bound, so only its size was written.",
29
- "debug-events": "A batch of allowlisted debug labels with their counts.",
30
- "setup-failed": "A Cursor setup step failed and swallowed its error.",
31
- "sdk-snapshot": "Cursor's SDK transports and executions at a boundary.",
32
- "sdk-snapshot-overflow": "A Cursor SDK snapshot exceeded the bound, so it was omitted."
33
- }
34
- },
35
- "bridge.lifecycle": {
36
- description: "What every long-lived bridge does the same way: its sweep and its shutdown.",
37
- events: {
38
- "idle-sweep.failed": "An idle sweep threw; the next tick retries.",
39
- "shutdown.failed": "Releasing the bridge failed during shutdown; it still exits."
40
- }
41
- },
42
- "bridge.acp": {
43
- description: "The ACP bridge behind Grok: its routes, sessions, saved state and change evidence.",
44
- events: {
45
- "command-change.record-failed": "A measured command change could not be recorded.",
46
- "evidence.record-failed": "Change evidence could not be recorded; the read loop carries on.",
47
- "evidence.shell-record-failed": "A shell observation could not be recorded.",
48
- "evidence.turn-record-failed": "Turn change evidence could not be recorded.",
49
- "server.listening": "The HTTP server is listening.",
50
- "state.composer-reset": "A saved composer state was malformed and was reset.",
51
- "state.discarded": "Saved bridge state could not be used and was discarded.",
52
- "state.persist-failed": "Saving bridge state failed; a later write retries.",
53
- "state.session-config-reset": "A saved session configuration was malformed and was reset."
54
- }
55
- },
56
- "bridge.claude": {
57
- description: "The Claude bridge: its routes, sessions, parked interactions and the Agent SDK turn loop.",
58
- events: {
59
- "commands.read-failed": "The command catalogue read failed; the cached answer stands.",
60
- "context-usage.read-failed": "The detailed context usage read failed; the route falls back.",
61
- "dispatch.rollback-failed": "Rolling back a prompt dispatch claim failed.",
62
- "event-subscriber.failed": "An event subscriber threw; other subscribers still ran.",
63
- "http.request-failed": "An HTTP route threw; it answered 500.",
64
- "mcp.config-ignored": "An MCP server configuration of an unsupported shape was ignored.",
65
- "mcp.read-failed": "Listing MCP servers failed; the route answered 500.",
66
- "models.fetch-failed": "Reading the supported models failed; the fallback catalogue is served.",
67
- "models.requested": "The model catalogue route was called.",
68
- "models.responded": "The model catalogue route answered.",
69
- "parent.gone": "The backend that launched this bridge has gone; shutting down.",
70
- "plan-approval.responding": "Answering a parked plan approval.",
71
- "plan-approval.response-failed": "The plan approval route failed.",
72
- "plan-approval.response-received": "The route received a plan approval answer.",
73
- "plan-approval.result": "A parked plan approval was answered.",
74
- "plan-approval.wait-failed": "A parked plan approval ended without an answer: cancelled, timed out or closed.",
75
- "plan-exit.failure-overridden": "ExitPlanMode failed after the user approved; treated as success with a continuation re-prompt.",
76
- "plan-mode.record-failed": "Plan mode from a status frame could not be recorded.",
77
- "plan.reprompt-approved-failed": "Re-prompting after an approved plan failed.",
78
- "plan.reprompt-feedback-failed": "Re-prompting with plan rejection feedback failed.",
79
- "plugin.path-missing": "A configured plugin was skipped because its path does not exist.",
80
- "plugin.unsafe-path": "An installed plugin was skipped because its install path is unsafe.",
81
- "plugins.read-failed": "Listing plugins failed; the route answered 500.",
82
- "prompt.accepted": "The route accepted a prompt and answered 202.",
83
- "prompt.failed": "A prompt turn failed; the session reports the error.",
84
- "prompt.processing-failed": "A prompt accepted by the route failed while processing.",
85
- "prompt.received": "A prompt reached the bridge; only its length is logged.",
86
- "prompt.send-failed": "A prompt request failed; the route answered with an error.",
87
- "query.close-failed": "Stopping the Claude query failed while closing a tab; the close stays pending.",
88
- "query.failed": "A Claude query ended with an error result.",
89
- "question.answer-failed": "The answer-question route failed.",
90
- "question.answering": "Answering a parked question.",
91
- "question.answers-prepared": "The route prepared a question answer for the session.",
92
- "question.answers-received": "A parked question received its answers.",
93
- "question.stale": "An answer arrived for a question no longer pending; the route answered stale.",
94
- "question.wait-failed": "A parked question ended without an answer: cancelled, timed out or closed.",
95
- "runtime.ended-under-resumed-turn": "The Claude runtime ended while a resumed root turn was still open.",
96
- "server.listening": "The HTTP server is listening.",
97
- "server.starting": "The HTTP server is about to bind.",
98
- "session.compact-failed": "A requested compaction failed.",
99
- "session.create-failed": "Creating a session failed; the route answered with an error.",
100
- "session.created": "A session was created or recovered.",
101
- "session.delete-failed": "Deleting a session failed.",
102
- "session.fork-failed": "Forking a session failed.",
103
- "session.rename-failed": "Renaming a session failed.",
104
- "session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
105
- "session.rewind-failed": "Rewinding session files failed.",
106
- "session.task-state-hydrate-failed": "Hydrating session task state failed; the route answered with an error.",
107
- "sessions.reconcile-failed": "Reconciling persisted sessions failed; the sessions already known are listed.",
108
- "sse.aborted": "The client closed an event stream.",
109
- "sse.cleanup": "An event stream connection was released.",
110
- "sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
111
- "sse.handshake-failed": "An event stream failed during its handshake; the client reconnects.",
112
- "sse.keepalive-failed": "An event stream keepalive failed, usually a client that has gone; the connection closes.",
113
- "sse.opened": "An event stream connection opened.",
114
- "sse.subscribe-requested": "A client asked to subscribe to the event stream.",
115
- "sse.write-failed": "Writing to an event stream failed; the connection closes and the client reconnects.",
116
- "task.candidate-bound-reached": "An unresolved Bash call was not tracked as a background task: the candidate bound is full.",
117
- "task.details-persist-failed": "Shell task details could not be saved; the task carries on.",
118
- "task.settling-bound-reached": "A settling task was not tracked: the settling bound is full.",
119
- "task.stop-failed": "Stopping a background task failed on a control channel that had closed.",
120
- "task.stop-route-failed": "The stop-task route failed.",
121
- "transcript.background-hydrate-failed": "Hydrating a transcript in the background failed; the next read retries.",
122
- "transcript.hydrate-failed": "Hydrating a transcript before a prompt failed; the prompt runs and a later read retries."
123
- }
124
- },
125
- "bridge.codex": {
126
- description: "The Codex bridge: its routes, sessions and the app-server child it supervises.",
127
- events: {
128
- "account.connector-recovery-failed": "Recovering account connectors failed; the account answer stands.",
129
- "account.login-reload-failed": "Reloading the stored account login failed.",
130
- "account.sign-in-check-failed": "An account sign-in check failed; admission is left unchanged.",
131
- "account.usage-read-failed": "Reading account usage failed; the route answers 503.",
132
- "app-server.drain-expired": "The drain deadline expired, so app-server restarted with turns still in flight.",
133
- "app-server.exited": "app-server exited unexpectedly; the code and signal say how.",
134
- "app-server.invariant-violation": "app-server asked for something its configuration forbids.",
135
- "app-server.protocol-violation": "app-server wrote a line that is not valid protocol; it was ignored.",
136
- "app-server.recording": "Notification recording is on; recordings hold content.",
137
- "app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
138
- "app-server.stderr": "Metadata of an app-server stderr line, never its content.",
139
- "app-server.stderr-suppressed": "app-server stderr lines beyond the budget were counted, not described.",
140
- "approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
141
- "approval.present-failed": "Presenting an approval threw; it is auto-declined.",
142
- "approval.resolved-callback-failed": "An approval resolved callback threw.",
143
- "command-changes.record-failed": "Recording line changes for a command failed; the turn carries on.",
144
- "dispatch.reconcile-failed": "A dispatch could not be reconciled against its thread; it stays recovering.",
145
- "dispatch.restore-failed": "A journaled dispatch could not be restored after a restart; recovery retries.",
146
- "engine.listener-failed": "An engine event listener threw; the others still ran.",
147
- "engine.ready": "The app-server engine started.",
148
- "engine.start-failed": "The app-server engine failed to start; reported through health.",
149
- "engine.stop-failed": "Stopping the Codex engine failed during shutdown; the bridge exits anyway.",
150
- "generation.recovery-failed": "Recovering sessions after an app-server generation change failed.",
151
- "http.request-failed": "An HTTP route threw; it answered 500.",
152
- "idle-sweep.failed": "An idle sweep failed; the next one retries.",
153
- "interaction.present-failed": "Presenting an interaction threw; it is cancelled.",
154
- "interaction.resolved-callback-failed": "An interaction resolved callback threw.",
155
- "journal.persist-failed": "Saving the dispatch journal failed.",
156
- "message.publish-failed": "Publishing a message update failed.",
157
- "models.cache-persist-failed": "Saving the model cache failed.",
158
- "models.debug-read-failed": "`codex debug models` failed; another source is used.",
159
- "models.list-failed": "model/list failed; the cached models are served.",
160
- "models.refresh-failed": "A background model refresh failed; the cache stands.",
161
- "notification.enqueue-failed": "Queueing a notification threw.",
162
- "ordered-events.flush-failed": "Flushing before ordered-event reconciliation failed.",
163
- "ordered-events.publish-failed": "Publishing an ordered event failed; clients are told to rehydrate.",
164
- "ordered-events.reconcile-failed": "Reconciling ordered events failed.",
165
- "parent.gone": "The backend that launched this bridge has gone; stopping turns and shutting down.",
166
- "queue.task-failed": "A task on a per-thread queue failed.",
167
- "raw-log.write-failed": "Appending to the raw Codex log failed.",
168
- "recorder.notice": "The notification recorder needs attention: it is on, or was asked for without its confirmation.",
169
- "recorder.threw": "The notification recorder threw.",
170
- "recorder.write-failed": "Writing a notification recording failed; its lines were dropped.",
171
- "registry.persist-failed": "Saving the session registry failed; a later write retries.",
172
- "rollout.hydrate-failed": "A rollout could not be read to hydrate a thread.",
173
- "runtime-env.refresh-failed": "Refreshing the runtime environment failed; the last values stay.",
174
- "runtime-env.refreshed": "Runtime environment variables changed; names only, never values.",
175
- "server-request.answer-failed": "Answering a server request failed.",
176
- "server-request.flush-timeout": "An answer to a server request did not flush in time.",
177
- "server-request.handoff-failed": "Handing a server request to the router threw.",
178
- "session.config-apply-failed": "Applying session configuration failed; the route answers unavailable.",
179
- "sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
180
- "sse.keepalive-failed": "An event stream keepalive failed.",
181
- "sse.observer-failed": "An event stream observer failed; it reconnects.",
182
- "sse.payload-serialize-failed": "An event payload could not be serialized; a placeholder was sent.",
183
- "sse.payload-snapshot-failed": "An event payload could not be snapshotted; a placeholder was sent.",
184
- "sse.subscriber-failed": "An event stream subscriber failed; it reconnects and replays.",
185
- "subagent.activity-load-failed": "Sub-agent activity could not be loaded; the transcript renders without it.",
186
- "thread.archive-failed": "Archiving or unarchiving a thread failed.",
187
- "thread.fork-failed": "thread/fork failed; the route answers 503.",
188
- "thread.fork-hydrate-failed": "A forked thread could not be hydrated and was closed.",
189
- "thread.reattach-failed": "A thread could not be re-attached.",
190
- "thread.rename-failed": "thread/name/set failed; the bridge title index stays authoritative.",
191
- "thread.turns-read-after-revert-failed": "A thread's turns could not be read after a revert.",
192
- "thread.turns-read-failed": "A thread's turns could not be read.",
193
- "thread.unsubscribe-failed": "thread/unsubscribe failed; the binding is kept so a retry can unsubscribe.",
194
- "threads.list-failed": "thread/list failed; sessions come from the rollout parser.",
195
- "transcript.serving-last-known": "A thread read failed, so the last known transcript is served.",
196
- "turn.capacity-retry-failed": "Retrying a turn after a capacity failure failed.",
197
- "turn.capacity-retry-journal-failed": "A capacity retry could not be journaled.",
198
- "turn.finalize-failed": "Finalizing a turn failed.",
199
- "turns.stopped": "Running turns were stopped because the backend went away."
200
- }
201
- },
202
- "bridge.cursor": {
203
- description: "The Cursor bridge: its routes, sessions and saved state.",
204
- events: {
205
- "agent.archive-failed": "Archiving or unarchiving an agent failed.",
206
- "http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
207
- "startup.closes-failed": "Finishing closes a previous process left behind failed at startup.",
208
- "startup.closes-incomplete": "Some closes a previous process left behind did not finish at startup; a retried close finishes them.",
209
- "state.publication-failing": "Saving bridge state is failing; new prompts and steers are refused until it recovers.",
210
- "state.publication-recovered": "Saving bridge state recovered.",
211
- "state.transcripts-shortened": "The state file reached its limit, so some sessions were saved with a shortened transcript copy."
212
- }
213
- },
214
- "bridge.pi": {
215
- description: "The Pi bridge: its routes, sessions and saved state.",
216
- events: {
217
- "http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
218
- "state.over-budget": "The state file stayed over budget after shedding transcripts, so the write was skipped.",
219
- "state.transcripts-shed": "The state file was over budget, so some sessions were saved without their transcript."
220
- }
221
- }
222
- });
223
-
224
4
  // ../protocol/src/secret-redaction.ts
225
5
  var TEXT_RULES = [
226
6
  {
@@ -328,8 +108,10 @@ function stackFrames(target, message) {
328
108
  `).filter((line) => /^\s*at\s/.test(line)).slice(0, MAX_STACK_FRAMES).map((line) => boundedText(relativeFrame(line), MAX_FRAME_CHARS));
329
109
  return frames.length > 0 ? frames : undefined;
330
110
  }
331
- function describe(error, includeStack, depth) {
111
+ function describe(error, includeStack, includeMessage, depth) {
332
112
  if (typeof error !== "object" || error === null) {
113
+ if (!includeMessage)
114
+ return { name: "NonError" };
333
115
  return {
334
116
  name: "NonError",
335
117
  message: typeof error === "string" ? boundedText(error, MAX_MESSAGE_CHARS) : `[${typeof error}]`
@@ -346,7 +128,7 @@ function describe(error, includeStack, depth) {
346
128
  const details = { name };
347
129
  if (commandFailure)
348
130
  details.outputOmitted = true;
349
- else if (message)
131
+ else if (message && includeMessage)
350
132
  details.message = boundedText(message, MAX_MESSAGE_CHARS);
351
133
  const code = read(error, "code");
352
134
  const safeCode = finite(code) ?? matching(code, CODE_PATTERN);
@@ -374,13 +156,13 @@ function describe(error, includeStack, depth) {
374
156
  details.errorCount = members.length;
375
157
  const cause = read(error, "cause") ?? (Array.isArray(members) ? members[0] : undefined);
376
158
  if (cause !== undefined && cause !== null && depth < MAX_CAUSE_DEPTH) {
377
- details.cause = describe(cause, false, depth + 1);
159
+ details.cause = describe(cause, false, includeMessage, depth + 1);
378
160
  }
379
161
  return details;
380
162
  }
381
163
  function formatLogError(error, options = {}) {
382
164
  try {
383
- return brand(describe(error, options.stack !== false, 0));
165
+ return brand(describe(error, options.stack !== false, options.message !== false, 0));
384
166
  } catch {
385
167
  return brand({ name: "Error", message: "[unreadable]" });
386
168
  }
@@ -397,32 +179,286 @@ function logErrorKind(error) {
397
179
  return matching(read(error, "name"), NAME_PATTERN) ?? "Error";
398
180
  }
399
181
 
182
+ // ../protocol/src/log-vocabulary/define.ts
183
+ var THROTTLE_LOG_EVENTS = {
184
+ "throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
185
+ "throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
186
+ "throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
187
+ };
188
+ function defineLogAreas(areas) {
189
+ return areas;
190
+ }
191
+
400
192
  // ../protocol/src/log-vocabulary/agent-mail.ts
401
193
  var AGENT_MAIL_LOG_AREAS = defineLogAreas({
402
194
  "agent-mail": {
403
195
  description: "Delivering agent mail into waiting agent sessions.",
404
196
  events: {
405
- "delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged."
197
+ "delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged.",
198
+ "drain.new-mail-failed": "Draining newly received mail failed; the next sweep delivers it.",
199
+ "presence.sync-failed": "Mailboxes could not be synchronized.",
200
+ "inject.verified": "An injected message's delivery was checked. Ids and decisions only.",
201
+ "inject.dispatched": "Messages were dispatched into a session. Ids and decisions only.",
202
+ "stopped-worker.action-failed": "Nothing could act on mail for a stopped worker.",
203
+ "coordinator.start-failed": "The main coordinator could not be started for a new message.",
204
+ "message.placed": "A message was placed in a mailbox. Ids and decisions only, never subjects or bodies.",
205
+ "budget.hold-notify-failed": "The coordinator could not be told about held worker mail.",
206
+ "budget.reset-failed": "The mail budget could not be reset for a prompted tab."
207
+ }
208
+ }
209
+ });
210
+
211
+ // ../protocol/src/log-vocabulary/backend.ts
212
+ var BACKEND_LOG_AREAS = defineLogAreas({
213
+ "build.pipeline": {
214
+ description: "Build delivery, ticket reconciliation and persisted pipeline recovery.",
215
+ events: {
216
+ "delivery-policy.failed": "A ticket delivery edit could not be reconciled with the running build.",
217
+ "criteria.failed": "Verify could not record criterion results on the ticket.",
218
+ "transcript-maintenance.failed": "Pipeline transcript maintenance failed.",
219
+ "hydrate.failed": "The renderer could not load the authoritative pipeline snapshot."
220
+ }
221
+ },
222
+ "backend.activity": {
223
+ description: "The backend's recurring activity and maintenance jobs.",
224
+ events: {
225
+ "job.failed": "One pass of the job named in `scope` failed; its next pass retries.",
226
+ ...THROTTLE_LOG_EVENTS
227
+ }
228
+ },
229
+ backend: {
230
+ description: "The backend process: startup, background notices and shutdown.",
231
+ events: {
232
+ starting: "The backend process is starting.",
233
+ "ssh-socket.resolved": "An SSH agent socket was found.",
234
+ "ssh-socket.missing": "No usable SSH agent socket was found.",
235
+ "standalone-updater.mismatch": "--standalone-updater does not match --data-dir, so self-update is off.",
236
+ "instance.publish-failed": "The instance descriptor could not be published.",
237
+ "instance.republish-failed": "The instance descriptor could not be republished; a later pass retries.",
238
+ "parent.exited": "The parent process exited, so local servers are shutting down.",
239
+ "startup.step-failed": "One part of startup failed and the backend carried on; `step` says which.",
240
+ "startup.setup-fence-failed": "An environment's interrupted setup could not be fenced.",
241
+ "startup.setup-adopt-failed": "An environment's pending setup could not be adopted.",
242
+ "startup.deletion-pending": "An interrupted environment deletion stays pending. Its owning step logged the detail.",
243
+ "startup.looped-review-pending": "Cleanup of the retired Looped Review stays pending.",
244
+ "notice.failed": "A background notice after a turn or prompt failed; `step` says which.",
245
+ "artifacts.live-unavailable": "Live interactive artifacts are unavailable.",
246
+ "shutdown.step-failed": "One part of shutdown failed and the rest went on; `step` says which.",
247
+ "shutdown.signal-received": "A signal started shutdown, which tells a clean quit from the backend being killed.",
248
+ "shutdown.finished": "Shutdown finished, and the process exits with `code`.",
249
+ "port-policy.second-backend": "Another backend serves the default data directory, so this one avoids its ports.",
250
+ "port-policy.serve-on-free-port": "--tailscale-serve is on a free gateway port; pass --port with --strict-gateway-port to keep one."
251
+ }
252
+ }
253
+ });
254
+
255
+ // ../protocol/src/log-vocabulary/bridge.ts
256
+ var MAX_BRIDGE_DIAGNOSTIC_BYTES = 8192;
257
+ var BRIDGE_LOG_AREAS = defineLogAreas({
258
+ "bridge.diagnostics": {
259
+ 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.",
260
+ tag: "bridge-diagnostics",
261
+ maxStringChars: MAX_BRIDGE_DIAGNOSTIC_BYTES,
262
+ events: {
263
+ 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.",
264
+ change: "At trace only: a snapshot written as soon as the phase, the pending tools or a counter past its threshold changes.",
265
+ "send-started": "A turn or process diagnostic scope began.",
266
+ "send-resolved": "The provider accepted a dispatch.",
267
+ "cancel-requested": "Cancellation of a turn was requested.",
268
+ "cancel-settled": "The provider's cancel call returned or failed.",
269
+ closed: "A diagnostic scope ended, with its final counters.",
270
+ "snapshot-overflow": "A snapshot exceeded the bound, so only its size was written.",
271
+ "debug-events": "A batch of allowlisted debug labels with their counts.",
272
+ "setup-failed": "A Cursor setup step failed and swallowed its error.",
273
+ "sdk-snapshot": "Cursor's SDK transports and executions at a boundary.",
274
+ "sdk-snapshot-overflow": "A Cursor SDK snapshot exceeded the bound, so it was omitted."
275
+ }
276
+ },
277
+ "bridge.lifecycle": {
278
+ description: "What every long-lived bridge does the same way: its sweep and its shutdown.",
279
+ events: {
280
+ "idle-sweep.failed": "An idle sweep threw; the next tick retries.",
281
+ "shutdown.failed": "Releasing the bridge failed during shutdown; it still exits."
282
+ }
283
+ },
284
+ "bridge.acp": {
285
+ description: "The ACP bridge behind Grok: its routes, sessions, saved state and change evidence.",
286
+ events: {
287
+ "command-change.record-failed": "A measured command change could not be recorded.",
288
+ "evidence.record-failed": "Change evidence could not be recorded; the read loop carries on.",
289
+ "evidence.shell-record-failed": "A shell observation could not be recorded.",
290
+ "evidence.turn-record-failed": "Turn change evidence could not be recorded.",
291
+ "server.listening": "The HTTP server is listening.",
292
+ "state.composer-reset": "A saved composer state was malformed and was reset.",
293
+ "state.discarded": "Saved bridge state could not be used and was discarded.",
294
+ "state.persist-failed": "Saving bridge state failed; a later write retries.",
295
+ "state.session-config-reset": "A saved session configuration was malformed and was reset."
296
+ }
297
+ },
298
+ "bridge.claude": {
299
+ description: "The Claude bridge: its routes, sessions, parked interactions and the Agent SDK turn loop.",
300
+ events: {
301
+ "commands.read-failed": "The command catalogue read failed; the cached answer stands.",
302
+ "context-usage.read-failed": "The detailed context usage read failed; the route falls back.",
303
+ "dispatch.rollback-failed": "Rolling back a prompt dispatch claim failed.",
304
+ "event-subscriber.failed": "An event subscriber threw; other subscribers still ran.",
305
+ "http.request-failed": "An HTTP route threw; it answered 500.",
306
+ "mcp.config-ignored": "An MCP server configuration of an unsupported shape was ignored.",
307
+ "mcp.read-failed": "Listing MCP servers failed; the route answered 500.",
308
+ "models.fetch-failed": "Reading the supported models failed; the fallback catalogue is served.",
309
+ "models.requested": "The model catalogue route was called.",
310
+ "models.responded": "The model catalogue route answered.",
311
+ "parent.gone": "The backend that launched this bridge has gone; shutting down.",
312
+ "plan-approval.responding": "Answering a parked plan approval.",
313
+ "plan-approval.response-failed": "The plan approval route failed.",
314
+ "plan-approval.response-received": "The route received a plan approval answer.",
315
+ "plan-approval.result": "A parked plan approval was answered.",
316
+ "plan-approval.wait-failed": "A parked plan approval ended without an answer: cancelled, timed out or closed.",
317
+ "plan-exit.failure-overridden": "ExitPlanMode failed after the user approved; treated as success with a continuation re-prompt.",
318
+ "plan-mode.record-failed": "Plan mode from a status frame could not be recorded.",
319
+ "plan.reprompt-approved-failed": "Re-prompting after an approved plan failed.",
320
+ "plan.reprompt-feedback-failed": "Re-prompting with plan rejection feedback failed.",
321
+ "plugin.path-missing": "A configured plugin was skipped because its path does not exist.",
322
+ "plugin.unsafe-path": "An installed plugin was skipped because its install path is unsafe.",
323
+ "plugins.read-failed": "Listing plugins failed; the route answered 500.",
324
+ "prompt.accepted": "The route accepted a prompt and answered 202.",
325
+ "prompt.failed": "A prompt turn failed; the session reports the error.",
326
+ "prompt.processing-failed": "A prompt accepted by the route failed while processing.",
327
+ "prompt.received": "A prompt reached the bridge; only its length is logged.",
328
+ "prompt.send-failed": "A prompt request failed; the route answered with an error.",
329
+ "query.close-failed": "Stopping the Claude query failed while closing a tab; the close stays pending.",
330
+ "query.failed": "A Claude query ended with an error result.",
331
+ "question.answer-failed": "The answer-question route failed.",
332
+ "question.answering": "Answering a parked question.",
333
+ "question.answers-prepared": "The route prepared a question answer for the session.",
334
+ "question.answers-received": "A parked question received its answers.",
335
+ "question.stale": "An answer arrived for a question no longer pending; the route answered stale.",
336
+ "question.wait-failed": "A parked question ended without an answer: cancelled, timed out or closed.",
337
+ "runtime.ended-under-resumed-turn": "The Claude runtime ended while a resumed root turn was still open.",
338
+ "server.listening": "The HTTP server is listening.",
339
+ "server.starting": "The HTTP server is about to bind.",
340
+ "session.compact-failed": "A requested compaction failed.",
341
+ "session.create-failed": "Creating a session failed; the route answered with an error.",
342
+ "session.created": "A session was created or recovered.",
343
+ "session.delete-failed": "Deleting a session failed.",
344
+ "session.fork-failed": "Forking a session failed.",
345
+ "session.rename-failed": "Renaming a session failed.",
346
+ "session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
347
+ "session.rewind-failed": "Rewinding session files failed.",
348
+ "session.task-state-hydrate-failed": "Hydrating session task state failed; the route answered with an error.",
349
+ "sessions.reconcile-failed": "Reconciling persisted sessions failed; the sessions already known are listed.",
350
+ "sse.aborted": "The client closed an event stream.",
351
+ "sse.cleanup": "An event stream connection was released.",
352
+ "sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
353
+ "sse.handshake-failed": "An event stream failed during its handshake; the client reconnects.",
354
+ "sse.keepalive-failed": "An event stream keepalive failed, usually a client that has gone; the connection closes.",
355
+ "sse.opened": "An event stream connection opened.",
356
+ "sse.subscribe-requested": "A client asked to subscribe to the event stream.",
357
+ "sse.write-failed": "Writing to an event stream failed; the connection closes and the client reconnects.",
358
+ "task.candidate-bound-reached": "An unresolved Bash call was not tracked as a background task: the candidate bound is full.",
359
+ "task.details-persist-failed": "Shell task details could not be saved; the task carries on.",
360
+ "task.settling-bound-reached": "A settling task was not tracked: the settling bound is full.",
361
+ "task.stop-failed": "Stopping a background task failed on a control channel that had closed.",
362
+ "task.stop-route-failed": "The stop-task route failed.",
363
+ "transcript.background-hydrate-failed": "Hydrating a transcript in the background failed; the next read retries.",
364
+ "transcript.hydrate-failed": "Hydrating a transcript before a prompt failed; the prompt runs and a later read retries."
365
+ }
366
+ },
367
+ "bridge.codex": {
368
+ description: "The Codex bridge: its routes, sessions and the app-server child it supervises.",
369
+ events: {
370
+ "account.connector-recovery-failed": "Recovering account connectors failed; the account answer stands.",
371
+ "account.login-reload-failed": "Reloading the stored account login failed.",
372
+ "account.sign-in-check-failed": "An account sign-in check failed; admission is left unchanged.",
373
+ "account.usage-read-failed": "Reading account usage failed; the route answers 503.",
374
+ "app-server.drain-expired": "The drain deadline expired, so app-server restarted with turns still in flight.",
375
+ "app-server.exited": "app-server exited unexpectedly; the code and signal say how.",
376
+ "app-server.invariant-violation": "app-server asked for something its configuration forbids.",
377
+ "app-server.protocol-violation": "app-server wrote a line that is not valid protocol; it was ignored.",
378
+ "app-server.recording": "Notification recording is on; recordings hold content.",
379
+ "app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
380
+ "app-server.stderr": "Metadata of an app-server stderr line, never its content.",
381
+ "app-server.stderr-suppressed": "app-server stderr lines beyond the budget were counted, not described.",
382
+ "approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
383
+ "approval.present-failed": "Presenting an approval threw; it is auto-declined.",
384
+ "approval.resolved-callback-failed": "An approval resolved callback threw.",
385
+ "command-changes.record-failed": "Recording line changes for a command failed; the turn carries on.",
386
+ "dispatch.reconcile-failed": "A dispatch could not be reconciled against its thread; it stays recovering.",
387
+ "dispatch.restore-failed": "A journaled dispatch could not be restored after a restart; recovery retries.",
388
+ "engine.listener-failed": "An engine event listener threw; the others still ran.",
389
+ "engine.ready": "The app-server engine started.",
390
+ "engine.start-failed": "The app-server engine failed to start; reported through health.",
391
+ "engine.stop-failed": "Stopping the Codex engine failed during shutdown; the bridge exits anyway.",
392
+ "generation.recovery-failed": "Recovering sessions after an app-server generation change failed.",
393
+ "http.request-failed": "An HTTP route threw; it answered 500.",
394
+ "idle-sweep.failed": "An idle sweep failed; the next one retries.",
395
+ "interaction.present-failed": "Presenting an interaction threw; it is cancelled.",
396
+ "interaction.resolved-callback-failed": "An interaction resolved callback threw.",
397
+ "journal.persist-failed": "Saving the dispatch journal failed.",
398
+ "message.publish-failed": "Publishing a message update failed.",
399
+ "models.cache-persist-failed": "Saving the model cache failed.",
400
+ "models.debug-read-failed": "`codex debug models` failed; another source is used.",
401
+ "models.list-failed": "model/list failed; the cached models are served.",
402
+ "models.refresh-failed": "A background model refresh failed; the cache stands.",
403
+ "notification.enqueue-failed": "Queueing a notification threw.",
404
+ "ordered-events.flush-failed": "Flushing before ordered-event reconciliation failed.",
405
+ "ordered-events.publish-failed": "Publishing an ordered event failed; clients are told to rehydrate.",
406
+ "ordered-events.reconcile-failed": "Reconciling ordered events failed.",
407
+ "parent.gone": "The backend that launched this bridge has gone; stopping turns and shutting down.",
408
+ "queue.task-failed": "A task on a per-thread queue failed.",
409
+ "raw-log.write-failed": "Appending to the raw Codex log failed.",
410
+ "recorder.notice": "The notification recorder needs attention: it is on, or was asked for without its confirmation.",
411
+ "recorder.threw": "The notification recorder threw.",
412
+ "recorder.write-failed": "Writing a notification recording failed; its lines were dropped.",
413
+ "registry.persist-failed": "Saving the session registry failed; a later write retries.",
414
+ "rollout.hydrate-failed": "A rollout could not be read to hydrate a thread.",
415
+ "runtime-env.refresh-failed": "Refreshing the runtime environment failed; the last values stay.",
416
+ "runtime-env.refreshed": "Runtime environment variables changed; names only, never values.",
417
+ "server-request.answer-failed": "Answering a server request failed.",
418
+ "server-request.flush-timeout": "An answer to a server request did not flush in time.",
419
+ "server-request.handoff-failed": "Handing a server request to the router threw.",
420
+ "session.config-apply-failed": "Applying session configuration failed; the route answers unavailable.",
421
+ "sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
422
+ "sse.keepalive-failed": "An event stream keepalive failed.",
423
+ "sse.observer-failed": "An event stream observer failed; it reconnects.",
424
+ "sse.payload-serialize-failed": "An event payload could not be serialized; a placeholder was sent.",
425
+ "sse.payload-snapshot-failed": "An event payload could not be snapshotted; a placeholder was sent.",
426
+ "sse.subscriber-failed": "An event stream subscriber failed; it reconnects and replays.",
427
+ "subagent.activity-load-failed": "Sub-agent activity could not be loaded; the transcript renders without it.",
428
+ "thread.archive-failed": "Archiving or unarchiving a thread failed.",
429
+ "thread.fork-failed": "thread/fork failed; the route answers 503.",
430
+ "thread.fork-hydrate-failed": "A forked thread could not be hydrated and was closed.",
431
+ "thread.reattach-failed": "A thread could not be re-attached.",
432
+ "thread.rename-failed": "thread/name/set failed; the bridge title index stays authoritative.",
433
+ "thread.turns-read-after-revert-failed": "A thread's turns could not be read after a revert.",
434
+ "thread.turns-read-failed": "A thread's turns could not be read.",
435
+ "thread.unsubscribe-failed": "thread/unsubscribe failed; the binding is kept so a retry can unsubscribe.",
436
+ "threads.list-failed": "thread/list failed; sessions come from the rollout parser.",
437
+ "transcript.serving-last-known": "A thread read failed, so the last known transcript is served.",
438
+ "turn.capacity-retry-failed": "Retrying a turn after a capacity failure failed.",
439
+ "turn.capacity-retry-journal-failed": "A capacity retry could not be journaled.",
440
+ "turn.finalize-failed": "Finalizing a turn failed.",
441
+ "turns.stopped": "Running turns were stopped because the backend went away."
406
442
  }
407
- }
408
- });
409
-
410
- // ../protocol/src/log-vocabulary/backend.ts
411
- var BACKEND_LOG_AREAS = defineLogAreas({
412
- "build.pipeline": {
413
- description: "Build delivery, ticket reconciliation and persisted pipeline recovery.",
443
+ },
444
+ "bridge.cursor": {
445
+ description: "The Cursor bridge: its routes, sessions and saved state.",
414
446
  events: {
415
- "delivery-policy.failed": "A ticket delivery edit could not be reconciled with the running build.",
416
- "criteria.failed": "Verify could not record criterion results on the ticket.",
417
- "transcript-maintenance.failed": "Pipeline transcript maintenance failed.",
418
- "hydrate.failed": "The renderer could not load the authoritative pipeline snapshot."
447
+ "agent.archive-failed": "Archiving or unarchiving an agent failed.",
448
+ "http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
449
+ "startup.closes-failed": "Finishing closes a previous process left behind failed at startup.",
450
+ "startup.closes-incomplete": "Some closes a previous process left behind did not finish at startup; a retried close finishes them.",
451
+ "state.publication-failing": "Saving bridge state is failing; new prompts and steers are refused until it recovers.",
452
+ "state.publication-recovered": "Saving bridge state recovered.",
453
+ "state.transcripts-shortened": "The state file reached its limit, so some sessions were saved with a shortened transcript copy."
419
454
  }
420
455
  },
421
- "backend.activity": {
422
- description: "The backend's recurring activity and maintenance jobs.",
456
+ "bridge.pi": {
457
+ description: "The Pi bridge: its routes, sessions and saved state.",
423
458
  events: {
424
- "job.failed": "One pass of the job named in `scope` failed; its next pass retries.",
425
- ...THROTTLE_LOG_EVENTS
459
+ "http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
460
+ "state.over-budget": "The state file stayed over budget after shedding transcripts, so the write was skipped.",
461
+ "state.transcripts-shed": "The state file was over budget, so some sessions were saved without their transcript."
426
462
  }
427
463
  }
428
464
  });
@@ -524,7 +560,7 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
524
560
  // ../protocol/src/log-vocabulary/environment.ts
525
561
  var ENVIRONMENT_LOG_AREAS = defineLogAreas({
526
562
  environment: {
527
- description: "Environment naming, held setup and cleanup after deletion.",
563
+ description: "Environment naming, setup, status, moves, deletion and cleanup afterwards.",
528
564
  events: {
529
565
  "cleanup.branch-kept": "A deleted environment's local branch was kept, as it may hold unmerged work.",
530
566
  "rename.failed": "Naming an environment from its pending prompt failed for the first time.",
@@ -533,6 +569,40 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
533
569
  "setup.attention-not-recorded": "Held setup could not be recorded as needing the user's attention.",
534
570
  "setup.coordinator-not-notified": "The worker's coordinator could not be told that its setup is held for approval.",
535
571
  "setup.unknown-environment": "The renderer was asked to act on the setup of an environment it does not hold.",
572
+ "cleanup.rearmed": "A deleted environment's stopped cleanup is retried once under a new backend version.",
573
+ "cleanup.exhausted": "A deleted environment's cleanup keeps failing after its attempts; written once per environment.",
574
+ "cleanup.retry-not-admitted": "A cleanup retry was not admitted; the entry stays for the next start.",
575
+ "cleanup.step-failed": "One step of a deleted environment's cleanup failed; a later reconcile retries it.",
576
+ "cleanup.record-failed": "A finished cleanup step could not be recorded, so it may run again.",
577
+ "cleanup.sweep-failed": "A cleanup sweep failed; written once per sweep.",
578
+ "cleanup.reconcile-failed": "A cleanup reconcile pass failed; the next one retries.",
579
+ "orphan-state.remove-failed": "An orphaned environment state directory could not be removed.",
580
+ "orphan-state.removed": "Orphaned environment state directories were removed.",
581
+ "orphan-state.sweep-failed": "Sweeping orphaned environment state failed.",
582
+ "orphan-canvas.removed": "Orphaned design canvases were removed.",
583
+ "orphan-canvas.sweep-failed": "Sweeping orphaned design canvases failed.",
584
+ "orphan-branches.swept": "Orphaned environment branches were deleted, or kept as they may hold unmerged work.",
585
+ "stray-workspace.remove-failed": "A stray workspace directory could not be removed.",
586
+ "stray-workspace.removed": "Stray workspace directories were removed.",
587
+ "stray-workspace.kept": "Unowned workspace directories that hold files were kept; remove them by hand if unneeded.",
588
+ "temp-files.removed": "Abandoned temp files were removed.",
589
+ "status.ownership-probe-failed": "A strict container ownership probe failed, so the stored status is kept.",
590
+ "status.docker-error": "A transient Docker error stopped a status read, so the stored status is kept.",
591
+ "setup.clear-launch-failed": "A pending agent launch could not be cleared after setup failed.",
592
+ "setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
593
+ "lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
594
+ "tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
595
+ "tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
596
+ "orphan-session.reaped": "A native session no tab references was torn down.",
597
+ "handoff-sweep.failed": "Sweeping transferred transcripts no tab references failed.",
598
+ "delete.terminals-survived": "Terminal process trees outlived termination, so the deletion stops.",
599
+ "delete.artifacts-left": "Graph run artifact directories were not removed.",
600
+ "delete.worktrees-kept": "Graph runs kept branch worktrees.",
601
+ "delete.step-failed": "One best-effort part of deleting an environment failed; `step` says which, and the rest goes on.",
602
+ "merge-cleanup.resume-failed": "A merge cleanup interrupted by a restart could not be resumed.",
603
+ "move.sessions-not-moved": "A provider's sessions could not follow a moved environment.",
604
+ "move.recovery-failed": "Recovering an interrupted environment move failed.",
605
+ "stop.settle-activity-failed": "Agent activity could not be settled after a runtime stopped.",
536
606
  ...THROTTLE_LOG_EVENTS
537
607
  }
538
608
  }
@@ -541,10 +611,50 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
541
611
  // ../protocol/src/log-vocabulary/gateway.ts
542
612
  var GATEWAY_LOG_AREAS = defineLogAreas({
543
613
  gateway: {
544
- description: "The remote gateway other devices and browsers connect through.",
614
+ description: "The gateway other devices, browsers and the desktop connect through.",
545
615
  events: {
546
616
  "remote.start-failed": "The desktop could not start the remote gateway.",
547
- "remote.stop-failed": "The desktop could not stop the remote gateway cleanly."
617
+ "remote.stop-failed": "The desktop could not stop the remote gateway cleanly.",
618
+ disabled: "The gateway is disabled by its environment variable.",
619
+ "tailscale.no-address": "No Tailscale address was found, so the gateway did not start.",
620
+ "tailscale.no-address-fallback": "No Tailscale address was found, so the gateway binds its fallback address.",
621
+ "control.listening": "The backend control listener is up.",
622
+ "browser.listening": "The browser listener is up.",
623
+ "browser.unavailable": "The browser listener could not start; control remains if started, or loopback is attempted.",
624
+ "browser.unavailable-degraded": "No browser listener was started (`reason=no-tailscale-address`); control remains if started, or loopback is attempted.",
625
+ "loopback.listening": "The loopback client listener is up.",
626
+ "loopback.unavailable": "The loopback client listener could not start.",
627
+ "auth-token.stored": "The gateway token's file was written. The path only, never the token.",
628
+ "auth-token.persist-failed": "The gateway token could not be saved.",
629
+ "port.fallback": "The preferred port was taken, so a nearby one is used.",
630
+ "port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
631
+ "request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
632
+ "websocket.upgrade-failed": "A WebSocket upgrade failed.",
633
+ "events.client-dropped": "An event-stream client buffered too much and was dropped; it reconnects and refetches.",
634
+ "proxy.client-disconnected": "A proxy client went away, so its upstream request was aborted.",
635
+ "throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
636
+ "throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
637
+ "throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
638
+ }
639
+ },
640
+ "gateway.terminal": {
641
+ description: "The gateway's terminal WebSocket.",
642
+ events: {
643
+ "upgrade-rejected": "A terminal WebSocket upgrade was refused.",
644
+ "socket-error": "A terminal WebSocket reported an error.",
645
+ "subscription-failed": "A terminal subscription failed.",
646
+ "operation-failed": "A terminal operation failed. Fixed text: the operation can hold terminal input."
647
+ }
648
+ },
649
+ "gateway.tailscale": {
650
+ description: "Tailscale Serve for desktop web access and a standalone backend.",
651
+ events: {
652
+ "web-access.disable-failed": "Desktop web access could not be turned off.",
653
+ "web-access.enable-failed": "Desktop web access could not be turned on.",
654
+ "web-access.cleanup-failed": "Cleaning up after a failed enable also failed.",
655
+ "web-access.reset-failed": "Desktop web access could not be reset.",
656
+ "startup.init-failed": "Desktop web access could not be initialized at startup.",
657
+ available: "Tailscale Serve is publishing the gateway."
548
658
  }
549
659
  }
550
660
  });
@@ -555,6 +665,18 @@ var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
555
665
  description: "Agent bridge processes the backend runs on the host.",
556
666
  events: {
557
667
  "bridge.not-answering": "A bridge with work in progress fails health checks, so it is not restarted yet.",
668
+ "bridge-runtime.installing": "A bridge runtime is being installed.",
669
+ "bridge-runtime.installed": "A bridge runtime finished installing.",
670
+ "opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
671
+ "server.stopping": "A local server is being stopped, for the fixed `reason` given.",
672
+ "reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
673
+ "reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
674
+ "reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
675
+ "reaper.runtime-root-remove-failed": "A claude-tmux runtime root could not be removed; it stays for a retry.",
676
+ "reaper.server-unidentified": "An orphan candidate could not be identified, so its record is kept.",
677
+ "reaper.server-refused": "An orphan candidate leads no process group, so it was not reaped.",
678
+ "reaper.server-reaping": "An orphaned server is being stopped.",
679
+ "reaper.server-kill-failed": "An orphaned server did not exit.",
558
680
  ...THROTTLE_LOG_EVENTS
559
681
  }
560
682
  }
@@ -596,7 +718,12 @@ var MODEL_LOG_AREAS = defineLogAreas({
596
718
  models: {
597
719
  description: "Agent model catalogues and their persistent caches.",
598
720
  events: {
599
- "cache.write-failed": "A successful catalogue refresh could not update the host cache."
721
+ "cache.write-failed": "A successful catalogue refresh could not update the host cache.",
722
+ "seed.pi-failed": "The host Pi model catalogue could not be seeded; the next launch retries.",
723
+ "bridge.not-ready": "The first-use catalogue bridge did not become ready.",
724
+ "bridge.start-failed": "The first-use catalogue bridge failed to start.",
725
+ "probe.exit-unclean": "A catalogue probe or sign-in server did not exit cleanly.",
726
+ "download.deferred": "A model catalogue could not be downloaded yet."
600
727
  }
601
728
  }
602
729
  });
@@ -607,8 +734,61 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
607
734
  description: "Native agent sessions and what the backend reads from their bridges.",
608
735
  events: {
609
736
  "catalogue.outdated-bridge": "A bridge predates the command catalogue, so its commands stay unavailable.",
737
+ "handoff.summary-read-failed": "Change summaries could not be read for a handoff, so the carrier says they are unmeasured.",
738
+ "handoff.consume-failed": "A delivered handoff could not be marked consumed.",
739
+ "job.pr-refresh-rollback-failed": "Rolling back a pull request refresh for a job failed.",
740
+ "job.resend-queue-failed": "A resend could not be queued for a job.",
741
+ "interaction.requests-dropped": "Interaction requests that could not be mapped were dropped.",
742
+ "interaction.observe-failed": "Observing a session's interactions failed. Error class only.",
743
+ "human-prompt.listener-failed": "A human prompt listener threw; the others still run.",
744
+ "question.attention-record-failed": "Attention for an async question could not be recorded; the transcript stays readable.",
745
+ "activity.reconcile-failed": "Reconciling an environment's activity failed. Error class only.",
746
+ "activity.persist-failed": "An environment's activity could not be saved.",
747
+ "pr-refresh.schedule-failed": "A pull request refresh after completion could not be scheduled.",
748
+ "launch.startup-failed": "A startup launch failed; it retries unless `permanent`.",
749
+ "queue.failing": "A native prompt queue keeps failing. The key and reason only, never the prompt.",
750
+ "provider.retire-failed": "Retiring an obsolete provider failed.",
751
+ "workflow-result.store-unavailable": "The workflow result store is unavailable, so the provider's result is used.",
752
+ "catalogue.refresh-failed": "A provider's command catalogue could not be refreshed.",
753
+ "dispatch.attach-failed": "Attaching an agent before dispatch failed; the prompt request answers authoritatively.",
754
+ "coordinator-context.ack-failed": "Coordinator repository context could not be acknowledged.",
755
+ "naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
756
+ "interrupt.persist-failed": "A turn interrupt could not be saved, so automatic publication stays fenced.",
757
+ "resume.close-replaced-failed": "The session a resume replaced could not be closed.",
758
+ "sign-in.check-failed": "A turn could not be checked for a login refusal.",
759
+ "sign-in.resend-failed": "Sending refused prompts after sign-in failed.",
760
+ "sign-in.prompt-resend-failed": "One refused prompt could not be sent again after sign-in. Error class only.",
761
+ "shutdown.checkpoints-skipped": "Shutdown skipped display-tail checkpoints; provider history stays authoritative. Count only.",
762
+ "turn-recovery.failed": "Recovering an incomplete turn failed.",
763
+ "turn-recovery.exhausted": "A turn failed again after automatic recovery and is left for the user.",
764
+ "turn-recovery.retrying": "An incomplete or provider-failed turn is being retried automatically.",
765
+ "usage-limit.resend-failed": "Resending after a usage limit failed. An unknown send stays in the journal.",
766
+ "title.strategy-failed": "A session title strategy failed, so the next is tried. Content-free: the error can quote the prompt.",
610
767
  ...THROTTLE_LOG_EVENTS
611
768
  }
769
+ },
770
+ "native-agent.goal": {
771
+ description: "The /goal loop: advancing goals and their verifiers.",
772
+ events: {
773
+ "advance.failed": "A goal could not advance; the next sweep retries.",
774
+ "attention.record-failed": "Attention for a goal could not be recorded.",
775
+ "turn-end.settle-failed": "Turn-end work for a goal could not be settled.",
776
+ "verifier.finish-failed": "A verifier failed to finish; the goal stays verifying, so the next sweep runs it again.",
777
+ "verifier.stop-failed": "An earlier verifier could not be stopped.",
778
+ "recover.failed": "Goals could not be recovered at startup."
779
+ }
780
+ },
781
+ "native-agent.opencode": {
782
+ description: "The OpenCode provider: its request monitor, retries and agent tools.",
783
+ events: {
784
+ "retry.abort-failed": "Aborting an automatic retry failed. Error class only.",
785
+ "retry.abort-not-scheduled": "An automatic retry abort could not be scheduled. Error class only.",
786
+ "agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
787
+ "coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
788
+ "monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
789
+ "worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
790
+ "request.failed": "Handling a request event failed, so the stream restarts. Error class only."
791
+ }
612
792
  }
613
793
  });
614
794
 
@@ -631,6 +811,17 @@ var PREVIEW_LOG_AREAS = defineLogAreas({
631
811
  "partitions.retry-forgotten-failed": "Retrying a forgotten preview cleanup failed.",
632
812
  "port-hints.persist-failed": "Preview port hints could not be saved.",
633
813
  "transport.close-failed": "A preview transport could not be closed.",
814
+ "ca-bundle.read-failed": "The upstream CA bundle could not be read.",
815
+ "publication.start-failed": "Private preview publication did not start.",
816
+ "publication.reconfigure-failed": "Preview publication could not be reconfigured.",
817
+ "publication.listening": "Private preview origins are listening.",
818
+ "certificate.reloaded": "The preview certificate was reloaded.",
819
+ "access.revoked-close-failed": "A revoked preview resource could not be closed. Error class only.",
820
+ "registry.invalid-definition": "An invalid stored preview service definition was ignored.",
821
+ "registry.environment-reconcile-failed": "An environment's preview services could not be reconciled.",
822
+ "registry.resolver-failed": "A preview resolver failed. Error class only.",
823
+ "registry.revocation-listener-failed": "A preview revocation listener threw. Error class only.",
824
+ "registry.change-emit-failed": "A preview change event could not be emitted. Error class only.",
634
825
  ...THROTTLE_LOG_EVENTS
635
826
  }
636
827
  }
@@ -649,9 +840,33 @@ var RUNTIME_LOG_AREAS = defineLogAreas({
649
840
  // ../protocol/src/log-vocabulary/terminal.ts
650
841
  var TERMINAL_LOG_AREAS = defineLogAreas({
651
842
  terminal: {
652
- description: "The renderer's terminal. Its lines stay in the browser console, never the saved log.",
843
+ description: "Terminals. The renderer's lines stay in the browser console; the backend's reach the saved log.",
653
844
  events: {
654
845
  "input.undelivered": "A keystroke did not reach a shell: `no-session` or `not-delivered`.",
846
+ "orphan.reaped": "A terminal no tab references was closed.",
847
+ "agent-completion.notify-failed": "A terminal agent's completion could not be reported.",
848
+ "activity.record-failed": "Terminal environment activity could not be recorded.",
849
+ "pty.exit-listener-failed": "A terminal exit listener threw; the others still run.",
850
+ "pty.exit-notify-failed": "Notifying a terminal's exit failed.",
851
+ "pty.late-exit-listener-failed": "A listener added after a terminal exited threw.",
852
+ "setup.pty-reused": "A setup terminal reused its existing PTY.",
853
+ "setup.pty-spawning": "A setup terminal is spawning its PTY. The argument count only, never the arguments.",
854
+ "setup.pty-spawned": "A setup terminal's PTY started.",
855
+ "setup.pty-exited": "A setup terminal's PTY exited.",
856
+ "setup.preparing": "Workspace preparation started in the setup terminal.",
857
+ "setup.session-creating": "A setup session is being created.",
858
+ "setup.intro-emitted": "The setup intro was written to the terminal.",
859
+ "setup.completed": "Setup finished.",
860
+ "setup.failed": "Setup failed.",
861
+ "setup.already-complete": "Setup was requested but had already finished.",
862
+ "setup.renderer-ensured": "The renderer asked for setup to be running.",
863
+ "setup.renderer-requested": "The renderer asked for the setup session.",
864
+ "setup.renderer-requested-none": "The renderer asked for a setup session that does not exist.",
865
+ "setup.no-commands": "An environment has no setup commands to run.",
866
+ "setup.already-running": "Setup was requested while it was already running.",
867
+ "setup.held-for-approval": "Setup is held until its commands are approved.",
868
+ "setup.renderer-checked-session": "The renderer asked whether a setup terminal session exists.",
869
+ "setup.renderer-requested-buffer": "The renderer asked for a setup terminal's output buffer. A size only, never its contents.",
655
870
  "input.resume-failed": "Asking the backend to resume refused terminal input failed.",
656
871
  "input.write-failed": "Writing input to a terminal session threw.",
657
872
  "listener.remove-failed": "Removing a terminal output listener threw.",
@@ -751,13 +966,39 @@ var TERMINAL_LOG_AREAS = defineLogAreas({
751
966
  // ../protocol/src/log-vocabulary/tmux.ts
752
967
  var TMUX_LOG_AREAS = defineLogAreas({
753
968
  tmux: {
754
- description: "The poll loop behind a Claude tmux tab.",
969
+ description: "Claude tmux tabs: launch, the poll loop, cleanup and the tmux prompt queue.",
755
970
  events: {
756
971
  "poll.discovery-failed": "Finding the session's transcript failed; a later tick retries.",
757
972
  "poll.snapshot-failed": "Reading the hook and transcript state failed; the next tick retries.",
758
973
  "poll.drain-pending-failed": "Delivering pending hook events failed; the next tick retries.",
759
974
  "poll.drain-timeouts-failed": "Delivering hook timeouts failed; the next tick retries.",
760
975
  "poll.tail-failed": "Reading new transcript lines failed; the next tick retries.",
976
+ "cleanup.session-stop-failed": "A tmux session could not be stopped while cleaning up an environment.",
977
+ "cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
978
+ "cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
979
+ "cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
980
+ "hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
981
+ "hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
982
+ "naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
983
+ "orphans.skipped": "Orphan reconciliation was skipped because pane layouts are unreadable.",
984
+ "orphan.reaped": "A tmux session no tab references was killed.",
985
+ "orphan.kill-skipped": "An orphan tmux kill was skipped because the tmux server could not be reached.",
986
+ "cli.thinking-display-probe-failed": "Probing the CLI for --thinking-display failed, so it launches without it.",
987
+ "cli.fast-mode-unsupported": "The claude CLI lacks --settings, so it launches without fast mode.",
988
+ "cli.effort-unsupported": "The claude CLI lacks --effort, so it launches without it.",
989
+ "interactive.snapshot-failed": "An interactive snapshot failed; expected while a pane is closing.",
990
+ "signal.arm-failed": "The Claude state signal could not be armed.",
991
+ "signal.degraded": "The Claude state signal missed a change or rang too often, so polling stays at one second until it is re-armed.",
992
+ "pr-refresh.schedule-failed": "A pull request refresh after a turn could not be scheduled.",
993
+ "pr-probe.failed": "Probing for a pull request an agent created failed.",
994
+ "activity.persist-failed": "Tmux tab activity could not be saved.",
995
+ "fast-mode.persist-failed": "The launch fast mode could not be saved.",
996
+ "fast-mode.repair-failed": "Fast mode metadata could not be repaired on a reattached session.",
997
+ "pane.observe-failed": "A pane observation failed. Error class only: pane contents are sensitive.",
998
+ "turn.failure-record-failed": "A failed turn could not be recorded.",
999
+ "slash-command.settle-timeout": "Timed out waiting for a Claude slash command to settle.",
1000
+ "queue.failing": "A tmux prompt queue keeps failing to dispatch.",
1001
+ "queue.rename-failed": "An environment could not be named from its first prompt; the prompt still goes ahead.",
761
1002
  ...THROTTLE_LOG_EVENTS
762
1003
  }
763
1004
  }
@@ -784,7 +1025,8 @@ var UPDATER_LOG_AREAS = defineLogAreas({
784
1025
  "remote.unavailable": "Updates requested by remote clients are unavailable in this session.",
785
1026
  "restart-prompt.failed": "The restart prompt for a downloaded update failed.",
786
1027
  unavailable: "Auto-update could not be set up in this session.",
787
- "update.failed": "electron-updater reported an update error."
1028
+ "update.failed": "electron-updater reported an update error.",
1029
+ "standalone.restarting": "A standalone backend is restarting into a new version."
788
1030
  }
789
1031
  }
790
1032
  });
@@ -795,11 +1037,460 @@ var WEB_ANNOTATIONS_LOG_AREAS = defineLogAreas({
795
1037
  description: "Web annotation requests and their background reconciler.",
796
1038
  events: {
797
1039
  "reconcile.failed": "A background reconcile pass failed; the next one retries.",
1040
+ "legacy.degraded": "Legacy annotation storage is damaged, so the previous committed copy is served read-only.",
1041
+ "legacy.draft-index-problem": "The legacy draft index could not be used; `status` says why.",
1042
+ "legacy.unreadable-records": "The legacy import found unreadable records; they stay unread.",
1043
+ "legacy.unavailable": "Legacy annotation storage could not be read.",
1044
+ "legacy.unreadable": "An environment's legacy annotation storage is unreadable.",
1045
+ "legacy.archive-failed": "Imported legacy annotation files could not be archived.",
1046
+ "legacy.files-archived": "Legacy files beside an imported environment were archived, not imported.",
1047
+ "migration.draft-failed": "Migrating one draft failed.",
1048
+ "draft-reconcile.deferred": "Draft reconciliation was deferred; a later pass retries.",
1049
+ "request.handoff-deferred": "A request's handoff was deferred; a later pass retries.",
1050
+ "evidence.materialize-failed": "Materializing a request's evidence failed; it backs off and retries.",
1051
+ "queue.publish-deferred": "Publishing a request to the queue was deferred; it retries under the same id.",
1052
+ "request.reconcile-failed": "Reconciling a request failed; the next pass retries.",
1053
+ "turn-end.reconcile-failed": "Reconciling a request at the end of a turn failed; the next pass retries.",
1054
+ "gc.failed": "Annotation garbage collection failed; the next pass retries.",
1055
+ "record.unavailable": "An annotation record is unavailable; written once per record.",
1056
+ "storage.unavailable": "An environment's annotation store is unreadable.",
1057
+ "change-hint.listener-failed": "A change hint listener threw.",
1058
+ "orphan.remove-failed": "An orphaned environment's annotation storage could not be removed.",
1059
+ "storage.load-failed": "An environment's annotation storage could not be loaded.",
798
1060
  ...THROTTLE_LOG_EVENTS
799
1061
  }
800
1062
  }
801
1063
  });
802
1064
 
1065
+ // ../protocol/src/log-vocabulary/storage.ts
1066
+ var STORAGE_LOG_AREAS = defineLogAreas({
1067
+ storage: {
1068
+ description: "The SQLite-backed stores, their snapshots and imports from older formats.",
1069
+ events: {
1070
+ "usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
1071
+ "snapshot.integrity-failed": "An hourly database snapshot failed its integrity check and was discarded.",
1072
+ "snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
1073
+ "snapshot.failed": "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
1074
+ "listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
1075
+ "listener.change-failed": "A resource change listener threw; the committed mutation stands.",
1076
+ "kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
1077
+ "nodes.entries-dropped": "Unreadable node registry entries were ignored.",
1078
+ "preview-identity.reminted": "The data directory moved or was copied, so previews get a new backend identity.",
1079
+ "machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
1080
+ "permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
1081
+ "retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
1082
+ "handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
1083
+ "desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
1084
+ "legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
1085
+ "legacy-json.archive-failed": "Imported JSON store files could not be archived."
1086
+ }
1087
+ }
1088
+ });
1089
+
1090
+ // ../protocol/src/log-vocabulary/build-pipeline.ts
1091
+ var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
1092
+ "build-pipeline": {
1093
+ description: "Build pipelines: their supervision, stages, transcripts and sidebar state.",
1094
+ events: {
1095
+ "sidebar.reconcile-failed": "Sidebar activity for pipelines could not be reconciled.",
1096
+ "sidebar.update-failed": "The sidebar could not be updated for one pipeline.",
1097
+ "result.consume-deferred": "Consuming a stage's workflow result failed; it stays staged and is retried.",
1098
+ "consolidation.consume-deferred": "Consuming a review consolidation result failed; it stays pending and is retried.",
1099
+ "dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request does the same work and answers authoritatively.",
1100
+ "interaction.resolved": "A human interaction on a pipeline stage resolved. Metadata only.",
1101
+ "transcripts.migrated": "A transcript migration pass moved stage transcripts; counts only.",
1102
+ "transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
1103
+ "restore.skipped": "A pipeline could not be restored at startup and was skipped.",
1104
+ "criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
1105
+ "workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
1106
+ "rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
1107
+ "kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
1108
+ "usage.read-failed": "Reading a stage session's token usage failed.",
1109
+ "checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
1110
+ "checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
1111
+ "legacy-transcript.deferred": "Moving a legacy inline transcript failed; the inline body stays readable."
1112
+ }
1113
+ }
1114
+ });
1115
+
1116
+ // ../protocol/src/log-vocabulary/agent-branch.ts
1117
+ var AGENT_BRANCH_LOG_AREAS = defineLogAreas({
1118
+ "agent-branch": {
1119
+ description: "Agent branches shared by review fan-outs, graph agents and goal verifiers; `owner` names which.",
1120
+ events: {
1121
+ "observation.checkpoint-failed": "Checkpointing reviewer observations failed; the next pass retries.",
1122
+ "transcript.mirror-failed": "Mirroring a reviewer transcript failed.",
1123
+ "usage.read-failed": "Reading a reviewer's token usage failed.",
1124
+ "result.nudge-failed": "An agent with an uncommitted result could not be nudged.",
1125
+ "dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request answers authoritatively.",
1126
+ "result.consume-deferred": "Consuming a branch's workflow result failed; it stays staged and is retried."
1127
+ }
1128
+ }
1129
+ });
1130
+
1131
+ // ../protocol/src/log-vocabulary/change-tracking.ts
1132
+ var CHANGE_TRACKING_LOG_AREAS = defineLogAreas({
1133
+ "change-tracking": {
1134
+ description: "Change tracking: turn capture, evidence pulls and measurements.",
1135
+ events: {
1136
+ "journal-import.failed": "Importing surviving OpenCode command journals as legacy summaries failed.",
1137
+ "projection.failed": "Projecting a change event onto its environment failed.",
1138
+ "startup.reconcile-failed": "Reconciling change tracking at startup failed.",
1139
+ "turn-start.capture-failed": "Capturing a turn's start failed, so the turn is untracked.",
1140
+ "dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
1141
+ "turn.finalize-failed": "Finalizing a turn failed.",
1142
+ "turn.settle-failed": "Settling a late interrupted turn failed.",
1143
+ "evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
1144
+ "measurement.failed": "Recomputing a tool's measurement failed."
1145
+ }
1146
+ },
1147
+ "diff-stats": {
1148
+ description: "Environment diff stats and the worktree signals that drive them.",
1149
+ events: {
1150
+ "baseline.update-failed": "An environment's diff baseline could not be updated.",
1151
+ "scan.watcher-failed": "An environment's diff watcher failed; its scans fall back to polling.",
1152
+ "scan.failed": "A diff scan failed; the last results stay, marked stale, and the scan is retried.",
1153
+ "scan.freshness-read-failed": "Reading whether an environment's remote is fresh failed.",
1154
+ "scan.listener-failed": "A change-tracking scan listener threw; the scan itself stands.",
1155
+ "emit.diff-stats-failed": "A diff stats change could not be emitted to its sink.",
1156
+ "emit.worktree-snapshot-failed": "A worktree snapshot could not be emitted to its sink.",
1157
+ "signal.demoted": "A worktree signal stopped being trusted, so scans fall back to timers until it is re-armed."
1158
+ }
1159
+ }
1160
+ });
1161
+
1162
+ // ../protocol/src/log-vocabulary/coordinator.ts
1163
+ var COORDINATOR_LOG_AREAS = defineLogAreas({
1164
+ coordinator: {
1165
+ description: "Coordinators: delegations, status wakes and their store.",
1166
+ events: {
1167
+ "delegation.open-failed": "A delegation could not be opened; `source` says for what.",
1168
+ "deliver-now.drain-failed": "The mail delivery pass after deliverNow failed; the next sweep delivers.",
1169
+ "mail.move-failed": "Mail could not move to the new main coordinator.",
1170
+ "work.move-failed": "Work could not move to the main coordinator.",
1171
+ "wake.observe-remote-workflow-failed": "A remote workflow could not be observed for status wakes.",
1172
+ "wake.observe-pull-request-failed": "A pull request could not be observed for status wakes.",
1173
+ "wake.observe-workflow-failed": "A workflow could not be observed for status wakes.",
1174
+ "wake.deliver-failed": "A workflow status wake could not be delivered; the next pass retries.",
1175
+ "wake.waiting-check-failed": "A waiting worker could not be checked; the next pass retries.",
1176
+ "wake.resolve-report-failed": "A finished Resolve tab could not be reported.",
1177
+ "wake.waiting-report-failed": "A waiting worker could not be reported.",
1178
+ "wake.worker-outcomes-failed": "Coordinator-owned workers' merges and deletions could not be checked; the next sweep retries.",
1179
+ "store.malformed": "The coordinator store was malformed and is treated as empty.",
1180
+ "store.unsupported-version": "The coordinator store has an unsupported version and is treated as empty.",
1181
+ "store.invalid-workspace": "An invalid coordinator workspace record was ignored.",
1182
+ "store.workflows-cleared": "The workflow store was full, so a batch of its oldest finished records was removed.",
1183
+ "store.workflows-in-use": "The workflow store was full and every record was still in use, so new work was refused.",
1184
+ "remote-worker.settle-failed": "A remote worker could not be settled."
1185
+ }
1186
+ }
1187
+ });
1188
+
1189
+ // ../protocol/src/log-vocabulary/review.ts
1190
+ var REVIEW_LOG_AREAS = defineLogAreas({
1191
+ review: {
1192
+ description: "Multi Review workflows: scheduling, graph runs and interactive fix sessions.",
1193
+ events: {
1194
+ "fix-tab.publish-failed": "A fix request was delivered but its tab could not be opened; the user is told.",
1195
+ "graph-run.not-started": "A workflow's graph run did not start.",
1196
+ "reconcile.scan-failed": "A reconciliation scan failed; the next scan retries.",
1197
+ "graph-engine.unavailable": "The graph engine is selected but unavailable, so the bespoke engine runs.",
1198
+ "graph-run.cancel-failed": "Cancelling a graph run failed; the next pass projects how it ended.",
1199
+ "delete.cleanup-failed": "A cleanup step after deleting a workflow failed; stale tabs reconcile away on hydration.",
1200
+ "fix-session.read-failed": "Reading an interactive fix session's state failed.",
1201
+ "fix-outcome.read-failed": "Reading an interactive fix's outcome failed; it stays pending.",
1202
+ "fix-usage.read-failed": "Reading a fix session's token usage failed.",
1203
+ "result.consume-deferred": "Consuming a workflow result failed; it stays staged and is retried.",
1204
+ "failure-triage.failed": "Classifying a review package's failing tests failed; the package is sealed without the triage and says so."
1205
+ }
1206
+ },
1207
+ "pull-request": {
1208
+ description: "Pull request monitoring, auto-merge and the `gh` reads behind them.",
1209
+ events: {
1210
+ "merged-state.persist-failed": "A merged pull request's state could not be saved; GitHub stays authoritative and cleanup goes on.",
1211
+ "refresh.failed": "A pull request could not be refreshed; the armed flag stands.",
1212
+ "arm.track-failed": "An armed environment could not be tracked; the monitor's next sync retries.",
1213
+ "gh.pr-list-unparseable": "`gh pr list` returned nothing that parses. Sizes only, never the output.",
1214
+ "monitor.start-failed": "Monitoring could not start for a newly opened pull request.",
1215
+ "cleanup-scheduler.missing": "A merged pull request was seen, but this runtime has no merge cleanup scheduler.",
1216
+ "auto-merge.evaluation-failed": "Evaluating an environment for auto-merge failed.",
1217
+ "auto-merge.merge-failed": "Auto-merge could not merge a pull request; the attempt is held and retried.",
1218
+ "auto-merge.resolve-failed": "Auto-merge could not launch Resolve for a pull request; the attempt is held and retried.",
1219
+ "monitor.detection-failed": "Checking an environment for its pull request failed.",
1220
+ "monitor.detection-admission-failed": "A pull request check could not be admitted to the work pool.",
1221
+ "monitor.terminal-repair-failed": "Repairing a merged or closed pull request's side effects failed.",
1222
+ "monitor.terminal-resume-failed": "Resuming a merged or closed pull request's side effects failed.",
1223
+ "monitor.stale-reading-ignored": "A non-merged reading (`state`) for a pull request already merged was ignored as stale.",
1224
+ "monitor.state-persist-failed": "A pull request's observed state could not be saved.",
1225
+ "monitor.state-clear-failed": "A pull request's saved state could not be cleared.",
1226
+ "monitor.task-reconcile-failed": "Updating the Kanban task of a merged or closed (`state`) pull request failed.",
1227
+ "monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
1228
+ "monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
1229
+ }
1230
+ }
1231
+ });
1232
+
1233
+ // ../protocol/src/log-vocabulary/public-api.ts
1234
+ var PUBLIC_API_LOG_AREAS = defineLogAreas({
1235
+ "public-api": {
1236
+ description: "The public CLI's operations: their outcomes, reconciliation and exec workers.",
1237
+ events: {
1238
+ "outcome.record-failed": "A background operation's outcome could not be recorded; reconciliation settles it.",
1239
+ "goal-checks.stop-failed": "Goal checks could not be stopped.",
1240
+ "exec.list-failed": "Exec workers could not be listed.",
1241
+ "exec.cancel-failed": "An exec could not be cancelled.",
1242
+ "goal-workers.list-failed": "Goal check workers could not be listed.",
1243
+ "operation.reconcile-failed": "Reconciling one operation failed; the next pass retries.",
1244
+ "reconcile.pass-failed": "A reconciliation pass failed; the next one retries."
1245
+ }
1246
+ }
1247
+ });
1248
+
1249
+ // ../protocol/src/log-vocabulary/agent-accounts.ts
1250
+ var AGENT_ACCOUNTS_LOG_AREAS = defineLogAreas({
1251
+ "agent-accounts": {
1252
+ description: "Agent accounts: automatic switching, staged logins and plan usage.",
1253
+ events: {
1254
+ "switch-notice.failed": "A notice about an automatic account switch failed; the switch stands. `audience` says whose.",
1255
+ "auto-switch.check-failed": "An automatic account check failed; the next nudge retries.",
1256
+ "container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
1257
+ "last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
1258
+ "login-cleanup.failed": "A temporary login could not be cleaned up.",
1259
+ "login-refresh.deferred": "Containers were not told to refresh their login now; they reconcile from its durable generation."
1260
+ }
1261
+ }
1262
+ });
1263
+
1264
+ // ../protocol/src/log-vocabulary/docker.ts
1265
+ var DOCKER_LOG_AREAS = defineLogAreas({
1266
+ docker: {
1267
+ description: "Docker containers: lifecycle, starts, staged inputs and the login files they hold.",
1268
+ events: {
1269
+ "portable-inputs.relay-missing": "Docker is rootless and the image predates the staged-input relay, so the container cannot read them until rebuilt.",
1270
+ "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.",
1271
+ "opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
1272
+ "login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
1273
+ "login-keeper.refresh-failed": "Refreshing the host Claude login failed. Fixed text: CLI output can hold credentials.",
1274
+ "login-keeper.refresh-not-extended": "Refreshing the host Claude login did not extend its expiry.",
1275
+ "login-keeper.refresh-check-failed": "Checking the host Claude login after a refresh failed.",
1276
+ "login-watcher.pass-failed": "A container login file watcher pass failed; the next one retries.",
1277
+ "lifecycle.record-failure-failed": "A failed container operation could not be recorded.",
1278
+ "lifecycle.reconcile-failed": "Reconciling one environment's container operation failed; the next pass retries.",
1279
+ "replacement.clear-terminals-failed": "Terminal sessions could not be cleared after a container replacement.",
1280
+ "recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
1281
+ "github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
1282
+ "availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
1283
+ "start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports."
1284
+ }
1285
+ },
1286
+ "docker.reachability": {
1287
+ description: "Whether agents in containers can reach the backend's agent tools server.",
1288
+ events: {
1289
+ "check.crashed": "A reachability check crashed.",
1290
+ "check.started": "A reachability check started.",
1291
+ "check.finished": "A reachability check finished.",
1292
+ "check.probe": "One probe of a finished check.",
1293
+ "check.summary": "Content-free status and reason for a check that did not find the host reachable.",
1294
+ "check.remediation": "One command the user can run to unblock containers.",
1295
+ "shutdown.awaiting-network": "Shutdown is waiting for probe network preparation.",
1296
+ "shutdown.cleanup-deferred": "Probe network cleanup waits until its preparation settles.",
1297
+ "shutdown.removing-resources": "Shutdown is removing probe resources.",
1298
+ "shutdown.container-remove-failed": "A probe container could not be removed at shutdown.",
1299
+ "shutdown.network-remove-failed": "The probe network could not be removed at shutdown.",
1300
+ "probe.skipped": "A container probe was skipped because the agent tools server is not listening.",
1301
+ "preflight.refused": "A stage was refused because its container cannot reach the host.",
1302
+ "probe.prepare-failed": "A container could not be prepared for a probe.",
1303
+ "probe.result": "The outcome of probing one container.",
1304
+ "probe.contradicts-host": "A container probe disagrees with the host status, so the host is rechecked.",
1305
+ "topology.detected": "The Docker topology was read.",
1306
+ "firewall.detected": "The host firewall was read.",
1307
+ "probe-network.remove-failed": "The probe network could not be removed.",
1308
+ "probe-network.create-failed": "The probe network could not be created, so only the default bridge is checked.",
1309
+ "event.emit-failed": "A reachability event could not be emitted.",
1310
+ "host-addresses.list-failed": "Host addresses could not be listed.",
1311
+ "probe-image.present": "The probe image is already present.",
1312
+ "probe-image.pulling": "The probe image is being pulled.",
1313
+ "probe-image.pulled": "The probe image was pulled.",
1314
+ "probe-image.pull-failed": "The probe image could not be pulled.",
1315
+ "probe-image.fallback": "The environment image is used as the probe image.",
1316
+ "probe-image.missing": "No probe image is available.",
1317
+ "network.list-failed": "Docker networks could not be listed.",
1318
+ "network.inspect-failed": "A Docker network could not be inspected.",
1319
+ "stale-containers.removing": "Stale probe containers are being removed.",
1320
+ "stale-networks.removing": "Stale probe networks are being removed."
1321
+ }
1322
+ }
1323
+ });
1324
+
1325
+ // ../protocol/src/log-vocabulary/mcp.ts
1326
+ var MCP_LOG_AREAS = defineLogAreas({
1327
+ "control-mcp": {
1328
+ description: "The Control MCP server other agents and devices reach Orkestrator through.",
1329
+ events: {
1330
+ "listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
1331
+ "state-listener.failed": "A Control MCP state listener threw; the others still run.",
1332
+ "delegation.remote-open-failed": "A delegation could not be opened on another node.",
1333
+ "delegation.open-failed": "A coordinator delegation could not be opened."
1334
+ }
1335
+ },
1336
+ "mcp-management": {
1337
+ description: "Managed MCP configuration: its commands, overlays and apply loop.",
1338
+ events: {
1339
+ "command.failed": "An MCP management command failed; `ref` is the correlation id shown to the user.",
1340
+ "overlay.materialise-failed": "An MCP overlay could not be written.",
1341
+ "apply.tick-failed": "An MCP apply tick failed; the next one retries."
1342
+ }
1343
+ }
1344
+ });
1345
+
1346
+ // ../protocol/src/log-vocabulary/design.ts
1347
+ var DESIGN_LOG_AREAS = defineLogAreas({
1348
+ design: {
1349
+ description: "The design canvas: its library, renderer and session links.",
1350
+ events: {
1351
+ "change-signal.failed": "A design change signal failed.",
1352
+ "library.index-write-failed": "The design library index could not be written.",
1353
+ "library.refresh-failed": "The design library could not be refreshed.",
1354
+ "renderer.problem": "The renderer hit a limit or lost a browser; `problem` is a fixed name.",
1355
+ "task.failed": "A design background task failed.",
1356
+ "canvas.needs-recovery": "A design canvas is unreadable and marked for recovery.",
1357
+ "startup.step-failed": "One part of design startup failed; `step` says which.",
1358
+ "legacy.retire-failed": "A migrated legacy design could not be retired.",
1359
+ "profiles.swept": "Design startup removed stale browser profiles.",
1360
+ "session-link.record-failed": "A closing conversation could not be recorded on a design link."
1361
+ }
1362
+ }
1363
+ });
1364
+
1365
+ // ../protocol/src/log-vocabulary/graph.ts
1366
+ var GRAPH_LOG_AREAS = defineLogAreas({
1367
+ graph: {
1368
+ description: "Graph runs: launches, passes, rewinds, system actions and templates.",
1369
+ events: {
1370
+ "describe.pass-failed": "A graph describe pass failed. Content-free: never the description or draft.",
1371
+ "system.stop-failed": "A system action's work could not be stopped.",
1372
+ "system.action-failed": "A system action failed; `cause` is its fixed failure cause.",
1373
+ "attention.update-failed": "The sidebar could not be updated for a run.",
1374
+ "launch.ticket-link-failed": "A launched run's ticket could not be linked.",
1375
+ "launch.started": "A graph run was launched.",
1376
+ "launch.swept": "Runs that ended without an environment were removed.",
1377
+ "rewind.pending": "A run's code rewind has not finished.",
1378
+ "rewind.applied": "A run was restarted or rewound.",
1379
+ "rewind.waiting": "A run waits for its code rewind to finish.",
1380
+ "history.pruned": "Finished runs beyond an environment's history were removed.",
1381
+ "history.prune-failed": "Pruning an environment's run history failed.",
1382
+ "worktree.cleanup-failed": "A run's branch worktree cleanup failed.",
1383
+ "run.unreadable": "A run is unreadable, so it is not scheduled.",
1384
+ "run.pass-failed": "A pass over a run failed.",
1385
+ "transcript.capture-failed": "A run's transcript capture failed.",
1386
+ "ticket.link-failed": "A run's ticket could not be linked to its environment.",
1387
+ "template.skipped": "A built-in template was skipped as invalid or a duplicate."
1388
+ }
1389
+ }
1390
+ });
1391
+
1392
+ // ../protocol/src/log-vocabulary/nodes.ts
1393
+ var NODES_LOG_AREAS = defineLogAreas({
1394
+ nodes: {
1395
+ description: "Command nodes: links, handovers, leaf mail and project copies.",
1396
+ events: {
1397
+ "actions.resume-failed": "Approved actions could not be resumed; a later pass retries.",
1398
+ "project-copy.notify-failed": "The coordinator could not be told a project copy finished.",
1399
+ "mail.delivery-deferred": "Leaf mail could not reach a coordinator yet.",
1400
+ "command.post-step-failed": "A step after a routed command failed.",
1401
+ "seed-files.incomplete": "Seed files for a leaf environment were not all copied.",
1402
+ "contact.record-failed": "The latest controller contact could not be recorded.",
1403
+ "settings.send-failed": "Settings could not be sent to a node.",
1404
+ "verification.record-failed": "A node verification could not be recorded.",
1405
+ "profile.record-failed": "A node profile could not be recorded.",
1406
+ "detach.unconfirmed": "A forgotten node has not confirmed the detach yet.",
1407
+ "handover.recovery-pending": "Command handover recovery is still pending."
1408
+ }
1409
+ }
1410
+ });
1411
+
1412
+ // ../protocol/src/log-vocabulary/linear.ts
1413
+ var LINEAR_LOG_AREAS = defineLogAreas({
1414
+ linear: {
1415
+ description: "Linear issues read for build actions.",
1416
+ events: {
1417
+ "comments.load-failed": "An issue's comments could not be loaded; the issue still renders without them."
1418
+ }
1419
+ }
1420
+ });
1421
+
1422
+ // ../protocol/src/log-vocabulary/usage-history.ts
1423
+ var USAGE_HISTORY_LOG_AREAS = defineLogAreas({
1424
+ "usage-history": {
1425
+ description: "Recorded agent token usage.",
1426
+ events: {
1427
+ "record.failed": "Agent usage could not be recorded; a later read counts it.",
1428
+ "prune.failed": "Pruning recorded usage failed; the next prune retries."
1429
+ }
1430
+ }
1431
+ });
1432
+
1433
+ // ../protocol/src/log-vocabulary/feature.ts
1434
+ var FEATURE_LOG_AREAS = defineLogAreas({
1435
+ feature: {
1436
+ description: "Pipeline environments started from a feature, and feature planning.",
1437
+ events: {
1438
+ "naming.fallback": "Automatic naming failed, so a local fallback name is used. Error kind only: the description stays out.",
1439
+ "planning.legacy-adopt-failed": "Legacy planning conversations could not be adopted.",
1440
+ "planning.tick-retrying": "A planning tick failed on a transient error; the next tick retries."
1441
+ }
1442
+ }
1443
+ });
1444
+
1445
+ // ../protocol/src/log-vocabulary/host.ts
1446
+ var HOST_LOG_AREAS = defineLogAreas({
1447
+ host: {
1448
+ description: "The host machine: its executables, load, suspends and maintenance.",
1449
+ events: {
1450
+ "path.discovered": "Executable discovery finished. Counts and booleans only: PATH entries can hold private directory names.",
1451
+ "tool.available": "A host tool's availability was read.",
1452
+ "tool.missing": "A host tool was not found.",
1453
+ "maintenance.listener-failed": "A host maintenance listener threw; the others still run.",
1454
+ "suspend.reconcile-failed": "Reconciling due work after a host suspension failed.",
1455
+ "load.sample-failed": "Sampling machine load failed; the next sample retries."
1456
+ }
1457
+ }
1458
+ });
1459
+
1460
+ // ../protocol/src/log-vocabulary/transcript-artifacts.ts
1461
+ var TRANSCRIPT_ARTIFACTS_LOG_AREAS = defineLogAreas({
1462
+ "transcript-artifacts": {
1463
+ description: "Transcript artifacts: previews, printing, grants and their ledger. Ids, kinds, sizes and reason codes only.",
1464
+ events: {
1465
+ "announce-failed": "An artifact change could not be announced.",
1466
+ "cleanup-failed": "An artifact cleanup failed.",
1467
+ "grant-revocation-failed": "A grant could not be revoked.",
1468
+ "ledger-listener-failed": "A ledger listener threw.",
1469
+ "ledger-read-failed": "The ledger could not be read.",
1470
+ "operation-executor-failed": "A preview operation's executor failed.",
1471
+ "operation-failed": "A preview operation failed.",
1472
+ "pdf-preview": "A PDF preview was served.",
1473
+ "pdf-preview-failed": "A PDF preview failed.",
1474
+ "pdf-print-failed": "Printing an artifact to PDF failed.",
1475
+ "pdf-printed": "An artifact was printed to PDF.",
1476
+ "runtime-unavailable": "The artifact runtime could not be created."
1477
+ }
1478
+ }
1479
+ });
1480
+
1481
+ // ../protocol/src/log-vocabulary/scheduler.ts
1482
+ var SCHEDULER_LOG_AREAS = defineLogAreas({
1483
+ scheduler: {
1484
+ description: "Scheduled jobs and the backend-owned timing that fires them.",
1485
+ events: {
1486
+ "tick.failed": "A scheduler tick failed; the next tick retries.",
1487
+ "job.claim-failed": "A due job could not be claimed.",
1488
+ "fire.heartbeat-failed": "A running fire's heartbeat could not be recorded.",
1489
+ "fire.outcome-record-failed": "A finished fire's outcome could not be recorded."
1490
+ }
1491
+ }
1492
+ });
1493
+
803
1494
  // ../protocol/src/log-vocabulary/web-app.ts
804
1495
  var WEB_APP_LOG_AREAS = defineLogAreas({
805
1496
  "web.app": {
@@ -967,7 +1658,7 @@ var WEB_ENVIRONMENT_LOG_AREAS = defineLogAreas({
967
1658
  "models.pi-seed-failed": "The create dialog could not seed the Pi model catalogue.",
968
1659
  "models.opencode-cache-load-failed": "The create dialog could not read cached OpenCode models.",
969
1660
  "github-credential.check-failed": "The GitHub credential check before creating failed.",
970
- "feature-build.start-failed": "Starting a feature build from the dialog failed.",
1661
+ "feature-build.start-failed": "Starting a pipeline environment from the dialog failed.",
971
1662
  "settings.extensions-load-failed": "The settings dialog could not load extensions.",
972
1663
  "settings.container-reset-failed": "The settings dialog could not reset the container.",
973
1664
  "settings.save-failed": "The settings dialog could not save.",
@@ -1259,6 +1950,25 @@ var LOG_VOCABULARY = {
1259
1950
  ...TMUX_LOG_AREAS,
1260
1951
  ...UPDATER_LOG_AREAS,
1261
1952
  ...WEB_ANNOTATIONS_LOG_AREAS,
1953
+ ...STORAGE_LOG_AREAS,
1954
+ ...BUILD_PIPELINE_LOG_AREAS,
1955
+ ...AGENT_BRANCH_LOG_AREAS,
1956
+ ...CHANGE_TRACKING_LOG_AREAS,
1957
+ ...COORDINATOR_LOG_AREAS,
1958
+ ...REVIEW_LOG_AREAS,
1959
+ ...PUBLIC_API_LOG_AREAS,
1960
+ ...AGENT_ACCOUNTS_LOG_AREAS,
1961
+ ...DOCKER_LOG_AREAS,
1962
+ ...MCP_LOG_AREAS,
1963
+ ...DESIGN_LOG_AREAS,
1964
+ ...GRAPH_LOG_AREAS,
1965
+ ...NODES_LOG_AREAS,
1966
+ ...LINEAR_LOG_AREAS,
1967
+ ...USAGE_HISTORY_LOG_AREAS,
1968
+ ...FEATURE_LOG_AREAS,
1969
+ ...HOST_LOG_AREAS,
1970
+ ...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
1971
+ ...SCHEDULER_LOG_AREAS,
1262
1972
  ...WEB_APP_LOG_AREAS,
1263
1973
  ...WEB_BUILD_PIPELINE_LOG_AREAS,
1264
1974
  ...WEB_CHAT_LOG_AREAS,
@@ -1436,7 +2146,10 @@ function deliver(record) {
1436
2146
  line: config.format === "json" ? renderJson(record) : renderText(record),
1437
2147
  record
1438
2148
  });
1439
- } catch {}
2149
+ return true;
2150
+ } catch {
2151
+ return false;
2152
+ }
1440
2153
  }
1441
2154
  function buildRecord(level, area, event, fields) {
1442
2155
  const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
@@ -1592,6 +2305,19 @@ function resolveFields(fields) {
1592
2305
  return { fieldsFailed: true };
1593
2306
  }
1594
2307
  }
2308
+ function deliverEvent(level, area, event, fields) {
2309
+ const spec = areaSpec(area);
2310
+ if (!spec)
2311
+ return deliver(buildRecord(level, "logging", "unknown-area", undefined));
2312
+ if (!Object.hasOwn(spec.events, event))
2313
+ return deliver(buildRecord(level, area, "invalid-event", undefined));
2314
+ return deliver(buildRecord(level, area, event, fields));
2315
+ }
2316
+ function tryWriteLog(level, area, event, fields) {
2317
+ if (LEVEL_RANK[level] > thresholdRank(area))
2318
+ return false;
2319
+ return deliverEvent(level, area, event, resolveFields(fields));
2320
+ }
1595
2321
  function createLogger(area) {
1596
2322
  const spec = areaSpec(area);
1597
2323
  let seenGeneration = -1;
@@ -1604,13 +2330,7 @@ function createLogger(area) {
1604
2330
  return LEVEL_RANK[level] <= rank;
1605
2331
  };
1606
2332
  const writeResolved = (level, event, resolved) => {
1607
- if (!spec) {
1608
- deliver(buildRecord(level, "logging", "unknown-area", undefined));
1609
- } else if (Object.hasOwn(spec.events, event)) {
1610
- deliver(buildRecord(level, area, event, resolved));
1611
- } else {
1612
- deliver(buildRecord(level, area, "invalid-event", undefined));
1613
- }
2333
+ deliverEvent(level, area, event, resolved);
1614
2334
  };
1615
2335
  const write = (level, event, fields) => {
1616
2336
  if (!enabled(level))
@@ -1651,9 +2371,18 @@ function createLogger(area) {
1651
2371
  };
1652
2372
  }
1653
2373
 
2374
+ // ../protocol/src/event-loop-stall-monitor.ts
2375
+ var log = createLogger("event-loop");
2376
+ var EVENT_LOOP_STALL_ALWAYS_LOG_MS = 1e4;
2377
+
1654
2378
  // ../protocol/src/node/bridge-diagnostics.ts
1655
- var log = createLogger("bridge.diagnostics");
1656
- var INTERVAL_MS = 60000;
2379
+ var log2 = createLogger("bridge.diagnostics");
2380
+ var BRIDGE_DIAGNOSTICS_INTERVAL_MS = 60000;
2381
+ var INTERVAL_MS = BRIDGE_DIAGNOSTICS_INTERVAL_MS;
2382
+ var STALL_NO_DELTA_MS = 2 * INTERVAL_MS;
2383
+ var STALL_TOOL_PENDING_MS = 10 * 60000;
2384
+ var STALL_TICK_DELAY_MS = EVENT_LOOP_STALL_ALWAYS_LOG_MS;
2385
+ var BRIDGE_DIAGNOSTICS_KEEPALIVE_MS = 10 * 60000;
1657
2386
  var MAX_PENDING_TOOLS = 128;
1658
2387
  var MAX_REPORTED_TOOLS = 8;
1659
2388
  var MAX_ID_LENGTH = 1024;
@@ -1714,6 +2443,28 @@ var UPDATE_KINDS = new Set([
1714
2443
  "step-started",
1715
2444
  "step-completed"
1716
2445
  ]);
2446
+ var COUNTER_CHANGE_THRESHOLDS = {
2447
+ stderrBytes: 4096,
2448
+ requestsSent: 1,
2449
+ responsesReceived: 1,
2450
+ timeouts: 1,
2451
+ notificationsReceived: Number.POSITIVE_INFINITY,
2452
+ protocolErrors: 1
2453
+ };
2454
+ var WAITING_PHASES = new Set([
2455
+ "sending",
2456
+ "following",
2457
+ "draining",
2458
+ "cancelling"
2459
+ ]);
2460
+ function sameSet(a, b) {
2461
+ if (a.size !== b.size)
2462
+ return false;
2463
+ for (const value of a)
2464
+ if (!b.has(value))
2465
+ return false;
2466
+ return true;
2467
+ }
1717
2468
  function identity(value) {
1718
2469
  if (typeof value !== "string" || !value || value.length > MAX_ID_LENGTH)
1719
2470
  return;
@@ -1789,26 +2540,35 @@ function safeDiagnosticMetrics(value) {
1789
2540
  result.state = value.state;
1790
2541
  return result;
1791
2542
  }
2543
+ function bridgeDiagnosticsChangesEnabled() {
2544
+ return log2.isEnabled("trace");
2545
+ }
1792
2546
  function writeBridgeDiagnostic({ bridge, event, payload }) {
1793
- log.info(event, { bridge, payload });
2547
+ return tryWriteLog("info", "bridge.diagnostics", event, { bridge, payload });
1794
2548
  }
1795
2549
  function bridgeDiagnosticsActive() {
1796
- return log.isEnabled("info");
2550
+ return log2.isEnabled("info");
2551
+ }
2552
+ function bridgeDiagnosticsStreamEnabled(bridge) {
2553
+ return bridgeDebugEnabled(bridge) || log2.isEnabled("debug");
1797
2554
  }
1798
2555
  function writeDiagnostic(bridge, event, payload, write) {
1799
2556
  try {
1800
2557
  const json = JSON.stringify({ bridge, event, ...payload });
1801
2558
  const bytes = Buffer.byteLength(json);
1802
2559
  if (bytes <= MAX_BRIDGE_DIAGNOSTIC_BYTES) {
1803
- write({ bridge, event, payload: json });
1804
- return;
2560
+ const accepted = write({ bridge, event, payload: json });
2561
+ return accepted !== false;
1805
2562
  }
1806
- write({
2563
+ const accepted = write({
1807
2564
  bridge,
1808
2565
  event: "snapshot-overflow",
1809
2566
  payload: JSON.stringify({ bridge, event: "snapshot-overflow", omittedBytes: bytes })
1810
2567
  });
1811
- } catch {}
2568
+ return accepted !== false;
2569
+ } catch {
2570
+ return false;
2571
+ }
1812
2572
  }
1813
2573
 
1814
2574
  class BridgeRunDiagnostics {
@@ -1840,6 +2600,7 @@ class BridgeRunDiagnostics {
1840
2600
  completedTools = 0;
1841
2601
  pending = new Map;
1842
2602
  phase = "sending";
2603
+ processScope = false;
1843
2604
  terminal = "pending";
1844
2605
  stream = "pending";
1845
2606
  cancellation = "none";
@@ -1847,6 +2608,8 @@ class BridgeRunDiagnostics {
1847
2608
  run;
1848
2609
  closed = false;
1849
2610
  wasActive;
2611
+ baseline;
2612
+ changeQueued = false;
1850
2613
  timer;
1851
2614
  constructor(bridge, state, now = Date.now, write = writeBridgeDiagnostic, intervalMs = INTERVAL_MS, metrics = () => ({}), active = () => true) {
1852
2615
  this.bridge = bridge;
@@ -1892,7 +2655,8 @@ class BridgeRunDiagnostics {
1892
2655
  return;
1893
2656
  }
1894
2657
  if (stage === "completed") {
1895
- this.pending.delete(key);
2658
+ if (this.pending.delete(key))
2659
+ this.changed();
1896
2660
  this.completedTools++;
1897
2661
  return;
1898
2662
  }
@@ -1907,13 +2671,23 @@ class BridgeRunDiagnostics {
1907
2671
  stage: stage === "started" || existing?.stage === "started" ? "started" : "partial",
1908
2672
  nested
1909
2673
  });
2674
+ if (!existing)
2675
+ this.changed();
1910
2676
  }
1911
2677
  checkpoint(phase) {
2678
+ if (phase === "attached")
2679
+ this.processScope = true;
2680
+ if (phase === this.phase)
2681
+ return;
1912
2682
  this.phase = phase;
2683
+ this.changed();
1913
2684
  }
1914
2685
  count(key, amount = 1) {
1915
- if (!this.closed && Number.isSafeInteger(amount) && amount >= 0)
1916
- this.counters[key] += amount;
2686
+ if (this.closed || !Number.isSafeInteger(amount) || amount < 0)
2687
+ return;
2688
+ this.counters[key] += amount;
2689
+ if (amount > 0 && Number.isFinite(COUNTER_CHANGE_THRESHOLDS[key]))
2690
+ this.changed();
1917
2691
  }
1918
2692
  translationFailed() {
1919
2693
  this.translationFailures++;
@@ -1929,8 +2703,10 @@ class BridgeRunDiagnostics {
1929
2703
  }
1930
2704
  terminalSettled(outcome) {
1931
2705
  this.terminal = outcome;
1932
- if (outcome === "resolved")
2706
+ if (outcome === "resolved" && this.phase !== "draining") {
1933
2707
  this.phase = "draining";
2708
+ this.changed();
2709
+ }
1934
2710
  }
1935
2711
  requestCancellation(reason = "user") {
1936
2712
  this.cancellation = "pending";
@@ -1952,12 +2728,38 @@ class BridgeRunDiagnostics {
1952
2728
  if (this.closed)
1953
2729
  return;
1954
2730
  const now = this.now();
1955
- const age = (time) => time === undefined ? null : Math.max(0, now - time);
1956
2731
  const tickDelayMs = event === "heartbeat" ? Math.max(0, now - this.lastTick - this.intervalMs) : 0;
1957
2732
  if (event === "heartbeat")
1958
2733
  this.lastTick = now;
1959
- if (!this.active() || !bridgeDiagnosticsActive())
2734
+ if (!bridgeDiagnosticsActive())
2735
+ return;
2736
+ const stall = this.stallState(now, tickDelayMs);
2737
+ if (event === "heartbeat" && !this.active() && !this.periodicDue(now, stall))
2738
+ return;
2739
+ this.writeSnapshot(event, now, tickDelayMs, stall);
2740
+ }
2741
+ changed() {
2742
+ if (this.closed || this.changeQueued || !bridgeDiagnosticsChangesEnabled())
1960
2743
  return;
2744
+ this.changeQueued = true;
2745
+ queueMicrotask(() => {
2746
+ this.changeQueued = false;
2747
+ this.reportChange();
2748
+ });
2749
+ }
2750
+ reportChange() {
2751
+ if (this.closed || !bridgeDiagnosticsChangesEnabled() || !bridgeDiagnosticsActive())
2752
+ return;
2753
+ const last = this.baseline;
2754
+ if (last && !this.changedSince(last))
2755
+ return;
2756
+ const now = this.now();
2757
+ try {
2758
+ this.writeSnapshot("change", now, 0, this.stallState(now, 0));
2759
+ } catch {}
2760
+ }
2761
+ writeSnapshot(event, now, tickDelayMs, stall) {
2762
+ const age = (time) => time === undefined ? null : Math.max(0, now - time);
1961
2763
  const pendingTools = Array.from(this.pending.entries()).slice(0, MAX_REPORTED_TOOLS).map(([id, tool]) => ({
1962
2764
  id,
1963
2765
  kind: tool.kind,
@@ -1966,7 +2768,7 @@ class BridgeRunDiagnostics {
1966
2768
  ageMs: age(tool.since)
1967
2769
  }));
1968
2770
  try {
1969
- writeDiagnostic(this.bridge, event, {
2771
+ const written = writeDiagnostic(this.bridge, event, {
1970
2772
  session: identity(this.state.id),
1971
2773
  run: this.run,
1972
2774
  phase: this.phase,
@@ -1993,8 +2795,64 @@ class BridgeRunDiagnostics {
1993
2795
  completedTools: this.completedTools,
1994
2796
  tickDelayMs
1995
2797
  }, this.write);
2798
+ if (!written)
2799
+ return;
2800
+ this.baseline = {
2801
+ at: now,
2802
+ phase: this.phase,
2803
+ pending: new Set(this.pending.keys()),
2804
+ counters: { ...this.counters },
2805
+ stall
2806
+ };
1996
2807
  } catch {}
1997
2808
  }
2809
+ periodicDue(now, stall) {
2810
+ if (stall.signals.has("tick-delay"))
2811
+ return true;
2812
+ const last = this.baseline;
2813
+ if (!last)
2814
+ return true;
2815
+ if (!sameSet(stall.signals, last.stall.signals) || !sameSet(stall.tools, last.stall.tools))
2816
+ return true;
2817
+ if (stall.signals.has("no-delta") && this.changedSince(last))
2818
+ return true;
2819
+ return now - last.at >= BRIDGE_DIAGNOSTICS_KEEPALIVE_MS;
2820
+ }
2821
+ changedSince(last) {
2822
+ if (this.phase !== last.phase)
2823
+ return true;
2824
+ if (this.pending.size !== last.pending.size)
2825
+ return true;
2826
+ for (const key of this.pending.keys())
2827
+ if (!last.pending.has(key))
2828
+ return true;
2829
+ for (const key of Object.keys(this.counters))
2830
+ if (this.counters[key] - last.counters[key] >= COUNTER_CHANGE_THRESHOLDS[key])
2831
+ return true;
2832
+ return false;
2833
+ }
2834
+ stallState(now, tickDelayMs) {
2835
+ const signals = new Set;
2836
+ const tools = new Set;
2837
+ let oldestPending;
2838
+ for (const [key, tool] of this.pending) {
2839
+ if (oldestPending === undefined || tool.since < oldestPending)
2840
+ oldestPending = tool.since;
2841
+ if (now - tool.since >= STALL_TOOL_PENDING_MS)
2842
+ tools.add(key);
2843
+ }
2844
+ const waitingSince = this.processScope ? oldestPending : WAITING_PHASES.has(this.phase) ? this.startedAt : undefined;
2845
+ if (waitingSince !== undefined) {
2846
+ const quietSince = Math.max(this.lastDelta ?? waitingSince, waitingSince);
2847
+ if (now - quietSince >= STALL_NO_DELTA_MS)
2848
+ signals.add("no-delta");
2849
+ }
2850
+ if (tools.size > 0)
2851
+ signals.add("tool-pending");
2852
+ if (tickDelayMs >= STALL_TICK_DELAY_MS)
2853
+ signals.add("tick-delay");
2854
+ return { signals, tools };
2855
+ }
1998
2856
  close(phase = "finished") {
1999
2857
  if (this.closed)
2000
2858
  return;
@@ -2007,8 +2865,9 @@ class BridgeRunDiagnostics {
2007
2865
  }
2008
2866
  }
2009
2867
  function createBridgeDiagnostics(bridge, state, metrics) {
2010
- return new BridgeRunDiagnostics(bridge, state, undefined, undefined, undefined, metrics, () => bridgeDebugEnabled(bridge));
2868
+ return new BridgeRunDiagnostics(bridge, state, undefined, undefined, undefined, metrics, () => bridgeDiagnosticsStreamEnabled(bridge));
2011
2869
  }
2870
+ var bufferedFlushes = new Set;
2012
2871
 
2013
2872
  // ../../bridges/acp-bridge/src/acp-context.ts
2014
2873
  import { spawn as spawn2 } from "node:child_process";
@@ -13032,7 +13891,7 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
13032
13891
  }
13033
13892
 
13034
13893
  // ../../bridges/acp-bridge/src/acp-persist-writer.ts
13035
- var log2 = createLogger("bridge.acp");
13894
+ var log3 = createLogger("bridge.acp");
13036
13895
  function boundPersistedSnapshot(snapshot) {
13037
13896
  const bounded = {
13038
13897
  ...snapshot,
@@ -13229,7 +14088,7 @@ function schedulePersist() {
13229
14088
  await writePersistedState();
13230
14089
  });
13231
14090
  setPersistenceTail(operation.catch((error) => {
13232
- log2.warn("state.persist-failed", { error: formatLogError(error, { stack: false }) });
14091
+ log3.warn("state.persist-failed", { error: formatLogError(error, { stack: false }) });
13233
14092
  }));
13234
14093
  }
13235
14094
  function persistState() {
@@ -17189,7 +18048,7 @@ function compactCommandSelection(state) {
17189
18048
  }
17190
18049
 
17191
18050
  // ../../bridges/acp-bridge/src/acp-persistence.ts
17192
- var log3 = createLogger("bridge.acp");
18051
+ var log4 = createLogger("bridge.acp");
17193
18052
  async function listNormalizedModels(signal) {
17194
18053
  const live = mergeComposerCatalog(provider, [
17195
18054
  ...catalogCache ? [catalogCache] : [],
@@ -17237,14 +18096,14 @@ function restoreSessionConfig(candidate) {
17237
18096
  const restored = parsePersistedAcpSessionConfig(provider, candidate.sessionConfig);
17238
18097
  if (restored)
17239
18098
  return restored;
17240
- log3.warn("state.session-config-reset");
18099
+ log4.warn("state.session-config-reset");
17241
18100
  return emptySessionConfig();
17242
18101
  }
17243
18102
  if (candidate.composer !== undefined) {
17244
18103
  const composer = parsePersistedComposerState(provider, candidate.composer);
17245
18104
  if (composer)
17246
18105
  return { ...emptySessionConfig(), composer };
17247
- log3.warn("state.composer-reset");
18106
+ log4.warn("state.composer-reset");
17248
18107
  }
17249
18108
  return emptySessionConfig();
17250
18109
  }
@@ -17327,7 +18186,7 @@ async function restorePersistedState() {
17327
18186
  sessions.clear();
17328
18187
  bumpCursorDiscoveryRevision();
17329
18188
  clientSessionKeys.clear();
17330
- log3.warn("state.discarded", { error: formatLogError(error, { stack: false }) });
18189
+ log4.warn("state.discarded", { error: formatLogError(error, { stack: false }) });
17331
18190
  const file = stateFile;
17332
18191
  if (!file)
17333
18192
  return;
@@ -19518,7 +20377,7 @@ function canonicalEvidence(evidence) {
19518
20377
  }
19519
20378
 
19520
20379
  // ../../bridges/acp-bridge/src/change-evidence.ts
19521
- var log4 = createLogger("bridge.acp");
20380
+ var log5 = createLogger("bridge.acp");
19522
20381
  var MAX_DIFF_BLOCKS_PER_CALL = 100;
19523
20382
  var MAX_HELD_DIFF_BYTES = 32 * 1024 * 1024;
19524
20383
  var MAX_SEEN_CALL_IDS = 8192;
@@ -19817,7 +20676,7 @@ function recordAcpToolEvidence(state, part, update) {
19817
20676
  if (isTerminal(phase))
19818
20677
  settleRecord(state, part, record);
19819
20678
  } catch (error) {
19820
- log4.warn("evidence.record-failed", {
20679
+ log5.warn("evidence.record-failed", {
19821
20680
  errorClass: error instanceof Error ? error.name : "unknown"
19822
20681
  });
19823
20682
  }
@@ -19861,7 +20720,7 @@ function recordAcpShellObservation(state, toolUseId, observation) {
19861
20720
  ...observation.unavailableReason ? { unavailableReason: observation.unavailableReason } : {}
19862
20721
  });
19863
20722
  } catch (error) {
19864
- log4.warn("evidence.shell-record-failed", {
20723
+ log5.warn("evidence.shell-record-failed", {
19865
20724
  errorClass: error instanceof Error ? error.name : "unknown"
19866
20725
  });
19867
20726
  }
@@ -19893,14 +20752,14 @@ function endAcpTurnEvidence(state, outcome) {
19893
20752
  const writers = state.activeSubagentToolIds.size > 0 || turn.backgroundLaunched ? "may-write" : "quiescent";
19894
20753
  changeEvidenceRecorder().turn({ conversationId: state.id, turnId: turn.turnId }, outcome, writers);
19895
20754
  } catch (error) {
19896
- log4.warn("evidence.turn-record-failed", {
20755
+ log5.warn("evidence.turn-record-failed", {
19897
20756
  errorClass: error instanceof Error ? error.name : "unknown"
19898
20757
  });
19899
20758
  }
19900
20759
  }
19901
20760
 
19902
20761
  // ../../bridges/acp-bridge/src/acp-command-changes.ts
19903
- var log5 = createLogger("bridge.acp");
20762
+ var log6 = createLogger("bridge.acp");
19904
20763
  var MAX_WINDOWS_PER_SESSION = 256;
19905
20764
  var MAX_CACHED_JOURNALS = MAX_RESUMABLE_SESSIONS;
19906
20765
  var probe;
@@ -20014,7 +20873,7 @@ function closeWindow(active, state, toolUseId, role) {
20014
20873
  recordAcpShellObservation(state, toolUseId, observation);
20015
20874
  recordCommandChange(state, toolUseId, legacyCommandChange(observation));
20016
20875
  }).catch((error) => {
20017
- log5.warn("command-change.record-failed", {
20876
+ log6.warn("command-change.record-failed", {
20018
20877
  errorClass: error instanceof Error ? error.name : "unknown"
20019
20878
  });
20020
20879
  });
@@ -24593,7 +25452,7 @@ function watchClientDisconnect(request, response, onDisconnect) {
24593
25452
  }
24594
25453
 
24595
25454
  // ../../bridges/acp-bridge/src/acp-server.ts
24596
- var log6 = createLogger("bridge.acp");
25455
+ var log7 = createLogger("bridge.acp");
24597
25456
  configureBridgeLogger();
24598
25457
  await restorePersistedState();
24599
25458
  var server = createServer((request, response) => {
@@ -24611,7 +25470,7 @@ var server = createServer((request, response) => {
24611
25470
  json(response, status, { error: error instanceof Error ? error.message : String(error) });
24612
25471
  }).finally(stopWatchingClient);
24613
25472
  });
24614
- server.listen(port, hostname, () => log6.info("server.listening", { provider, hostname, port }));
25473
+ server.listen(port, hostname, () => log7.info("server.listening", { provider, hostname, port }));
24615
25474
  var shutdownPromise = null;
24616
25475
  function shutdown() {
24617
25476
  if (shutdownPromise)