@code-yeongyu/senpi-codemode 2026.11.30-3 → 2026.11.30-5

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [2026.11.30-5] - 2026-11-30
4
+
5
+ ### Breaking Changes
6
+
7
+ ### Added
8
+
9
+ ### Changed
10
+
11
+ ### Fixed
12
+
13
+ ### Removed
14
+
15
+ ## [2026.11.30-4] - 2026-11-30
16
+
17
+ ### Breaking Changes
18
+
19
+ ### Added
20
+
21
+ ### Changed
22
+
23
+ ### Fixed
24
+
25
+ - An idle Python eval kernel no longer keeps exited children of dropped `Popen` handles as zombies ([#7347](https://github.com/code-yeongyu/senpi/pull/7347))
26
+
27
+ ### Removed
28
+
3
29
  ## [2026.11.30-3] - 2026-11-30
4
30
 
5
31
  ### Breaking Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/senpi-codemode",
3
- "version": "2026.11.30-3",
3
+ "version": "2026.11.30-5",
4
4
  "description": "Source-only senpi extension package for codemode evaluation tools",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -33,16 +33,16 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/parser": "8.0.4",
36
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.30-3",
37
- "@earendil-works/pi-realm-registry": "npm:@code-yeongyu/senpi-realm-registry@2026.11.30-3",
36
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.30-5",
37
+ "@earendil-works/pi-realm-registry": "npm:@code-yeongyu/senpi-realm-registry@2026.11.30-5",
38
38
  "quickjs-wasi": "3.6.2",
39
39
  "typebox": "1.3.34"
40
40
  },
41
41
  "peerDependencies": {
42
- "@code-yeongyu/senpi": "2026.11.30-3"
42
+ "@code-yeongyu/senpi": "2026.11.30-5"
43
43
  },
44
44
  "devDependencies": {
45
- "@code-yeongyu/senpi": "2026.11.30-3"
45
+ "@code-yeongyu/senpi": "2026.11.30-5"
46
46
  },
47
47
  "keywords": [
48
48
  "senpi",
@@ -2480,6 +2480,17 @@ def _read_control(commands: queue.SimpleQueue[tuple[str, Any]]) -> None:
2480
2480
  commands.put(("eof", None))
2481
2481
 
2482
2482
 
2483
+ # CPython collects a child whose Popen handle was dropped only when a later Popen starts, so a kernel that goes idle
2484
+ # keeps it as a zombie that pid-liveness checks still read as alive (senpi#7246). subprocess._cleanup waits only on
2485
+ # those dropped handles: a handle a cell still holds, and a child from os.fork, os.spawn* or pty.fork, keeps its exit
2486
+ # status for its owner. The main thread runs it between messages, never while a cell is executing.
2487
+ _DISCARDED_CHILD_REAP_SECONDS = 1.0
2488
+
2489
+
2490
+ def _reap_discarded_children() -> None:
2491
+ subprocess._cleanup()
2492
+
2493
+
2483
2494
  def main() -> None:
2484
2495
  emit_status("kernel-startup", force=True, stage="host-init")
2485
2496
  signal.signal(signal.SIGINT, signal.SIG_IGN)
@@ -2489,7 +2500,11 @@ def main() -> None:
2489
2500
  threading.Thread(target=_read_control, args=(commands,), name="senpi-control-reader", daemon=True).start()
2490
2501
  host_closed = False
2491
2502
  while True:
2492
- kind, payload = commands.get()
2503
+ try:
2504
+ kind, payload = commands.get(timeout=_DISCARDED_CHILD_REAP_SECONDS)
2505
+ except queue.Empty:
2506
+ _reap_discarded_children()
2507
+ continue
2493
2508
  if kind == "eof":
2494
2509
  break
2495
2510
  if kind == "malformed":
@@ -2501,6 +2516,7 @@ def main() -> None:
2501
2516
  break
2502
2517
  except BaseException as exc: # noqa: BROAD_EXCEPT_OK — process boundary serializes malformed input and interrupts.
2503
2518
  emit({"type": "init-failed", "error": bridge_error(exc)})
2519
+ _reap_discarded_children()
2504
2520
  # Reaching here without a close frame means the host's pipe hit EOF: it is gone,
2505
2521
  # so retire any subprocess the last cell left running before the interpreter exits.
2506
2522
  if not host_closed: