fix(coding-agent): addressed python cleanup review findings

fixed retained-kernel restart and owner cleanup edge cases during recovery and disposal

tracked async user_python hooks during disposal-sensitive execution paths and hardened startup warmup tracking

strengthened cleanup and kernel lifecycle regressions to remove deadlocks, false positives, and timing flakes
This commit is contained in:
Carl
2026-04-12 14:45:19 +02:00
parent 379064a0c9
commit 2b480f7da1
11 changed files with 278 additions and 122 deletions
@@ -1,6 +1,10 @@
import { afterEach, beforeEach, describe, expect, it } from "bun:test";
import { disposeAllKernelSessions, executePython } from "@oh-my-pi/pi-coding-agent/ipy/executor";
import type { KernelExecuteOptions, KernelExecuteResult } from "@oh-my-pi/pi-coding-agent/ipy/kernel";
import type {
KernelExecuteOptions,
KernelExecuteResult,
KernelShutdownResult,
} from "@oh-my-pi/pi-coding-agent/ipy/kernel";
import { PythonKernel } from "@oh-my-pi/pi-coding-agent/ipy/kernel";
import { TempDir } from "@oh-my-pi/pi-utils";
@@ -20,7 +24,7 @@ class FakeKernel {
return { status: "ok", cancelled: false, timedOut: false, stdinRequested: false };
}
async shutdown(): Promise<{ confirmed: boolean }> {
async shutdown(): Promise<KernelShutdownResult> {
this.shutdownCalls += 1;
this.alive = false;
return { confirmed: true };