fix(coding-agent): isolate Inspector import crashes#336
Conversation
|
CI note: the first aggregate job failed in untouched Neo test TestAttachOrSpawn_RaceExactlyOneDaemon after a 30s timeout. This branch changes no Neo/check-neo files, local root npm run check passed, and current main itself has a red aggregate CI run. I do not have upstream admin permission to rerun the job directly, so I am reopening this draft once to obtain an independent run without changing the verified Inspector commit. |
|
Independent rerun result: all security and cross-platform terminal jobs passed again; aggregate check and build passed, then the full workspace run recorded 4,606 passes and failed only untouched |
|
CI follow-up (kept out of this Inspector-only patch):
Evidence and command receipts are preserved under the gitignored |
Summary
cli-mainThis is the current-main replacement for #321. It is one commit directly on
main@38bd3a3cf8a47c1201969117b1a82a5af7daac9c; the old draft is conflicting.Root cause
node inspect/the V8 Inspector protocol evaluates expressions in a VM context without animportModuleDynamicallycallback. A delayed import:therefore rejects with
ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING.The CLI also has a launcher/child topology. With a fixed
NODE_OPTIONS=--inspect=..., the launcher previously claimed the endpoint andcli-maininherited the same option, producingaddress already in use; the debugger attached to the wrapper instead of the TUI child.Behavior
Before spawning
cli-main, the launcher releases an active Inspector endpoint inherited from Node startup options. The child can bind the same endpoint.Recovery remains disabled unless the process starts with:
The recovery predicate then requires all of:
unhandledRejectionoriginERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING<anonymous>timer provenanceNode exposes no non-spoofable Inspector provenance on the global rejection, so the explicit opt-in is required. Later environment mutation cannot enable recovery.
Verification
npm run build: passednpm run check: passed, including typecheck/browser/web/Neo gatesgit diff --check: passedReal CLI QA
Fresh evidence is under local-ignore/qa-evidence/20260725-inspector-vm-import-crash-current-main/ (gitignored).
senpi-qacommon self-check: 9/9 passedsenpi-qaCLI smoke: 7/7 passedsenpi-qatmux TUI smoke: 5/5 passedaddress already in useCI state
The security check and all Linux/macOS/Windows terminal jobs passed on both CI runs. The aggregate job remains red on unrelated current-main instability:
npm run checktimed out in untouched NeoTestAttachOrSpawn_RaceExactlyOneDaemon; the same local root check passed.agent-session-compaction.test.ts:1361(overflowStartswas empty).This Inspector commit changes neither Neo nor compaction source/tests. Current
main@38bd3a3cfalso has a red aggregate CI run. No unrelated retry/race or compaction fix is included here.