botmux 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/dist/adapters/backend/sandbox.d.ts +23 -0
  2. package/dist/adapters/backend/sandbox.d.ts.map +1 -1
  3. package/dist/adapters/backend/sandbox.js +69 -4
  4. package/dist/adapters/backend/sandbox.js.map +1 -1
  5. package/dist/adapters/backend/tmux-backend.d.ts.map +1 -1
  6. package/dist/adapters/backend/tmux-backend.js +11 -1
  7. package/dist/adapters/backend/tmux-backend.js.map +1 -1
  8. package/dist/adapters/cli/read-isolation.d.ts +1 -1
  9. package/dist/adapters/cli/read-isolation.d.ts.map +1 -1
  10. package/dist/adapters/cli/read-isolation.js +15 -7
  11. package/dist/adapters/cli/read-isolation.js.map +1 -1
  12. package/dist/cli.d.ts.map +1 -1
  13. package/dist/cli.js +117 -25
  14. package/dist/cli.js.map +1 -1
  15. package/dist/core/command-handler.d.ts.map +1 -1
  16. package/dist/core/command-handler.js +154 -90
  17. package/dist/core/command-handler.js.map +1 -1
  18. package/dist/core/dashboard-ipc-server.d.ts +1 -0
  19. package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
  20. package/dist/core/dashboard-ipc-server.js +132 -0
  21. package/dist/core/dashboard-ipc-server.js.map +1 -1
  22. package/dist/core/maintenance.d.ts +23 -1
  23. package/dist/core/maintenance.d.ts.map +1 -1
  24. package/dist/core/maintenance.js +63 -25
  25. package/dist/core/maintenance.js.map +1 -1
  26. package/dist/core/plugins/cli-generation.d.ts.map +1 -1
  27. package/dist/core/plugins/cli-generation.js +7 -0
  28. package/dist/core/plugins/cli-generation.js.map +1 -1
  29. package/dist/core/plugins/convention-scanner.d.ts +3 -3
  30. package/dist/core/plugins/convention-scanner.d.ts.map +1 -1
  31. package/dist/core/plugins/convention-scanner.js.map +1 -1
  32. package/dist/core/plugins/install.d.ts.map +1 -1
  33. package/dist/core/plugins/install.js +84 -26
  34. package/dist/core/plugins/install.js.map +1 -1
  35. package/dist/core/plugins/mcp/environment.d.ts +12 -0
  36. package/dist/core/plugins/mcp/environment.d.ts.map +1 -0
  37. package/dist/core/plugins/mcp/environment.js +17 -0
  38. package/dist/core/plugins/mcp/environment.js.map +1 -0
  39. package/dist/core/plugins/mcp/gateway-installer.d.ts.map +1 -1
  40. package/dist/core/plugins/mcp/gateway-installer.js +9 -3
  41. package/dist/core/plugins/mcp/gateway-installer.js.map +1 -1
  42. package/dist/core/plugins/mcp/gateway.d.ts +13 -1
  43. package/dist/core/plugins/mcp/gateway.d.ts.map +1 -1
  44. package/dist/core/plugins/mcp/gateway.js +143 -23
  45. package/dist/core/plugins/mcp/gateway.js.map +1 -1
  46. package/dist/core/plugins/mcp/host.d.ts +18 -0
  47. package/dist/core/plugins/mcp/host.d.ts.map +1 -0
  48. package/dist/core/plugins/mcp/host.js +126 -0
  49. package/dist/core/plugins/mcp/host.js.map +1 -0
  50. package/dist/core/plugins/mcp/private-store.d.ts +15 -0
  51. package/dist/core/plugins/mcp/private-store.d.ts.map +1 -0
  52. package/dist/core/plugins/mcp/private-store.js +162 -0
  53. package/dist/core/plugins/mcp/private-store.js.map +1 -0
  54. package/dist/core/plugins/mcp/session-runtime.d.ts +25 -0
  55. package/dist/core/plugins/mcp/session-runtime.d.ts.map +1 -0
  56. package/dist/core/plugins/mcp/session-runtime.js +76 -0
  57. package/dist/core/plugins/mcp/session-runtime.js.map +1 -0
  58. package/dist/core/plugins/mcp/socket-auth.d.ts +9 -0
  59. package/dist/core/plugins/mcp/socket-auth.d.ts.map +1 -0
  60. package/dist/core/plugins/mcp/socket-auth.js +94 -0
  61. package/dist/core/plugins/mcp/socket-auth.js.map +1 -0
  62. package/dist/core/plugins/paths.d.ts +3 -0
  63. package/dist/core/plugins/paths.d.ts.map +1 -1
  64. package/dist/core/plugins/paths.js +9 -0
  65. package/dist/core/plugins/paths.js.map +1 -1
  66. package/dist/core/plugins/pm2.d.ts.map +1 -1
  67. package/dist/core/plugins/pm2.js +3 -1
  68. package/dist/core/plugins/pm2.js.map +1 -1
  69. package/dist/core/plugins/runtime.d.ts +2 -0
  70. package/dist/core/plugins/runtime.d.ts.map +1 -1
  71. package/dist/core/plugins/runtime.js.map +1 -1
  72. package/dist/core/plugins/service-manager.d.ts +22 -0
  73. package/dist/core/plugins/service-manager.d.ts.map +1 -1
  74. package/dist/core/plugins/service-manager.js +189 -52
  75. package/dist/core/plugins/service-manager.js.map +1 -1
  76. package/dist/core/plugins/types.d.ts +15 -1
  77. package/dist/core/plugins/types.d.ts.map +1 -1
  78. package/dist/core/restart-report.d.ts +1 -1
  79. package/dist/core/restart-report.d.ts.map +1 -1
  80. package/dist/core/restart-report.js +5 -3
  81. package/dist/core/restart-report.js.map +1 -1
  82. package/dist/core/scheduler.d.ts +47 -0
  83. package/dist/core/scheduler.d.ts.map +1 -1
  84. package/dist/core/scheduler.js +117 -0
  85. package/dist/core/scheduler.js.map +1 -1
  86. package/dist/core/session-manager.d.ts +7 -0
  87. package/dist/core/session-manager.d.ts.map +1 -1
  88. package/dist/core/session-manager.js +130 -33
  89. package/dist/core/session-manager.js.map +1 -1
  90. package/dist/core/session-marker.d.ts.map +1 -1
  91. package/dist/core/session-marker.js +5 -2
  92. package/dist/core/session-marker.js.map +1 -1
  93. package/dist/core/silent-schedule-turns.d.ts +5 -0
  94. package/dist/core/silent-schedule-turns.d.ts.map +1 -0
  95. package/dist/core/silent-schedule-turns.js +47 -0
  96. package/dist/core/silent-schedule-turns.js.map +1 -0
  97. package/dist/core/types.d.ts +54 -0
  98. package/dist/core/types.d.ts.map +1 -1
  99. package/dist/core/types.js +55 -0
  100. package/dist/core/types.js.map +1 -1
  101. package/dist/core/update-check.d.ts +16 -0
  102. package/dist/core/update-check.d.ts.map +1 -1
  103. package/dist/core/update-check.js +52 -0
  104. package/dist/core/update-check.js.map +1 -1
  105. package/dist/core/worker-pool.d.ts.map +1 -1
  106. package/dist/core/worker-pool.js +40 -31
  107. package/dist/core/worker-pool.js.map +1 -1
  108. package/dist/daemon.d.ts.map +1 -1
  109. package/dist/daemon.js +90 -9
  110. package/dist/daemon.js.map +1 -1
  111. package/dist/dashboard/schedule-card-model.d.ts +3 -0
  112. package/dist/dashboard/schedule-card-model.d.ts.map +1 -1
  113. package/dist/dashboard/schedule-card-model.js +5 -0
  114. package/dist/dashboard/schedule-card-model.js.map +1 -1
  115. package/dist/dashboard/web/app.d.ts.map +1 -1
  116. package/dist/dashboard/web/app.js +295 -6
  117. package/dist/dashboard/web/app.js.map +1 -1
  118. package/dist/dashboard/web/i18n.d.ts.map +1 -1
  119. package/dist/dashboard/web/i18n.js +92 -0
  120. package/dist/dashboard/web/i18n.js.map +1 -1
  121. package/dist/dashboard/web/plugin-page.d.ts.map +1 -1
  122. package/dist/dashboard/web/plugin-page.js +1 -3
  123. package/dist/dashboard/web/plugin-page.js.map +1 -1
  124. package/dist/dashboard/web/schedules-page.d.ts.map +1 -1
  125. package/dist/dashboard/web/schedules-page.js +111 -4
  126. package/dist/dashboard/web/schedules-page.js.map +1 -1
  127. package/dist/dashboard/web/settings-page.d.ts.map +1 -1
  128. package/dist/dashboard/web/settings-page.js +5 -1
  129. package/dist/dashboard/web/settings-page.js.map +1 -1
  130. package/dist/dashboard/web/update-action.d.ts +16 -0
  131. package/dist/dashboard/web/update-action.d.ts.map +1 -0
  132. package/dist/dashboard/web/update-action.js +64 -0
  133. package/dist/dashboard/web/update-action.js.map +1 -0
  134. package/dist/dashboard-web/app.js +1 -1
  135. package/dist/dashboard-web/chunks/{bot-defaults-page-KLDCZNLP.js → bot-defaults-page-4PM4T6QQ.js} +1 -1
  136. package/dist/dashboard-web/chunks/{chunk-FMJNOATE.js → chunk-3PMN55Z6.js} +1 -1
  137. package/dist/dashboard-web/chunks/{chunk-MLNI5BKE.js → chunk-AIDN2WZB.js} +1 -1
  138. package/dist/dashboard-web/chunks/{chunk-EZAW2EPM.js → chunk-IKCZ677K.js} +1 -1
  139. package/dist/dashboard-web/chunks/{chunk-KEAOTUL3.js → chunk-RXVA6XW3.js} +7 -7
  140. package/dist/dashboard-web/chunks/{connectors-page-O32LFAL5.js → connectors-page-2MKF4YTN.js} +1 -1
  141. package/dist/dashboard-web/chunks/{groups-page-PSAFIZ6M.js → groups-page-TAU2UIVS.js} +1 -1
  142. package/dist/dashboard-web/chunks/{insights-page-V23LLATX.js → insights-page-PJ2XVM6T.js} +1 -1
  143. package/dist/dashboard-web/chunks/{monitor-room-7X5AKYOF.js → monitor-room-D6445HJO.js} +1 -1
  144. package/dist/dashboard-web/chunks/{monitoring-page-CBA3CQYL.js → monitoring-page-GUHMCKSO.js} +1 -1
  145. package/dist/dashboard-web/chunks/{office-page-RL6QSEM7.js → office-page-6K6U2MS5.js} +1 -1
  146. package/dist/dashboard-web/chunks/{overview-page-XQIPO6KH.js → overview-page-USDYU7U5.js} +1 -1
  147. package/dist/dashboard-web/chunks/plugin-page-JXC5F5YV.js +1 -0
  148. package/dist/dashboard-web/chunks/{roles-page-ACIWV7QS.js → roles-page-O4OUA7ZH.js} +1 -1
  149. package/dist/dashboard-web/chunks/schedules-page-LNIBXJSZ.js +1 -0
  150. package/dist/dashboard-web/chunks/{sessions-page-2WDWHSP4.js → sessions-page-B6U6TCFF.js} +1 -1
  151. package/dist/dashboard-web/chunks/{settings-page-6VX4OUGG.js → settings-page-PXLRFF7I.js} +2 -2
  152. package/dist/dashboard-web/chunks/{skills-page-WXE3UYLT.js → skills-page-M5KYNXBA.js} +1 -1
  153. package/dist/dashboard-web/chunks/{team-federation-page-PYTF4FLM.js → team-federation-page-GT7UFQMN.js} +1 -1
  154. package/dist/dashboard-web/chunks/{v3-page-G6CD6O3I.js → v3-page-UYZIRJ2C.js} +1 -1
  155. package/dist/dashboard-web/chunks/{whiteboards-page-6SG33GP4.js → whiteboards-page-WAR77DQE.js} +1 -1
  156. package/dist/dashboard-web/style.css +697 -0
  157. package/dist/dashboard.js +404 -29
  158. package/dist/dashboard.js.map +1 -1
  159. package/dist/i18n/en.d.ts.map +1 -1
  160. package/dist/i18n/en.js +5 -0
  161. package/dist/i18n/en.js.map +1 -1
  162. package/dist/i18n/zh.d.ts.map +1 -1
  163. package/dist/i18n/zh.js +5 -0
  164. package/dist/i18n/zh.js.map +1 -1
  165. package/dist/im/lark/card-handler.d.ts +2 -0
  166. package/dist/im/lark/card-handler.d.ts.map +1 -1
  167. package/dist/im/lark/card-handler.js +219 -139
  168. package/dist/im/lark/card-handler.js.map +1 -1
  169. package/dist/im/lark/schedules-card.d.ts.map +1 -1
  170. package/dist/im/lark/schedules-card.js +2 -0
  171. package/dist/im/lark/schedules-card.js.map +1 -1
  172. package/dist/services/plugin-registry-store.d.ts.map +1 -1
  173. package/dist/services/plugin-registry-store.js +100 -18
  174. package/dist/services/plugin-registry-store.js.map +1 -1
  175. package/dist/services/restart-intent-store.d.ts +17 -2
  176. package/dist/services/restart-intent-store.d.ts.map +1 -1
  177. package/dist/services/restart-intent-store.js +110 -0
  178. package/dist/services/restart-intent-store.js.map +1 -1
  179. package/dist/services/schedule-store.d.ts +3 -1
  180. package/dist/services/schedule-store.d.ts.map +1 -1
  181. package/dist/services/schedule-store.js +5 -0
  182. package/dist/services/schedule-store.js.map +1 -1
  183. package/dist/skills/definitions.d.ts.map +1 -1
  184. package/dist/skills/definitions.js +3 -2
  185. package/dist/skills/definitions.js.map +1 -1
  186. package/dist/types.d.ts +18 -0
  187. package/dist/types.d.ts.map +1 -1
  188. package/dist/utils/child-env.d.ts +9 -1
  189. package/dist/utils/child-env.d.ts.map +1 -1
  190. package/dist/utils/child-env.js +24 -0
  191. package/dist/utils/child-env.js.map +1 -1
  192. package/dist/utils/global-install.d.ts +2 -0
  193. package/dist/utils/global-install.d.ts.map +1 -1
  194. package/dist/utils/global-install.js +14 -0
  195. package/dist/utils/global-install.js.map +1 -1
  196. package/dist/worker.js +135 -18
  197. package/dist/worker.js.map +1 -1
  198. package/dist/workflows/hostExecutors/botmux-schedule.d.ts +3 -0
  199. package/dist/workflows/hostExecutors/botmux-schedule.d.ts.map +1 -1
  200. package/dist/workflows/hostExecutors/botmux-schedule.js +9 -0
  201. package/dist/workflows/hostExecutors/botmux-schedule.js.map +1 -1
  202. package/package.json +1 -1
  203. package/dist/dashboard-web/chunks/plugin-page-7FW2LPJH.js +0 -1
  204. package/dist/dashboard-web/chunks/schedules-page-KJDUKOJV.js +0 -1
@@ -76,6 +76,7 @@ import { finishVcMeetingImReply, prepareVcMeetingDeliveryReply, prepareVcMeeting
76
76
  import { neutralizeLarkAtTags } from '../services/send-policy.js';
77
77
  import { recordVcMeetingListenerMessage } from '../services/vc-meeting-listener-message-store.js';
78
78
  import { isLocalCliOpenEnabled, isLocalCliOpenReady } from '../services/local-cli-opener.js';
79
+ import { isSilentScheduledTurn } from './silent-schedule-turns.js';
79
80
  const __filename = fileURLToPath(import.meta.url);
80
81
  const __dirname = dirname(__filename);
81
82
  const WORKER_SIGTERM_BACKSTOP_MS = 2_000;
@@ -1657,14 +1658,12 @@ export function forkWorker(ds, promptInput, resumeOrTurnId = false) {
1657
1658
  else {
1658
1659
  resume = resumeOrTurnId;
1659
1660
  }
1660
- // An empty prompt is a pure worker reattach/restore, not a newly accepted
1661
- // user turn. Never inherit the previous reply target in that case: doing so
1662
- // would re-publish stale per-turn authority (notably an explicit meeting IM
1663
- // origin) into a fresh worker lifetime after a daemon restart. Non-empty
1664
- // prompts keep the historical fallback for callers that accepted a turn
1665
- // before they learned to pass its id explicitly.
1666
- const initAttributionTurnId = initTurnId
1667
- ?? (prompt.length > 0 ? ds.currentReplyTarget?.turnId : undefined);
1661
+ // Per-turn authority is never inferred from mutable session state. Human
1662
+ // message routes pass their accepted Lark message id explicitly; restore,
1663
+ // scheduler, card retry and other system starts stay unattributed. Falling
1664
+ // back to currentReplyTarget here would let a later system prompt reuse an
1665
+ // older human turn after a worker replacement.
1666
+ const initAttributionTurnId = initTurnId;
1668
1667
  // A fork() whose cwd no longer exists emits an unhandled 'error' (spawn
1669
1668
  // ENOENT) that crashes the WHOLE daemon (→ pm2 crash-loop). Fall back to
1670
1669
  // home so a stale session workingDir can never take the daemon down.
@@ -1780,7 +1779,9 @@ export function forkWorker(ds, promptInput, resumeOrTurnId = false) {
1780
1779
  },
1781
1780
  });
1782
1781
  const startupState = {
1783
- ready: false, failureNotified: false, initTurnId, initDispatchAttempt,
1782
+ ready: false, failureNotified: false,
1783
+ initTurnId: initAttributionTurnId,
1784
+ initDispatchAttempt,
1784
1785
  };
1785
1786
  // A fork-level failure (spawn ENOENT, etc.) emits 'error'; without a handler
1786
1787
  // the unhandled event crashes the daemon. It also happens before worker IPC
@@ -1791,21 +1792,21 @@ export function forkWorker(ds, promptInput, resumeOrTurnId = false) {
1791
1792
  if (startupState.failureNotified)
1792
1793
  return;
1793
1794
  startupState.failureNotified = true;
1794
- // A dedicated VC receiver has no auxiliary Lark output channel. Durable
1795
- // failures stay on the receipt/lease chain, and exact IM turns may only
1796
- // produce their ledgered final reply — never a fork diagnostic.
1797
- if (ds.session.vcMeetingReceiver) {
1798
- logger.info(`[${t}] VC receiver fork failure kept out of auxiliary Lark UI `
1799
- + `turn=${initTurnId?.slice(0, 12) ?? '-'} attempt=${initDispatchAttempt}: ${reason}`);
1800
- return;
1801
- }
1802
- const cliName = getCliDisplayName(agentCfg.cliId);
1803
- const message = tr('worker.start_failed', { cliName, reason }, botLocale(botCfg));
1804
1795
  emitSessionLifecycleHook(ds, 'session.requires_attention', {
1805
1796
  reason: 'worker_fork_error',
1806
1797
  message: reason,
1807
1798
  });
1808
- void cb.sessionReply(sessionAnchorId(ds), message, 'text', ds.larkAppId, fallbackTurnId(ds, initTurnId), ds.session.vcMeetingReceiver
1799
+ // A dedicated VC receiver and a silent schedule have no auxiliary Lark
1800
+ // output channel. Keep lifecycle/dashboard state above, but never leak a
1801
+ // fork diagnostic into the chat.
1802
+ if (ds.session.vcMeetingReceiver || isSilentScheduledTurn(ds, initAttributionTurnId)) {
1803
+ logger.info(`[${t}] Managed/silent fork failure kept out of auxiliary Lark UI `
1804
+ + `turn=${initAttributionTurnId?.slice(0, 12) ?? '-'} attempt=${initDispatchAttempt}: ${reason}`);
1805
+ return;
1806
+ }
1807
+ const cliName = getCliDisplayName(agentCfg.cliId);
1808
+ const message = tr('worker.start_failed', { cliName, reason }, botLocale(botCfg));
1809
+ void cb.sessionReply(sessionAnchorId(ds), message, 'text', ds.larkAppId, fallbackTurnId(ds, initAttributionTurnId), ds.session.vcMeetingReceiver
1809
1810
  ? { sourceSessionId: ds.session.sessionId }
1810
1811
  : undefined).catch(replyErr => logger.error(`[${t}] Failed to deliver worker fork error to Lark: ${replyErr}`));
1811
1812
  });
@@ -1976,6 +1977,8 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
1976
1977
  /** Auxiliary worker UI is never an authorized output channel for a dedicated
1977
1978
  * VC receiver. Dashboard/audit state is still updated before these guards. */
1978
1979
  const managedAuxUiSuppressed = (turnId, dispatchAttempt) => {
1980
+ if (isSilentScheduledTurn(ds, turnId))
1981
+ return true;
1979
1982
  if (ds.session.vcMeetingReceiver)
1980
1983
  return true;
1981
1984
  return ordinaryManagedSuppression(turnId, dispatchAttempt);
@@ -1983,6 +1986,8 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
1983
1986
  /** final_output is the sole exception: listener_thread and exact IM replies
1984
1987
  * may proceed into the durable action ledger; silent/stale attempts do not. */
1985
1988
  const managedFinalOutputSuppressed = (turnId, dispatchAttempt) => {
1989
+ if (isSilentScheduledTurn(ds, turnId))
1990
+ return true;
1986
1991
  if (!ds.session.vcMeetingReceiver) {
1987
1992
  return ordinaryManagedSuppression(turnId, dispatchAttempt);
1988
1993
  }
@@ -2007,22 +2012,22 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
2007
2012
  if (startupState.failureNotified)
2008
2013
  return;
2009
2014
  startupState.failureNotified = true;
2015
+ emitSessionLifecycleHook(ds, 'session.requires_attention', {
2016
+ reason: 'worker_start_failed',
2017
+ message: reason,
2018
+ });
2010
2019
  // A durable VC meeting delivery attempt must not surface its startup/relaunch
2011
2020
  // failure out-of-band. The worker-generation exit is fenced to the receipt
2012
2021
  // (marked ambiguous and retried under the side-effect boundary); a direct
2013
2022
  // sessionReply here would bypass that and could post on a silent delivery.
2014
2023
  // Ordinary IM turns and non-receiver sessions still notify exactly once.
2015
2024
  if (managedAuxUiSuppressed(turnId, dispatchAttempt)) {
2016
- logger.info(`[${t}] VC receiver startup failure kept out of auxiliary Lark UI `
2025
+ logger.info(`[${t}] Managed/silent startup failure kept out of auxiliary Lark UI `
2017
2026
  + `turn=${turnId?.slice(0, 12) ?? '-'} attempt=${dispatchAttempt}: ${reason}`);
2018
2027
  return;
2019
2028
  }
2020
2029
  const cliName = getCliDisplayName(sessionCliId(ds, botCfg));
2021
2030
  const message = tr('worker.start_failed', { cliName, reason }, loc);
2022
- emitSessionLifecycleHook(ds, 'session.requires_attention', {
2023
- reason: 'worker_start_failed',
2024
- message: reason,
2025
- });
2026
2031
  try {
2027
2032
  await scopedReply(message, 'text', turnId);
2028
2033
  }
@@ -2068,7 +2073,7 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
2068
2073
  void deliverSubstituteControlCard(ds);
2069
2074
  }
2070
2075
  if (managedAuxUiSuppressed(msg.turnId, msg.dispatchAttempt)) {
2071
- logger.info(`[${t}] Managed VC receiver — suppressing ready/streaming card output`);
2076
+ logger.info(`[${t}] Managed/silent turn — suppressing ready/streaming card output`);
2072
2077
  break;
2073
2078
  }
2074
2079
  // Bot opted out of the streaming card: the terminal is up and the
@@ -2240,6 +2245,8 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
2240
2245
  if (ds.pendingRawInput && ds.worker && !ds.worker.killed) {
2241
2246
  const rawInput = ds.pendingRawInput;
2242
2247
  ds.pendingRawInput = undefined;
2248
+ const rawTurnId = ds.pendingRawTurnId;
2249
+ ds.pendingRawTurnId = undefined;
2243
2250
  // Input buffered while the repo card was pending rides on the SAME
2244
2251
  // IPC: worker message handlers run concurrently (async handlers
2245
2252
  // don't serialize), so a separate `message` IPC could write into
@@ -2253,7 +2260,9 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
2253
2260
  ds.worker.send({
2254
2261
  type: 'raw_input',
2255
2262
  content: rawInput,
2263
+ ...(rawTurnId ? { turnId: rawTurnId } : {}),
2256
2264
  followUpContent: followUp?.cliInput,
2265
+ ...(followUp?.turnId ? { followUpTurnId: followUp.turnId } : {}),
2257
2266
  ...(followUpCodexAppInput ? { followUpCodexAppInput } : {}),
2258
2267
  });
2259
2268
  logger.info(`[${t}] Sent pending raw input after prompt_ready: ${rawInput.substring(0, 80)}${followUp ? ` (+follow-up ${followUp.cliInput.length} chars)` : ''}`);
@@ -2277,7 +2286,7 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
2277
2286
  // is known, so consumers exclude this session from native parsers
2278
2287
  // before its first positive-delta record exists.
2279
2288
  recordOwnershipForDaemonSession(ds);
2280
- if (!managedAuxUiSuppressed()
2289
+ if (!managedAuxUiSuppressed(msg.turnId, msg.dispatchAttempt)
2281
2290
  && !wasLocalCliOpenReady
2282
2291
  && isLocalCliOpenReady(ds, { cliId: effectiveCliId })) {
2283
2292
  scheduleLocalCliOpenReadinessPatch(ds);
@@ -2419,7 +2428,7 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
2419
2428
  content: ds.lastScreenContent ?? '',
2420
2429
  });
2421
2430
  persistStreamCardState(ds);
2422
- if (managedAuxUiSuppressed())
2431
+ if (managedAuxUiSuppressed(msg.turnId, msg.dispatchAttempt))
2423
2432
  break;
2424
2433
  if ((ds.displayMode ?? 'hidden') !== 'screenshot')
2425
2434
  break;
@@ -2459,7 +2468,7 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
2459
2468
  // would temporarily overwrite a user-issued /rename until refresh.
2460
2469
  ds.currentTurnTitle = msg.description;
2461
2470
  if (managedAuxUiSuppressed(msg.turnId, msg.dispatchAttempt)) {
2462
- logger.info(`[${t}] Managed VC receiver — TUI prompt kept in dashboard/audit only`);
2471
+ logger.info(`[${t}] Managed/silent turn — TUI prompt kept in dashboard/audit only`);
2463
2472
  break;
2464
2473
  }
2465
2474
  try {
@@ -2476,7 +2485,7 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
2476
2485
  case 'tui_prompt_resolved': {
2477
2486
  // TUI prompt is no longer showing — update card if it exists
2478
2487
  logger.info(`[${t}] TUI prompt resolved${msg.selectedText ? `: ${msg.selectedText}` : ''}`);
2479
- if (managedAuxUiSuppressed()) {
2488
+ if (managedAuxUiSuppressed(msg.turnId, msg.dispatchAttempt)) {
2480
2489
  ds.tuiPromptCardId = undefined;
2481
2490
  ds.tuiPromptOptions = undefined;
2482
2491
  break;
@@ -2632,7 +2641,7 @@ function setupWorkerHandlers(ds, worker, startupState = { ready: false, failureN
2632
2641
  });
2633
2642
  // Refresh the live streaming card (writable/AIO link) — parks a pending
2634
2643
  // flag when the card POST is still in-flight and flushes once it lands.
2635
- if (!managedAuxUiSuppressed())
2644
+ if (!managedAuxUiSuppressed(msg.turnId, msg.dispatchAttempt))
2636
2645
  scheduleRiffAccessUrlPatch(ds);
2637
2646
  break;
2638
2647
  }