[Problem] Bug: OpenCode app stops responding after installing ECC (ERR_MODULE_NOT_FOUND on custom tools)
What is the impact?
ECC installs, but nothing loads
What happened?
Bug: OpenCode app stops responding after installing ECC (ERR_MODULE_NOT_FOUND on custom tools)
Summary
After installing ECC (profile full, target opencode-home), the OpenCode application no longer responds to any prompt. Sessions start but produce no model output, and the logs show prompt_async failed with ERR_MODULE_NOT_FOUND on the ECC custom tools.
Environment
- OpenCode 1.18.25 (macOS desktop app + CLI)
- ECC 2.2.1 (commit
8321021c), installed2026-09-13T13:17:06Z - Install target:
opencode-home-> root/Users/<user>/.config/opencode - Install state file:
~/.config/opencode/ecc-install-state.json
Symptom
- Every new session fails silently with no model response.
- OpenCode log (
~/.local/share/opencode/log/opencode.log):
ERROR message="prompt_async failed" sessionID=ses_... cause="Cause([Die(Error [ERR_MODULE_NOT_FOUND]:
Cannot find module '.../.config/opencode/tools/run-tests.js'
imported from .../.config/opencode/tools/index.ts)])"
The failure happens while building the tool registry (ToolRegistry.state -> SessionTools.resolve), i.e. before any model request - so the app stops responding entirely.
Root cause
ECC installs the TypeScript source barrels into OpenCode's active directories, but these barrels import modules using the .js extension while only .ts files exist next to them (the matching .js files only exist after compilation, inside dist/).
Installed file: ~/.config/opencode/tools/index.ts (copied from ECC/.opencode/tools/index.ts):
export { default as runTests } from "./run-tests.js" // line 8
export { default as checkCoverage } from "./check-coverage.js" // line 9
export { default as securityAudit } from "./security-audit.js" // line 10
export { default as formatCode } from "./format-code.js" // line 11
export { default as lintCheck } from "./lint-check.js" // line 12
export { default as gitSummary } from "./git-summary.js" // line 13
export { default as changedFiles } from "./changed-files.js" // line 14
export { default as dependencyAnalyzer } from "./dependency-analyzer.js" // line 15
Installed file: ~/.config/opencode/plugins/index.ts (copied from ECC/.opencode/plugins/index.ts):
export { ECCHooksPlugin, default } from "./ecc-hooks.js" // line 9
export * from "./ecc-hooks.js" // line 12
In both directories only the .ts files exist (./run-tests.ts, ./ecc-hooks.ts, ...). The referenced .js files exist only as dist/tools/*.js and dist/plugins/*.js (the tsc output of scripts/build-opencode.js). The ESM loader used by OpenCode does not do .js -> .ts resolution, so the import ./run-tests.js is not found and the entire tool registry fails.
Verification: the compiled ECC/.opencode/dist/tools/index.js does reference ./run-tests.js - and it resolves fine, because dist/tools/run-tests.js exists. The bug is strictly in the .ts source barrels that get copied into the active directories.
Reproduction
- Install ECC with target
opencode-home(profilefull). - Launch OpenCode (app or CLI).
- Send a prompt -> no response.
- Inspect the log:
prompt_async failed ... ERR_MODULE_NOT_FOUND ... tools/run-tests.js.
Fix applied locally
In ~/.config/opencode/tools/index.ts and ~/.config/opencode/plugins/index.ts, change import extensions from .js -> .ts:
// before
export { default as runTests } from "./run-tests.js"
// after
export { default as runTests } from "./run-tests.ts"
Side note (also needed on this machine) - in opencode.json: the skills path "../skills" resolved outside the config folder (missing /Users/<user>/skills) -> fix to "./skills".
Restart required: the desktop app and opencode serve keep the old tool registry in memory -> relaunch them after applying the fix.
Fix to integrate in the ECC repo
The bug lives in ECC/.opencode/tools/index.ts and ECC/.opencode/plugins/index.ts. Two options:
- Option A (simple): use
.tsfor imports between adjacent.tsmodules (the two barrels) - compatible with theopencode-hometarget, which loads the.tsfiles in-place. - Option B (structural): for the
opencode-hometarget, install the compiled barrels fromdist/(dist/tools/index.js,dist/plugins/index.js) instead of the.tssources.
Harness
OpenCode
Install method
ecc or ecc-install CLI
Operating system
macOS
ECC and harness versions
ECC 2.1.0
Optional redacted diagnostics
No response
Source: affaan-m/ECC