ai_co_discuss 0.2.69 → 0.2.70

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.
@@ -253,6 +253,15 @@ export function kill_process_tree(child, plain_kill, platform = process.platform
253
253
  return plain_kill();
254
254
  }
255
255
 
256
+ /** Make a delivered process's kill end its whole tree on Windows, so a stopped turn leaves no tool commands running. */
257
+ function tree_killable(child) {
258
+ if (typeof child.kill === 'function') {
259
+ const plain_kill = child.kill.bind(child);
260
+ child.kill = () => kill_process_tree(child, plain_kill);
261
+ }
262
+ return child;
263
+ }
264
+
256
265
  async function claude_delivery(config, binding, task, spawn_process = spawn) {
257
266
  const session_id = binding.session_id || randomUUID();
258
267
  try { bind_access(task.access_path, session_id); }
@@ -266,10 +275,7 @@ async function claude_delivery(config, binding, task, spawn_process = spawn) {
266
275
  env: { ...standalone_claude_env(), DISCUSS_ACCESS_FILE: task.access_path },
267
276
  });
268
277
  } catch (error) { throw not_sent(error); }
269
- if (typeof child.kill === 'function') {
270
- const plain_kill = child.kill.bind(child);
271
- child.kill = () => kill_process_tree(child, plain_kill);
272
- }
278
+ tree_killable(child);
273
279
  let spawned = false;
274
280
  const log_path = resolve(task.directory, `claude-${task.id}.log`);
275
281
  let output = '';
@@ -497,6 +503,7 @@ async function cli_delivery(config, binding, task, spawn_process, user_home) {
497
503
  env: { ...process.env, DISCUSS_ACCESS_FILE: task.access_path },
498
504
  });
499
505
  } catch (error) { throw not_sent(error); }
506
+ tree_killable(child);
500
507
  const state = monitor_cli(child, config, binding, task);
501
508
  task.on_process(child);
502
509
  await new Promise((resolve_spawn, reject) => {
@@ -164,7 +164,7 @@ export class FreeRoomRunner {
164
164
  async tick() {
165
165
  const inbox = await api(this.config, '/inbox');
166
166
  const room = await api(this.config, '');
167
- // Smart scheduling runs beside delivery: the host gets the message now, a recommendation may follow.
167
+ // Smart scheduling runs beside delivery: the host waits for its answer (or failure) before starting, see `routing`.
168
168
  if (this.config.scheduler && !inbox.archived) this.recommend_unnamed(inbox, room);
169
169
  this.room_title = room.title;
170
170
  const active = new Map(inbox.executions.map(item => [item.id, item]));