@cluesmith/codev 3.3.2 → 3.3.3

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.
Files changed (157) hide show
  1. package/dashboard-dist/assets/{index-D3XaKpZW.js → index-CUIjS_Vb.js} +41 -41
  2. package/dashboard-dist/assets/index-CUIjS_Vb.js.map +1 -0
  3. package/dashboard-dist/assets/index-DnYLy5C_.css +32 -0
  4. package/dashboard-dist/index.html +2 -2
  5. package/dist/agent-farm/commands/inbox.d.ts.map +1 -1
  6. package/dist/agent-farm/commands/inbox.js +67 -10
  7. package/dist/agent-farm/commands/inbox.js.map +1 -1
  8. package/dist/agent-farm/commands/interrupt.d.ts +4 -1
  9. package/dist/agent-farm/commands/interrupt.d.ts.map +1 -1
  10. package/dist/agent-farm/commands/interrupt.js +6 -3
  11. package/dist/agent-farm/commands/interrupt.js.map +1 -1
  12. package/dist/agent-farm/commands/reset.d.ts +4 -1
  13. package/dist/agent-farm/commands/reset.d.ts.map +1 -1
  14. package/dist/agent-farm/commands/reset.js +6 -3
  15. package/dist/agent-farm/commands/reset.js.map +1 -1
  16. package/dist/agent-farm/commands/send.d.ts +28 -0
  17. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  18. package/dist/agent-farm/commands/send.js +64 -6
  19. package/dist/agent-farm/commands/send.js.map +1 -1
  20. package/dist/agent-farm/db/index.d.ts +3 -1
  21. package/dist/agent-farm/db/index.d.ts.map +1 -1
  22. package/dist/agent-farm/db/index.js +8 -443
  23. package/dist/agent-farm/db/index.js.map +1 -1
  24. package/dist/agent-farm/db/mailbox.d.ts +47 -7
  25. package/dist/agent-farm/db/mailbox.d.ts.map +1 -1
  26. package/dist/agent-farm/db/mailbox.js +56 -12
  27. package/dist/agent-farm/db/mailbox.js.map +1 -1
  28. package/dist/agent-farm/db/migrations.d.ts +57 -0
  29. package/dist/agent-farm/db/migrations.d.ts.map +1 -0
  30. package/dist/agent-farm/db/migrations.js +530 -0
  31. package/dist/agent-farm/db/migrations.js.map +1 -0
  32. package/dist/agent-farm/db/schema.d.ts +1 -1
  33. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  34. package/dist/agent-farm/db/schema.js +1 -0
  35. package/dist/agent-farm/db/schema.js.map +1 -1
  36. package/dist/agent-farm/db/types.d.ts +22 -0
  37. package/dist/agent-farm/db/types.d.ts.map +1 -1
  38. package/dist/agent-farm/db/types.js.map +1 -1
  39. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
  40. package/dist/agent-farm/lib/tunnel-client.js +43 -14
  41. package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
  42. package/dist/agent-farm/servers/cron-delivery.d.ts +7 -1
  43. package/dist/agent-farm/servers/cron-delivery.d.ts.map +1 -1
  44. package/dist/agent-farm/servers/cron-delivery.js +2 -1
  45. package/dist/agent-farm/servers/cron-delivery.js.map +1 -1
  46. package/dist/agent-farm/servers/gate-profiles.d.ts +21 -0
  47. package/dist/agent-farm/servers/gate-profiles.d.ts.map +1 -1
  48. package/dist/agent-farm/servers/gate-profiles.js +36 -4
  49. package/dist/agent-farm/servers/gate-profiles.js.map +1 -1
  50. package/dist/agent-farm/servers/mailbox-delivery.d.ts +83 -8
  51. package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -1
  52. package/dist/agent-farm/servers/mailbox-delivery.js +102 -26
  53. package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -1
  54. package/dist/agent-farm/servers/mailbox-wiring.d.ts +48 -15
  55. package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -1
  56. package/dist/agent-farm/servers/mailbox-wiring.js +116 -22
  57. package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -1
  58. package/dist/agent-farm/servers/render-gate.d.ts +24 -1
  59. package/dist/agent-farm/servers/render-gate.d.ts.map +1 -1
  60. package/dist/agent-farm/servers/render-gate.js +50 -12
  61. package/dist/agent-farm/servers/render-gate.js.map +1 -1
  62. package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
  63. package/dist/agent-farm/servers/tower-cron.js +3 -2
  64. package/dist/agent-farm/servers/tower-cron.js.map +1 -1
  65. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  66. package/dist/agent-farm/servers/tower-instances.js +11 -3
  67. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  68. package/dist/agent-farm/servers/tower-routes.d.ts +32 -0
  69. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  70. package/dist/agent-farm/servers/tower-routes.js +133 -13
  71. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  72. package/dist/agent-farm/servers/tower-server.js +15 -2
  73. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  74. package/dist/agent-farm/servers/tower-terminals.d.ts +21 -0
  75. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  76. package/dist/agent-farm/servers/tower-terminals.js +53 -5
  77. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  78. package/dist/agent-farm/servers/tower-utils.d.ts +35 -0
  79. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
  80. package/dist/agent-farm/servers/tower-utils.js +39 -0
  81. package/dist/agent-farm/servers/tower-utils.js.map +1 -1
  82. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  83. package/dist/agent-farm/servers/tower-websocket.js +8 -1
  84. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  85. package/dist/agent-farm/utils/message-format.d.ts +78 -2
  86. package/dist/agent-farm/utils/message-format.d.ts.map +1 -1
  87. package/dist/agent-farm/utils/message-format.js +102 -5
  88. package/dist/agent-farm/utils/message-format.js.map +1 -1
  89. package/dist/cli.d.ts.map +1 -1
  90. package/dist/cli.js +3 -1
  91. package/dist/cli.js.map +1 -1
  92. package/dist/commands/doctor.js +2 -2
  93. package/dist/commands/generate-image.d.ts +20 -1
  94. package/dist/commands/generate-image.d.ts.map +1 -1
  95. package/dist/commands/generate-image.js +188 -1
  96. package/dist/commands/generate-image.js.map +1 -1
  97. package/dist/commands/porch/prompts.d.ts.map +1 -1
  98. package/dist/commands/porch/prompts.js +18 -2
  99. package/dist/commands/porch/prompts.js.map +1 -1
  100. package/dist/lib/forge-contracts.d.ts +66 -5
  101. package/dist/lib/forge-contracts.d.ts.map +1 -1
  102. package/dist/lib/forge-contracts.js.map +1 -1
  103. package/dist/lib/forge.d.ts +1 -1
  104. package/dist/lib/forge.d.ts.map +1 -1
  105. package/dist/lib/forge.js +33 -11
  106. package/dist/lib/forge.js.map +1 -1
  107. package/dist/terminal/pty-manager.d.ts +10 -1
  108. package/dist/terminal/pty-manager.d.ts.map +1 -1
  109. package/dist/terminal/pty-manager.js +38 -9
  110. package/dist/terminal/pty-manager.js.map +1 -1
  111. package/dist/terminal/pty-session.d.ts +52 -4
  112. package/dist/terminal/pty-session.d.ts.map +1 -1
  113. package/dist/terminal/pty-session.js +157 -18
  114. package/dist/terminal/pty-session.js.map +1 -1
  115. package/dist/terminal/shellper-client.d.ts +73 -0
  116. package/dist/terminal/shellper-client.d.ts.map +1 -1
  117. package/dist/terminal/shellper-client.js +151 -0
  118. package/dist/terminal/shellper-client.js.map +1 -1
  119. package/dist/terminal/shellper-main.js +20 -3
  120. package/dist/terminal/shellper-main.js.map +1 -1
  121. package/dist/terminal/shellper-process.d.ts +2 -0
  122. package/dist/terminal/shellper-process.d.ts.map +1 -1
  123. package/dist/terminal/shellper-process.js +17 -1
  124. package/dist/terminal/shellper-process.js.map +1 -1
  125. package/dist/terminal/shellper-protocol.d.ts +28 -0
  126. package/dist/terminal/shellper-protocol.d.ts.map +1 -1
  127. package/dist/terminal/shellper-protocol.js.map +1 -1
  128. package/package.json +4 -4
  129. package/scripts/forge/gitea/_lib.sh +214 -0
  130. package/scripts/forge/gitea/issue-comment.sh +8 -1
  131. package/scripts/forge/gitea/issue-view.sh +95 -4
  132. package/scripts/forge/gitea/pr-create.sh +155 -0
  133. package/scripts/forge/gitea/pr-exists.sh +32 -4
  134. package/scripts/forge/gitea/pr-list.sh +40 -31
  135. package/scripts/forge/gitea/pr-view.sh +65 -4
  136. package/scripts/forge/gitea/recently-merged.sh +91 -21
  137. package/scripts/forge/gitea/user-identity.sh +30 -1
  138. package/scripts/forge/github/issue-view.sh +5 -2
  139. package/scripts/forge/github/pr-create.sh +47 -0
  140. package/scripts/forge/github/pr-search.sh +3 -1
  141. package/scripts/forge/gitlab/issue-view.sh +24 -4
  142. package/scripts/forge/gitlab/pr-create.sh +53 -0
  143. package/scripts/forge/gitlab/pr-search.sh +3 -1
  144. package/scripts/forge/linear/issue-view.sh +13 -2
  145. package/skeleton/.claude/skills/generate-image/SKILL.md +22 -1
  146. package/skeleton/.codex/skills/generate-image/SKILL.md +22 -1
  147. package/skeleton/protocols/air/prompts/pr.md +6 -1
  148. package/skeleton/protocols/aspir/prompts/review.md +6 -1
  149. package/skeleton/protocols/bugfix/prompts/pr.md +6 -1
  150. package/skeleton/protocols/bugfix/protocol.md +2 -1
  151. package/skeleton/protocols/maintain/prompts/review.md +6 -1
  152. package/skeleton/protocols/pir/prompts/review.md +10 -7
  153. package/skeleton/protocols/spir/prompts/review.md +6 -1
  154. package/skeleton/resources/commands/agent-farm.md +1 -1
  155. package/templates/tower.html +16 -1
  156. package/dashboard-dist/assets/index-BZRTEMtH.css +0 -32
  157. package/dashboard-dist/assets/index-D3XaKpZW.js.map +0 -1
@@ -33,8 +33,9 @@
33
33
  * {@link DeliveryPorts}, so the orchestration is unit-testable without a live Tower.
34
34
  */
35
35
  import path from 'node:path';
36
- import { findHeldForAgent, getById, listHeld, markDelivered, setHeldReason, pruneTerminal, findEscalatable, markEscalated, findStarvingAgents, } from '../db/mailbox.js';
36
+ import { findHeldForAgent, getById, listHeld, markDelivered, setHeldVerdict, pruneTerminal, findEscalatable, markEscalated, markEscalatedDelivered, findStarvingAgents, } from '../db/mailbox.js';
37
37
  import { KeyedSerializer } from './write-queue.js';
38
+ import { formatVerdict, isUnverifiableVerdict } from '@cluesmith/codev-sdk/hold-verdict';
38
39
  /**
39
40
  * A gate outcome the render gate CANNOT bound to a decision — an unrecognized app
40
41
  * (`no-profile`) or a recognized app whose composer region can't be found
@@ -44,9 +45,18 @@ import { KeyedSerializer } from './write-queue.js';
44
45
  * `busy`/`user-text` streak is deliberately excluded (a human legitimately at the line).
45
46
  * Shared by `recordStreak` and the cooldown branch of {@link MailboxDrainer.tick} so a
46
47
  * skipped tick and a real pass agree on what counts as classifier-stuck (CMAP round 3).
48
+ *
49
+ * This is the POLICY-side name for the same question `isUnverifiableVerdict` answers for the
50
+ * presentation surfaces, so it delegates rather than restating the rule (maintainer review,
51
+ * PR #1604). Two copies of "which verdicts never clear on their own" is one edit away from an
52
+ * escalation policy and an operator-facing remedy disagreeing about the same row. The wrapper
53
+ * is kept rather than collapsed to a single function because the two callers want different
54
+ * types: this one is typed on the DB/gate unions and reads naturally beside the escalation
55
+ * policy it serves, while the shared predicate takes the plain strings the CLI, the dashboard
56
+ * and the VS Code toast actually hold.
47
57
  */
48
58
  function isClassifierStuck(reason, detail) {
49
- return reason === 'no-profile' || detail === 'no-region-end' || detail === 'no-composer-marker';
59
+ return isUnverifiableVerdict(reason, detail);
50
60
  }
51
61
  /**
52
62
  * How long the receiving session's screen must have been QUIET before a gated delivery may
@@ -176,10 +186,15 @@ export async function deliverAgentMail(ports, db, workspacePath, toAgent, memo)
176
186
  const held = findHeldForAgent(db, workspacePath, toAgent, ports.now());
177
187
  if (held.length === 0)
178
188
  return { delivered: [], reason: null };
189
+ // Every NON-gate hold, plus the post-classify re-holds (token moved / not settled). It
190
+ // deliberately nulls `detail` (Issue #1482): a detail describes a gate verdict, and holding
191
+ // for `no-live-pty` — or re-holding a screen that moved under us — is not one. Leaving the
192
+ // previous detail in place would let `afx inbox` keep asserting "a human is at the composer"
193
+ // about a session whose PTY has since died.
179
194
  const hold = (reason) => {
180
195
  for (const row of held) {
181
- if (row.reason !== reason)
182
- setHeldReason(db, row.id, reason, ports.now());
196
+ if (row.reason !== reason || row.detail !== null)
197
+ setHeldVerdict(db, row.id, reason, null, ports.now());
183
198
  }
184
199
  return { delivered: [], reason };
185
200
  };
@@ -218,9 +233,14 @@ export async function deliverAgentMail(ports, db, workspacePath, toAgent, memo)
218
233
  // Carry the gate detail so a sustained classifier-stuck streak (a drifted profile
219
234
  // or an unrenderable frame) escalates to liveness telemetry instead of holding silently.
220
235
  const reason = verdict.reason ?? 'busy';
236
+ // `empty` is the CLEAN detail and cannot reach here (a clean verdict does not take this
237
+ // branch); narrowing it away keeps the persisted set to the three not-clean values the
238
+ // column's type admits.
239
+ const detail = verdict.detail === 'empty' ? null : verdict.detail;
221
240
  for (const row of held) {
222
- if (row.reason !== reason)
223
- setHeldReason(db, row.id, reason, ports.now());
241
+ if (row.reason !== reason || row.detail !== detail) {
242
+ setHeldVerdict(db, row.id, reason, detail, ports.now());
243
+ }
224
244
  }
225
245
  return { delivered: [], reason, detail: verdict.detail };
226
246
  }
@@ -359,25 +379,31 @@ export async function deliverAgentMail(ports, db, workspacePath, toAgent, memo)
359
379
  }
360
380
  return hold(result.abort.reason);
361
381
  }
362
- // The write completed — every byte, Enter included, was accepted by the session. That is
363
- // still only proof the bytes were QUEUED (Issue #1573): `session.write` reports true whenever
364
- // the socket object is connected, so a composer that ate the leading bytes (#1564) lands here
365
- // looking identical to a clean delivery. Ask the screen before claiming success.
382
+ // THE POINT OF NO RETURN (Issue #1584). Past this line the write COMPLETED — every byte,
383
+ // Enter included, was accepted by the session — so the row is at-least-once delivered and
384
+ // must NEVER be written again. Nothing below may `hold(...)`: a hold puts the row back in
385
+ // the drainer's held set, and the next clean-prompt pass re-writes the WHOLE message with
386
+ // no attempt cap anywhere in this module. That is exactly what #1583 saw in the field —
387
+ // one `afx send --file` re-injected dozens of times, byte-identical, silently (a `busy`
388
+ // hold is excluded from {@link isClassifierStuck}, so no streak ever escalates it).
366
389
  //
367
- // A `false` here is "could not confirm", so the row is HELD, not dropped: the existing
368
- // redelivery machinery retries it on a later clean gate, and the escalation path already makes
369
- // a row that never confirms visible. That inverts the failure this issue exists to remove —
370
- // the worst case becomes a duplicate delivery the agent can see, instead of a silent loss the
371
- // sender was told was a success.
372
- if (echo && !(await echo.verify())) {
373
- ports.log(`[mailbox] write to ${toAgent} @ ${path.basename(workspacePath)} completed but its header ` +
374
- `never appeared on the terminal — holding ${row.id.slice(0, 8)}… for redelivery rather ` +
375
- `than reporting it delivered`);
376
- return hold('busy');
377
- }
378
- // markDelivered is guarded (held→delivered only). If it did NOT transition, the row
379
- // was dismissed/superseded during the paced write — accept that terminal state and
380
- // do not broadcast a delivery for it.
390
+ // Only PRE-write prechecks may hold, and every hold above this point is one: the branches
391
+ // between the write and here wrote NOTHING (`contended`, `aborted`) or produced a write that
392
+ // cannot be trusted to have landed (`dropped` — bytes lost mid-pace to a dead socket;
393
+ // `preempted` — an unserialized operator submission may have cleared or truncated the
394
+ // composer under them). Only `written` reaches this line, and only `written` is the
395
+ // at-least-once guarantee that forbids a re-write.
396
+ //
397
+ // COMMIT THE DELIVERY FIRST, before any further await or fallible call (CMAP round 1 — Codex).
398
+ // The point of no return is only real if it is DURABLE: while the row still reads `held` in
399
+ // the database it is re-writable by the next drainer tick, so leaving it held across ~1.2 s of
400
+ // verification would reopen the loop for any interruption of that window — a Tower crash or
401
+ // restart, or a `verify()` that rejects instead of answering. `markDelivered` is synchronous
402
+ // (better-sqlite3), so ordering it here leaves no window at all.
403
+ //
404
+ // markDelivered is guarded (held→delivered only). If it did NOT transition, the row was
405
+ // dismissed/superseded during the paced write — accept that terminal state and do not
406
+ // broadcast a delivery for it.
381
407
  if (!markDelivered(db, row.id, ports.now())) {
382
408
  ports.onHeldStateChange();
383
409
  return { delivered: [], reason: null };
@@ -385,7 +411,49 @@ export async function deliverAgentMail(ports, db, workspacePath, toAgent, memo)
385
411
  ports.broadcast(broadcastForRow(current, ports.now()));
386
412
  ports.onHeldStateChange(); // a held row left the set → refresh the indicator count
387
413
  ports.log(`[mailbox] delivered ${row.id} → ${toAgent} @ ${path.basename(workspacePath)}`);
388
- return { delivered: [row.id], reason: null };
414
+ // Echo verification (Issue #1573) still runs — it is the only end-to-end evidence the bytes
415
+ // reached the terminal — but it is now pure REPORTING, downstream of a delivery that is
416
+ // already committed. `false` means "could not confirm", never "definitely lost".
417
+ let verified;
418
+ if (echo) {
419
+ // One bounded RE-verify window before giving up. `verify()` polls to its own deadline and
420
+ // then answers false; a second call opens a fresh window against the SAME pre-write sample,
421
+ // so it still requires evidence THIS write produced. It accommodates a slow renderer
422
+ // without writing a single byte, and the total stays inside the sender's patience (~1.5 s)
423
+ // because the request path awaits this.
424
+ //
425
+ // A REJECTION is unconfirmed, not an error to propagate: the bytes are out and the row is
426
+ // committed, so throwing here would only deny the sender the `verified` answer and log a
427
+ // spurious delivery failure.
428
+ try {
429
+ verified = (await echo.verify()) || (await echo.verify());
430
+ }
431
+ catch (err) {
432
+ verified = false;
433
+ ports.log(`[mailbox] echo verification errored for ${row.id.slice(0, 8)}…: ${String(err)}`, 'WARN');
434
+ }
435
+ if (!verified) {
436
+ // The row is already `delivered`, so this is the delivered-only counterpart of the
437
+ // drainer's held-only `markEscalated`.
438
+ markEscalatedDelivered(db, row.id, ports.now());
439
+ ports.log(`[mailbox] delivered-unverified ${row.id.slice(0, 8)}… → ${toAgent} @ ` +
440
+ `${path.basename(workspacePath)} (terminal ${session.id}, needle ${needle.length} chars): ` +
441
+ `the write completed but its header never appeared on the terminal. Recorded as ` +
442
+ `delivered and flagged — NOT re-written (Issue #1584).`, 'WARN');
443
+ // Raise it where a human will see it. The sender's `verified: false` covers an
444
+ // interactive `afx send`, but a cron or backstop delivery has no sender waiting on a
445
+ // response, and a DELIVERED row is invisible to every held-scoped surface (`afx inbox`,
446
+ // the held-count indicator) — without this its only trace is a log line (CMAP round 1 —
447
+ // Codex).
448
+ ports.onUnverifiedDelivery?.({
449
+ workspacePath,
450
+ toAgent,
451
+ mailboxId: row.id,
452
+ terminalId: session.id,
453
+ });
454
+ }
455
+ }
456
+ return { delivered: [row.id], reason: null, ...(verified === undefined ? {} : { verified }) };
389
457
  }
390
458
  /**
391
459
  * Shared per-agent delivery serializer (Spec 1313, Phase 4). Every live caller —
@@ -612,9 +680,10 @@ export class MailboxDrainer {
612
680
  mailboxId: row.id,
613
681
  ageMs,
614
682
  reason: row.reason,
683
+ detail: row.detail,
615
684
  });
616
685
  ports.log(`[mailbox] ESCALATED ${row.id.slice(0, 8)}… → ${row.to_agent} @ ${path.basename(row.workspace_path)} ` +
617
- `(held ${Math.round(ageMs / 1000)}s, reason ${row.reason ?? 'held'}) — visibility only, not delivered`);
686
+ `(held ${Math.round(ageMs / 1000)}s, reason ${formatVerdict(row.reason, row.detail)}) — visibility only, not delivered`);
618
687
  }
619
688
  // A row's escalated flag flipped → the overview-derived `mailboxEscalated` attention
620
689
  // bit changed. Fire the held-state-change event too (in addition to the per-row
@@ -664,8 +733,15 @@ export class MailboxDrainer {
664
733
  workspacePath: agent.workspacePath,
665
734
  toAgent: agent.toAgent,
666
735
  reason: agent.reason,
736
+ // Issue #1482: the gate detail decides which notice the owner gets, and the streak
737
+ // says how many consecutive checks confirmed it. Both are already tracked — the
738
+ // detail on the row (aggregated by findStarvingAgents), the streak in the drainer's
739
+ // own map — so this costs no new state, just carrying what we have to where the
740
+ // human reads it.
741
+ detail: agent.detail,
667
742
  ageMs: now - agent.stuckSince,
668
743
  heldCount: agent.count,
744
+ streak: this.notCleanStreak.get(key) ?? 0,
669
745
  });
670
746
  if (enqueued)
671
747
  this.notifiedAgents.add(key);
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox-delivery.js","sourceRoot":"","sources":["../../../src/agent-farm/servers/mailbox-delivery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,aAAa,EACb,kB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C,UAAU,KAAK,GAAG;oBAAE,OAAO,CAAC,qDAAqD;gBACrD,8CAA8C;gBACnF,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAClC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,KAAK,CAAC,GAAG,CAAC,wCAAwC,OAAO,KAAK,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACnC,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { type PtySession } from '../../terminal/pty-session.js';
15
15
  import { type GateProfile, type GateVerdict } from './render-gate.js';
16
- import { MailboxDrainer, type EchoWatch, type DeliveryPorts, type DeliverySession } from './mailbox-delivery.js';
16
+ import { MailboxDrainer, type EchoWatch, type DeliveryPorts, type DeliverySession, type HeldOwnerNoticeInfo } from './mailbox-delivery.js';
17
17
  type LogFn = (level: 'INFO' | 'ERROR' | 'WARN', message: string) => void;
18
18
  /**
19
19
  * The SSE broadcast fn (Tower's `broadcastNotification`), wired once at boot via
@@ -70,16 +70,25 @@ export declare function resolveAgentForSession(sessionId: string): {
70
70
  * (fail-safe by construction: an unknown agent is held and surfaced, never guessed
71
71
  * — this is what correctly trips on wrapper/boot/relaunch screens too).
72
72
  *
73
- * Stale-identity note (Spec 1313): `session.command` is now sourced from the
74
- * persisted `terminal_sessions.command` on reconnect. If it ever goes stale (a
75
- * user re-points `shell.architect` at a different harness and the shellper later
76
- * auto-restarts into it while the row still names the old one), this can resolve
77
- * the WRONG profile — but it fails CLOSED today, not misdelivered: CLAUDE_PROFILE
78
- * and CODEX_PROFILE are behaviourally identical (same marker + region patterns),
79
- * and any cross-family mismatch (e.g. agy's `> ` marker) fails the composer-marker
80
- * test → not clean → held. That safety is a property of the current profile TABLE,
81
- * not of this design; the day codex/claude markers diverge, stale identity becomes
82
- * a live bug and the authoritative fix is WELCOME-frame hydration (see review).
73
+ * Identity precedence (PIR #1475): `session.command` is AUTHORITATIVE where it can
74
+ * be — it reads through to the identity the attached shellper states in its WELCOME
75
+ * frame, i.e. the argv the process that owns the PTY actually spawned, refreshed
76
+ * across reconnects and SPAWN relaunches. Only when no shellper identity is
77
+ * available (a local node-pty session, a pre-#1475 shellper still running from
78
+ * before an upgrade, or a payload that failed validation) does it fall back to the
79
+ * Spec 1313 chain: the persisted `terminal_sessions.command`, then the legacy
80
+ * self-heal from config. So the stale-row hazard this comment used to describe — a
81
+ * user re-points `shell.architect` at a different harness while the row still names
82
+ * the old one — no longer decides the profile for a shellper-backed session; the
83
+ * running process does.
84
+ *
85
+ * The fallback tier keeps its original safety property, and it is worth knowing why
86
+ * it is thin: a stale command fails CLOSED rather than misdelivering only because
87
+ * CLAUDE_PROFILE and CODEX_PROFILE are behaviourally identical (same marker + region
88
+ * patterns) and any cross-family mismatch (e.g. agy's `> ` marker) fails the
89
+ * composer-marker test → not clean → held. That is a property of the current profile
90
+ * TABLE, not of the design. It matters less now that the authoritative tier exists,
91
+ * but it is still what protects the fallback the day codex/claude markers diverge.
83
92
  */
84
93
  export declare function resolveProfileForSession(session: DeliverySession): GateProfile | null;
85
94
  /**
@@ -108,16 +117,21 @@ export declare function classifyAgentScreen(session: DeliverySession, profile: G
108
117
  * A session with no mirror has produced no output and therefore cannot echo anything, so its
109
118
  * watch verifies `false` rather than passing.
110
119
  *
111
- * Known residuals, all of which fail in the SAFE direction (a redelivery, never a dropped
112
- * message), and none of which are designed around here:
120
+ * Known residuals — these are why a negative is "could not confirm", not "not delivered". Issue
121
+ * #1584: they are also why a negative must NOT trigger a redelivery. Each recurs for the same
122
+ * message on every attempt, so holding-and-rewriting on one of them is a loop that cannot
123
+ * converge — #1583 saw a message re-injected dozens of times on exactly the second one. The
124
+ * caller now commits the delivery and reports it unverified instead. None is designed around
125
+ * here; #1578 tracks smarter verification:
113
126
  * - a harness on the ALTERNATE screen buffer has no scrollback, so a message longer than one
114
127
  * viewport can scroll its header out of reach and never confirm. The agy profile boots into
115
128
  * the alternate buffer and was not measurable here (unauthenticated).
116
129
  * - a very long write can evict the pre-write copy from the 1000-line mirror, so the count
117
130
  * comes back equal rather than greater and a genuine delivery reads as unconfirmed.
118
131
  * - an unconfirmed delivery re-reads and re-normalizes the retained buffer once per poll
119
- * while the `afx send` request waits. Bounded by the timeout, and off the happy path
120
- * entirely — the measured case confirms on the first read.
132
+ * while the `afx send` request waits. Bounded by the timeout (and by the delivery path's
133
+ * two windows, ~1.2 s total), and off the happy path entirely — the measured case confirms
134
+ * on the first read.
121
135
  */
122
136
  export declare function watchEchoOnScreen(session: DeliverySession, needle: string): Promise<EchoWatch>;
123
137
  /**
@@ -127,6 +141,25 @@ export declare function watchEchoOnScreen(session: DeliverySession, needle: stri
127
141
  * serializer) lives in `mailbox-delivery.ts`, not here.
128
142
  */
129
143
  export declare function makeDeliveryPorts(log: LogFn): DeliveryPorts;
144
+ /**
145
+ * Human-readable notice body (metadata only — never the starved messages' contents).
146
+ *
147
+ * TWO notices, not one (Issue #1482). The old single body said "its composer never classifies
148
+ * as a ready prompt" and offered `afx interrupt` for every hold, which is wrong advice in the
149
+ * commonest case: when the detail is `user-text` a human is sitting at that composer with a
150
+ * draft, and interrupting them is the last thing the owner should do. The gate has always
151
+ * known which case it is; now the row carries it, so the notice can say it.
152
+ *
153
+ * The `streak` — how many consecutive gate checks re-confirmed the same verdict — is what
154
+ * separates "held ~7m" (which could be one unlucky sample) from "held ~7m, re-confirmed across
155
+ * 41 checks" (which cannot be).
156
+ *
157
+ * Exported for unit testing. This text is operator-facing INSTRUCTIONS during an incident, and
158
+ * it went un-asserted long enough to ship a remedy line naming `afx interrupt` at a composer a
159
+ * human was actively typing in. Prose that tells someone what to do to a live terminal is
160
+ * behaviour, and gets tested like behaviour.
161
+ */
162
+ export declare function formatOwnerNoticeBody(info: HeldOwnerNoticeInfo): string;
130
163
  /**
131
164
  * Start the mailbox drainer (replaces `startSendBuffer`). Called once on Tower boot:
132
165
  * prunes terminal rows, begins the periodic held-row backstop that redelivers on the
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox-wiring.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/servers/mailbox-wiring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAKzF,OAAO,EAA+B,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAYnG,OAAO,EACL,cAAc,EAEd,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,eAAe,EAKrB,MAAM,uBAAuB,CAAC;AAa/B,KAAK,KAAK,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAEzE;;;;;;;;;GASG;AACH,KAAK,kBAAkB,GAAG,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,CAAC;AAGzG,wFAAwF;AACxF,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,kBAAkB,GAAG,IAAI,CAElE;AAWD;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAQpG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,GAChB;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CASnD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBA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I,cAAc,CAElD"}
@@ -23,6 +23,7 @@ import { buildContextFsPort, harnessFromLaunchScript, } from '../commands/reset/
23
23
  import { getGlobalDb } from '../db/index.js';
24
24
  import { getArchitectByName } from '../state.js';
25
25
  import { formatBuilderMessage } from '../utils/message-format.js';
26
+ import { formatVerdict } from '@cluesmith/codev-sdk/hold-verdict';
26
27
  import { supersede as supersedeMailbox, dismissHeldWithKey, NOTICE_SUPERSEDE_PREFIX } from '../db/mailbox.js';
27
28
  import path from 'node:path';
28
29
  import { MailboxDrainer, normalizeForEcho, } from './mailbox-delivery.js';
@@ -103,16 +104,25 @@ export function resolveAgentForSession(sessionId) {
103
104
  * (fail-safe by construction: an unknown agent is held and surfaced, never guessed
104
105
  * — this is what correctly trips on wrapper/boot/relaunch screens too).
105
106
  *
106
- * Stale-identity note (Spec 1313): `session.command` is now sourced from the
107
- * persisted `terminal_sessions.command` on reconnect. If it ever goes stale (a
108
- * user re-points `shell.architect` at a different harness and the shellper later
109
- * auto-restarts into it while the row still names the old one), this can resolve
110
- * the WRONG profile — but it fails CLOSED today, not misdelivered: CLAUDE_PROFILE
111
- * and CODEX_PROFILE are behaviourally identical (same marker + region patterns),
112
- * and any cross-family mismatch (e.g. agy's `> ` marker) fails the composer-marker
113
- * test → not clean → held. That safety is a property of the current profile TABLE,
114
- * not of this design; the day codex/claude markers diverge, stale identity becomes
115
- * a live bug and the authoritative fix is WELCOME-frame hydration (see review).
107
+ * Identity precedence (PIR #1475): `session.command` is AUTHORITATIVE where it can
108
+ * be — it reads through to the identity the attached shellper states in its WELCOME
109
+ * frame, i.e. the argv the process that owns the PTY actually spawned, refreshed
110
+ * across reconnects and SPAWN relaunches. Only when no shellper identity is
111
+ * available (a local node-pty session, a pre-#1475 shellper still running from
112
+ * before an upgrade, or a payload that failed validation) does it fall back to the
113
+ * Spec 1313 chain: the persisted `terminal_sessions.command`, then the legacy
114
+ * self-heal from config. So the stale-row hazard this comment used to describe — a
115
+ * user re-points `shell.architect` at a different harness while the row still names
116
+ * the old one — no longer decides the profile for a shellper-backed session; the
117
+ * running process does.
118
+ *
119
+ * The fallback tier keeps its original safety property, and it is worth knowing why
120
+ * it is thin: a stale command fails CLOSED rather than misdelivering only because
121
+ * CLAUDE_PROFILE and CODEX_PROFILE are behaviourally identical (same marker + region
122
+ * patterns) and any cross-family mismatch (e.g. agy's `> ` marker) fails the
123
+ * composer-marker test → not clean → held. That is a property of the current profile
124
+ * TABLE, not of the design. It matters less now that the authoritative tier exists,
125
+ * but it is still what protects the fallback the day codex/claude markers diverge.
116
126
  */
117
127
  export function resolveProfileForSession(session) {
118
128
  const direct = resolveProfile({ command: session.command, args: session.launchArgs });
@@ -155,6 +165,11 @@ export async function classifyAgentScreen(session, profile) {
155
165
  * therefore slack for a loaded machine, not the expected cost — the common case returns on the
156
166
  * first read with no added latency. It is bounded because the `afx send` request path awaits
157
167
  * this before answering the sender.
168
+ *
169
+ * Issue #1584: the delivery path calls `verify()` at most TWICE (a second window for a slow
170
+ * renderer, no bytes written), so this constant is half the worst-case wait a sender sees —
171
+ * ~1.2 s. Raising it raises that, and the answer is no longer a retry decision: an unconfirmed
172
+ * delivery is recorded as delivered-unverified, never re-written.
158
173
  */
159
174
  const ECHO_VERIFY_TIMEOUT_MS = 600;
160
175
  const ECHO_VERIFY_POLL_MS = 50;
@@ -188,16 +203,21 @@ async function countEchoOnScreen(screen, needle) {
188
203
  * A session with no mirror has produced no output and therefore cannot echo anything, so its
189
204
  * watch verifies `false` rather than passing.
190
205
  *
191
- * Known residuals, all of which fail in the SAFE direction (a redelivery, never a dropped
192
- * message), and none of which are designed around here:
206
+ * Known residuals — these are why a negative is "could not confirm", not "not delivered". Issue
207
+ * #1584: they are also why a negative must NOT trigger a redelivery. Each recurs for the same
208
+ * message on every attempt, so holding-and-rewriting on one of them is a loop that cannot
209
+ * converge — #1583 saw a message re-injected dozens of times on exactly the second one. The
210
+ * caller now commits the delivery and reports it unverified instead. None is designed around
211
+ * here; #1578 tracks smarter verification:
193
212
  * - a harness on the ALTERNATE screen buffer has no scrollback, so a message longer than one
194
213
  * viewport can scroll its header out of reach and never confirm. The agy profile boots into
195
214
  * the alternate buffer and was not measurable here (unauthenticated).
196
215
  * - a very long write can evict the pre-write copy from the 1000-line mirror, so the count
197
216
  * comes back equal rather than greater and a genuine delivery reads as unconfirmed.
198
217
  * - an unconfirmed delivery re-reads and re-normalizes the retained buffer once per poll
199
- * while the `afx send` request waits. Bounded by the timeout, and off the happy path
200
- * entirely — the measured case confirms on the first read.
218
+ * while the `afx send` request waits. Bounded by the timeout (and by the delivery path's
219
+ * two windows, ~1.2 s total), and off the happy path entirely — the measured case confirms
220
+ * on the first read.
201
221
  */
202
222
  export async function watchEchoOnScreen(session, needle) {
203
223
  const screen = session.gateScreen;
@@ -245,15 +265,19 @@ export function makeDeliveryPorts(log) {
245
265
  // module's, re-run inside that lock.
246
266
  writeMessage: (session, msg, noEnter, precheck) => submitMessagePaced(session, msg, noEnter, precheck),
247
267
  // Issue #1573: the only end-to-end evidence that the bytes reached the terminal — opened
248
- // before the write, consulted before the row is marked delivered.
268
+ // before the write. Issue #1584: consulted AFTER the row is marked delivered, because the
269
+ // commit is what makes a completed write un-repeatable; this only decides what we report.
249
270
  watchEcho: (session, needle) => watchEchoOnScreen(session, needle),
250
271
  broadcast: (frame) => broadcastDelivered(frame),
251
272
  onHeldStateChange: () => broadcastHeldStateChange(),
252
273
  onEscalation: (info) => broadcastEscalation(info),
253
274
  onLiveness: (info) => surfaceLiveness(info, log),
275
+ // Issue #1584: an unconfirmed delivery is committed, not retried, so this notice is the
276
+ // only human-facing trace for a cron/backstop send with no sender waiting on a response.
277
+ onUnverifiedDelivery: (info) => surfaceUnverifiedDelivery(info),
254
278
  escalateHeldToOwner: (info) => escalateHeldToOwner(info, log),
255
279
  clearHeldOwnerNotice: (ws, agent) => clearHeldOwnerNotice(ws, agent),
256
- log: (m) => log('INFO', m),
280
+ log: (m, level) => log(level ?? 'INFO', m),
257
281
  now: () => Date.now(),
258
282
  };
259
283
  }
@@ -263,13 +287,58 @@ const NOTICE_SENDER = 'af-mailbox';
263
287
  function noticeSupersedeKey(toAgent) {
264
288
  return `${NOTICE_SUPERSEDE_PREFIX}${toAgent}`;
265
289
  }
266
- /** Human-readable notice body (metadata only — never the starved messages' contents). */
267
- function formatOwnerNoticeBody(info) {
290
+ /**
291
+ * Human-readable notice body (metadata only — never the starved messages' contents).
292
+ *
293
+ * TWO notices, not one (Issue #1482). The old single body said "its composer never classifies
294
+ * as a ready prompt" and offered `afx interrupt` for every hold, which is wrong advice in the
295
+ * commonest case: when the detail is `user-text` a human is sitting at that composer with a
296
+ * draft, and interrupting them is the last thing the owner should do. The gate has always
297
+ * known which case it is; now the row carries it, so the notice can say it.
298
+ *
299
+ * The `streak` — how many consecutive gate checks re-confirmed the same verdict — is what
300
+ * separates "held ~7m" (which could be one unlucky sample) from "held ~7m, re-confirmed across
301
+ * 41 checks" (which cannot be).
302
+ *
303
+ * Exported for unit testing. This text is operator-facing INSTRUCTIONS during an incident, and
304
+ * it went un-asserted long enough to ship a remedy line naming `afx interrupt` at a composer a
305
+ * human was actively typing in. Prose that tells someone what to do to a live terminal is
306
+ * behaviour, and gets tested like behaviour.
307
+ */
308
+ export function formatOwnerNoticeBody(info) {
268
309
  const mins = Math.max(1, Math.round(info.ageMs / 60_000));
269
310
  const plural = info.heldCount === 1 ? 'message' : 'messages';
270
- return (`Mailbox delivery is STUCK for builder '${info.toAgent}' @ ${path.basename(info.workspacePath)}. ` +
271
- `${info.heldCount} ${plural} held ~${mins}m (reason: ${info.reason ?? 'held'}) — its composer never classifies as a ready prompt, ` +
272
- `so nothing is being delivered (cron nudges included). ` +
311
+ const confirmed = info.streak > 1 ? `, re-confirmed across ${info.streak} consecutive gate checks` : '';
312
+ const head = `Mailbox delivery is STUCK for builder '${info.toAgent}' @ ${path.basename(info.workspacePath)}. ` +
313
+ `${info.heldCount} ${plural} held ~${mins}m (${formatVerdict(info.reason, info.detail)}${confirmed}).`;
314
+ if (info.detail === 'user-text') {
315
+ // The SAFE hold: the classifier positively identified a draft or menu in the composer.
316
+ //
317
+ // This branch names NO command that touches the terminal, deliberately — not even hedged
318
+ // with "only if you are sure". An operator reading a notice headed "delivery is STUCK"
319
+ // treats the remedy line as the instruction, and the person at that composer is mid-thought
320
+ // by definition of this verdict. The #1583 loop was aggravated by exactly that: an operator
321
+ // followed an `afx interrupt` suggestion out of this notice. A hedge is not a safeguard
322
+ // when the surrounding text reads as an incident.
323
+ return (`${head} Its composer has been OCCUPIED that whole time — a draft or an open menu is on ` +
324
+ `the line, which usually means a human is working there, and delivery resumes by itself ` +
325
+ `the moment the line clears. ` +
326
+ `Remedy: usually none — let it clear. 'afx inbox' inspects the queue (metadata only, ` +
327
+ `never bodies) if you want to see what is waiting, and talking to whoever is at that ` +
328
+ `terminal is the only other thing worth doing.`);
329
+ }
330
+ if (info.detail || info.reason === 'no-profile') {
331
+ // The DEFECT class: the gate could not verify the composer at all, so nothing will clear
332
+ // this without intervention.
333
+ return (`${head} The render gate CANNOT VERIFY that composer — this is not a busy human, it is a ` +
334
+ `classifier that cannot find a bounded composer region, so the mail will never deliver on ` +
335
+ `its own. Usual causes: a drifted TUI profile, a torn/mid-repaint frame, or Tower's ` +
336
+ `terminal dimensions diverging from the real PTY (Issue #1482). ` +
337
+ `Remedy: 'afx inbox' to inspect; resizing the viewer forces a repaint; ` +
338
+ `'afx interrupt ${info.toAgent}' clears a stuck composer.`);
339
+ }
340
+ return (`${head} Its composer never classifies as a ready prompt, so nothing is being delivered ` +
341
+ `(cron nudges included). ` +
273
342
  `Remedy: run 'afx inbox' to inspect; 'afx interrupt ${info.toAgent}' clears a stuck composer.`);
274
343
  }
275
344
  /**
@@ -312,7 +381,8 @@ function escalateHeldToOwner(info, log) {
312
381
  // Deliver the notice promptly through the SAME gate (it holds if the architect is busy).
313
382
  void ensureDrainer().scheduleDrain(owner.workspacePath, owner.agent);
314
383
  log('WARN', `[mailbox] STARVATION notice → ${owner.agent} about ${info.toAgent} @ ${path.basename(info.workspacePath)} ` +
315
- `(${info.heldCount} held ~${Math.round(info.ageMs / 1000)}s, reason ${info.reason ?? 'held'})`);
384
+ `(${info.heldCount} held ~${Math.round(info.ageMs / 1000)}s, ${formatVerdict(info.reason, info.detail)}` +
385
+ `${info.streak > 1 ? `, streak ${info.streak}` : ''})`);
316
386
  return true;
317
387
  }
318
388
  /**
@@ -351,6 +421,10 @@ function broadcastEscalation(info) {
351
421
  mailboxId: info.mailboxId,
352
422
  ageMs: info.ageMs,
353
423
  reason: info.reason,
424
+ // Issue #1482: a client showing only `busy` cannot tell an occupied composer from one the
425
+ // gate could not read. The wire is additive — an older client that ignores the field is
426
+ // unaffected — but the TYPE is required, so this producer cannot forget it.
427
+ detail: info.detail,
354
428
  };
355
429
  mailboxBroadcaster?.({
356
430
  type: 'mailbox-escalation',
@@ -384,6 +458,26 @@ function surfaceLiveness(info, log) {
384
458
  workspace: info.workspacePath,
385
459
  });
386
460
  }
461
+ /**
462
+ * Surface an unconfirmed delivery (Issue #1584) on the generic `notification` SSE channel that
463
+ * {@link surfaceLiveness} already uses — human title/body, no message body.
464
+ *
465
+ * Deliberately NOT the `mailbox-escalation` event: that one means "held past the escalation
466
+ * age", and saying that about a row we just delivered would be false. The wording here states
467
+ * exactly what is and is not known — the bytes went out, the screen never showed them, and it
468
+ * will not be sent again.
469
+ */
470
+ function surfaceUnverifiedDelivery(info) {
471
+ const where = `${info.toAgent} @ ${path.basename(info.workspacePath)}`;
472
+ mailboxBroadcaster?.({
473
+ type: 'notification',
474
+ title: 'Mailbox: delivered but not confirmed on screen',
475
+ body: `${where} — the message was written to terminal ${info.terminalId.slice(0, 8)}… and every byte was ` +
476
+ `accepted, but its header never appeared on that screen. It is recorded as delivered and will NOT ` +
477
+ `be sent again (mailbox id ${info.mailboxId.slice(0, 8)}…). Check the agent's transcript.`,
478
+ workspace: info.workspacePath,
479
+ });
480
+ }
387
481
  // The single backstop drainer instance (replaces the retired SendBuffer). Created
388
482
  // lazily so it picks up the configured retention window (below) at first use.
389
483
  let drainer;