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
Importing the public skill module first crashes through an ESM cycle #37424
Remove the order-dependent ESM initialization cycle that makes a fresh process crash when @opencode-ai/core/skill is the first Core module imported.
The current cycle is skill.ts -> permission.ts -> session.ts -> skill.ts. Session.SkillNotFoundError eagerly reads SkillV2.ID before the skill module initializes, producing ReferenceError: Cannot access 'ID' before initialization.
This also prevents the focused aggregate config hot-reload test from running in isolation.
Acceptance criteria
A fresh Bun process can import @opencode-ai/core/skill without preloading another Core module.
packages/core/test/config/reload.test.ts runs in isolation.
The error schema continues to use the canonical skill ID schema.
A fresh-process import regression test passes deterministically.
Draft red-test coverage is in #37427. The test imports @opencode-ai/core/skill in a fresh Bun process so module caching cannot hide the initialization cycle.
Fixed by #37596 (529d55b1c3), which replaced the broad ./session import in permission.ts with narrow session/error and session/schema imports. Verified against current origin/v2 at a2885d1662: a fresh Bun process can import @opencode-ai/core/skill successfully.
Activity
kitlangton commentedon Jul 17, 2026
Draft red-test coverage is in #37427. The test imports
@opencode-ai/core/skillin a fresh Bun process so module caching cannot hide the initialization cycle.kitlangton commentedon Jul 28, 2026
Fixed by #37596 (
529d55b1c3), which replaced the broad./sessionimport inpermission.tswith narrowsession/errorandsession/schemaimports. Verified against currentorigin/v2ata2885d1662: a fresh Bun process can import@opencode-ai/core/skillsuccessfully.