Skip to content

reapRun

reapRun(herdr, worktree, terminalId, worktreePath): void

Defined in: src/critic-core.ts:521

Terminal + disposable-worktree teardown for a finished critic run. Accepts the herdr and worktree OBJECTS and calls their methods so that this is preserved — passing bare unbound methods would lose this and crash inside HerdrDriver.stop / WorktreeMgr.remove.

Teardown can’t crash: callers invoke this from a finally, so it must reap best-effort and never throw. HerdrDriver.stop can still throw (its this.list() does JSON.parse(runner(...)), which fails if the herdr CLI errors) — guard it so a herdr hiccup can’t strand the worktree, and run worktree.remove (itself internally guarded) unconditionally.

string

string

void