fix(coding-runtime): close Pi extension lifecycle races

This commit is contained in:
2026-08-23 10:13:10 +08:00
parent 3861c3286a
commit 31de325cd8
9 changed files with 197 additions and 14 deletions

View File

@@ -8,7 +8,7 @@
- Worktree: D:\Datas\OthersProjects\makelore-pi-extension-host-7e4c91a2
- Base commit: 47159b3cbdf06ea66db9a4425e0a9c13bcd73f7f
- Owner: codex
- Status: Completed — pending planner review
- Status: Completed — correction candidate pending planner re-review
## Scope
@@ -99,6 +99,18 @@
- The Pi 0.84.2 real-child smoke now loads the materialized managed extension
through Electron Node and confirms RPC readiness without extension-load or
stdout-protocol failure. No real external Provider was contacted.
- Planner review of initial candidate `3861c32` returned **Needs Fix / Not
Done** with four deterministic supported-path findings. The correction
closes each finding without changing the PI DAG: recover clears the old run
before worker replacement and replacement only continues a run still active
in the pool; interaction response ownership is atomic across double-submit
and generation invalidation; Host close stops new connections, waits tracked
request handlers, and terminates stale lease waiters; UI diagnostics retain
only the newest 256 bounded entries.
- Added exact regressions for active-run recover, delayed interaction send plus
generation cancellation, holder+waiter Host shutdown, and 1,000 unknown UI
events. All four planner reproductions now pass locally; PI-070 remains the
sole frontier until planner re-review marks the correction Done.
- Real Provider validation remains **Explicitly Waived / Accepted Risk** with
`realTurnVerified=false`; provider concurrency, credential isolation, and
protocol compatibility are not Pass. macOS x64/arm64 remains deferred to
@@ -123,6 +135,22 @@
- `corepack pnpm test` — 199 files / 2192 tests passed before the final bundle
integration test was added; that new test then passed independently, making
all 200 current test files green across the two recorded runs.
- Planner correction focused suite — 4 files / 9 tests passed, including all
four deterministic review regressions.
- Post-correction all-Pi run — 19 files / 91 tests passed; the existing
`pi-conversation-runtime` Windows temporary JSON `rename EPERM` occurred in
the aggregate run, then the same test passed 1/1 in isolation. No Pi behavior
assertion failed.
- Post-correction full suite — 199 files / 2194 tests passed; only that same
pre-existing Windows temporary-file `rename EPERM` prevented a single green
aggregate result. The affected runtime test passed immediately in isolation,
so all 200 files / 2195 tests are green across the recorded aggregate plus
isolated rerun. The failure is not in a PI-070-owned path and no retry or
filesystem workaround was added.
- Post-correction `corepack pnpm run typecheck` and `lint:check` — passed; lint
remains 0 errors with the same 6 unrelated warnings.
- Post-correction `corepack pnpm run build:vite` — passed for all four build
targets with unchanged existing warnings.
- `corepack pnpm run build:vite` — passed for Renderer, Electron Main,
Preload, and release utility output. Existing dynamic-import and chunk-size
warnings remain unchanged.