File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1270,6 +1270,12 @@ fn handleBundle(
12701270 }
12711271
12721272 const w = cio .listWriter (out , alloc );
1273+ // Refresh the idle clock as we start the bundle — long bundles (slow
1274+ // sub-ops, many ops, remote fetches) would otherwise leave
1275+ // `last_activity` frozen at message-arrival time, and the watchdog
1276+ // would close stdin mid-processing. Repeated inside the loop so each
1277+ // completed sub-op keeps us marked active. See #278.
1278+ last_activity .store (cio .milliTimestamp (), .release );
12731279 for (ops , 0.. ) | op , i | {
12741280 if (op != .object ) {
12751281 w .print ("--- [{d}] error ---\n op must be an object\n " , .{i }) catch {};
@@ -1319,6 +1325,9 @@ fn handleBundle(
13191325 w .print ("--- [{d}] {s} ---\n " , .{ i , tool_name }) catch {};
13201326 out .appendSlice (alloc , sub_out .items ) catch {};
13211327 w .writeAll ("\n " ) catch {};
1328+
1329+ // Per-op activity refresh — see top of this fn.
1330+ last_activity .store (cio .milliTimestamp (), .release );
13221331 }
13231332}
13241333
You can’t perform that action at this time.
0 commit comments