You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
modules: export * as X from "./self" is undefined on a dynamic import() namespace (key present, value undefined) — blocks every OpenCode command at the effect-cmd bootstrap #10160
Parent: #10107 (OpenCode v1.18.30). This single bug blocks every real OpenCode command (run, models, serve, TUI): the shared bootstrap in packages/opencode/src/cli/effect-cmd.ts:84-88 does
and packages/opencode/src/project/instance-store.ts:213 exports the module's own namespace: export * as InstanceStore from "./instance-store". OpenCode uses this self-namespace re-export pattern in 265 modules (export * as Foo from "./foo"), and reads them through dynamic imports in effect-cmd.ts, cli/cmd/tui.ts, cli/cmd/attach.ts, cli/cmd/run.ts, …
perry 0.5.1543 (origin/main 5603d63), perry compile main.ts --no-auto-optimize:
static: object function store-ok
dyn keys: InstanceStore,Service,node
dyn destructured: undefined undefined
dyn use FAILED: Cannot read properties of undefined (reading 'Service')
bun 1.3.14 (and node):
static: object function store-ok
dyn keys: InstanceStore,Service,node
dyn destructured: object function
dyn use: store-ok!
So the dynamic-import namespace object has the InstanceStore key but its value is undefined: the export * as X from "./self" entry is not materialized for the dynamic namespace (only the static-import binding path resolves it). Worth checking the non-self case too (export * as Y from "./other" read through import()), and import * as ns + ns.InstanceStore on the dynamic namespace.
Acceptance
The repro prints the bun output under perry (self and non-self export * as, via destructuring and via property read on the dynamic namespace).
Regression test under crates/perry/tests/ in the style of source_graph_export_regressions.rs.
OpenCode opencode models lists models from the native build (the first command past the bootstrap).
Fixed by #10162, landed via merge train #10163 (main b5a82cfeae). export * as Self from "./self" is now published as a live accessor that reads the module's own namespace global at access time, so dynamic import() namespaces see it.
Activity
fix(codegen): publish self namespace re-exports as live accessors (#1…
proggeramlug commentedon Sep 13, 2026
Fixed by #10162, landed via merge train #10163 (main
b5a82cfeae).export * as Self from "./self"is now published as a live accessor that reads the module's own namespace global at access time, so dynamicimport()namespaces see it.