refactor(backend): drop dead SpawnFn alias + test Pi exit-handler cleanup

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-27 21:09:49 +02:00
co-authored by Claude Opus 4.8
parent de7200f7dd
commit f4c6126270
2 changed files with 17 additions and 1 deletions
+2 -1
View File
@@ -10,13 +10,14 @@ export interface SessionRuntime {
child: ChildProcessWithoutNullStreams;
}
/** Injected test double signature: produce a child process, no args needed. */
type SpawnFn = () => ChildProcessWithoutNullStreams;
export class PiProcessManager {
private runtimes = new Map<string, SessionRuntime>();
private spawnFn: (sessionId: string, author: string) => ChildProcessWithoutNullStreams;
constructor(private cfg: AppConfig, opts?: { spawnFn?: () => ChildProcessWithoutNullStreams }) {
constructor(private cfg: AppConfig, opts?: { spawnFn?: SpawnFn }) {
if (opts?.spawnFn) {
this.spawnFn = () => opts.spawnFn!();
} else {