Wall #3 of the pi coding-agent bring-up (tracker #6564; walls #1 #6593 and #2 #6604 fixed). With both fixes applied, the compiled pi binary gets through module init and dies at:
Error: Perry createRequire() currently supports built-in modules only; package/file require('node:diagnostics_channel') is not supported
Site: lru-cache's node build (pi bundle line ~5520) does require('node:diagnostics_channel') through the bundle's createRequire(import.meta.url) shim (the esbuild createRequire banner pattern — any ESM bundle of CJS deps produces this shape).
So perry's createRequire either (a) doesn't include diagnostics_channel in its builtin set, or (b) rejects the node:-prefixed form on this path while supporting the bare name. Both are worth fixing:
- normalize
node:-prefixed specifiers in createRequire before the builtin lookup (Node accepts both forms);
- ensure
diagnostics_channel is present as at least a functional stub (channel(), hasSubscribers, subscribe/unsubscribe, tracingChannel) — lru-cache only uses it for optional diagnostics, so a spec-shaped no-op channel suffices for this consumer, though a real implementation serves opentelemetry-adjacent code later.
Repro: HOME=$(mktemp -d) /Users/amlug/projects/perry/secret-tests/pi-target/dist/pi-native --help (binary built from the #6603+#6604 branches), or reduce to: an ESM file with const require = createRequire(import.meta.url); const dc = require('node:diagnostics_channel'); console.log(typeof dc.channel).
Wall #3 of the pi coding-agent bring-up (tracker #6564; walls #1 #6593 and #2 #6604 fixed). With both fixes applied, the compiled pi binary gets through module init and dies at:
Site: lru-cache's node build (pi bundle line ~5520) does
require('node:diagnostics_channel')through the bundle'screateRequire(import.meta.url)shim (the esbuild createRequire banner pattern — any ESM bundle of CJS deps produces this shape).So perry's createRequire either (a) doesn't include
diagnostics_channelin its builtin set, or (b) rejects thenode:-prefixed form on this path while supporting the bare name. Both are worth fixing:node:-prefixed specifiers in createRequire before the builtin lookup (Node accepts both forms);diagnostics_channelis present as at least a functional stub (channel(),hasSubscribers,subscribe/unsubscribe,tracingChannel) — lru-cache only uses it for optional diagnostics, so a spec-shaped no-op channel suffices for this consumer, though a real implementation serves opentelemetry-adjacent code later.Repro:
HOME=$(mktemp -d) /Users/amlug/projects/perry/secret-tests/pi-target/dist/pi-native --help(binary built from the #6603+#6604 branches), or reduce to: an ESM file withconst require = createRequire(import.meta.url); const dc = require('node:diagnostics_channel'); console.log(typeof dc.channel).