Skip to content

fix: resolve OpenCode source imports and installed skills paths - #3115

Open
yuefdev wants to merge 1 commit into
affaan-m:mainfrom
yuefdev:fix/opencode-source-module-resolution
Open

fix: resolve OpenCode source imports and installed skills paths#3115
yuefdev wants to merge 1 commit into
affaan-m:mainfrom
yuefdev:fix/opencode-source-module-resolution

Conversation

@yuefdev

@yuefdev yuefdev commented Sep 13, 2026

Copy link
Copy Markdown

What Changed

OpenCode's full home install currently copies TypeScript sources whose .js imports point to files that exist only under dist/. This causes ERR_MODULE_NOT_FOUND before the first model request. Use .ts for relative source imports, including the lazy changed-files store, and enable TypeScript's rewriteRelativeImportExtensions so published JavaScript still imports .js files. Raise the standalone compiler minimum to 5.7 while retaining the locked 5.9.3 version.

Home installation also rewrites the bundled ../skills path to ./skills, preserving the repository template and other configured paths. Installation and lifecycle operations share the transformation so repair restores identical content and uninstall recognizes it.

Why This Change

Fixes #3112.

This is an alternative to #3113: it keeps the existing TypeScript runtime layout and also supports loading the repository sources directly. It does not migrate active runtime files to compiled JavaScript.

Testing Done

  • Reproduced the reported ERR_MODULE_NOT_FOUND in a full-profile isolated home before the fix; the same regression test passes afterward.
  • Verified all eight tool exports, plugin initialization, and hook-to-tool changed-files tracking in both installed TypeScript and compiled JavaScript. The test loader preserves import specifiers and does not remap missing .js files to .ts.
  • Verified install -> deleted config -> repair -> content digest -> uninstall, including preservation of custom skill paths and the repository config.
  • Passed 12 focused suites: build/pack (6), hooks (9), tools (9), changed-files store (8), config (4), installer (21), adapters (51), lifecycle (66), OpenCode migration (9), Antigravity migration (14), planning boundary (3), and publish surface (2).
  • Root TypeScript 6.0.3 and isolated standalone TypeScript 5.9.3 builds pass. Native Node 24 TypeScript loading and published declaration type-checking pass.
  • Shared transform coverage: 89.65% lines/statements, 84.61% branches, 100% functions.
  • Scoped ESLint, install manifest validation, npm pack, and git diff --check pass.

Validation ran on Windows / Node 24.19.0. The full repository suite, Node 18 execution, and actual macOS/OpenCode desktop startup or model responses were not tested. Existing Windows-incompatible symlink/POSIX subcases were skipped by their suites.

Type of Change

  • fix: Bug fix

Security & Quality Checklist

  • JSON files validate cleanly
  • Follows conventional commits format
  • Regression and lifecycle edge cases tested

Dependency Changes

  • Ran corepack yarn install --mode=update-lockfile; the root lockfile is unchanged. Updated the nested package manifest and lockfile together; no resolved dependency versions changed.

@yuefdev
yuefdev requested a review from affaan-m as a code owner September 13, 2026 23:27
@ecc-tools

ecc-tools Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Security Evidence

Commit: ef475c7997137c304ba6c9975d28ab7bd72b45bf

Security evidence gate passed (success)

No security-sensitive scanner-evidence gap detected.

Mode: enforce

Scanned 15 changed file(s). No missing scanner-evidence signal was detected.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / PR Risk Taxonomy

Commit: ef475c7997137c304ba6c9975d28ab7bd72b45bf

PR taxonomy review recommended (neutral)

Detected 4 PR taxonomy bucket(s): Harness Drift, Install Manifest Integrity, CI/CD Recommendation, Agent Config Review.

Scanned 15 changed file(s).

Roadmap taxonomy buckets:

Harness Drift

Harness-facing changes can drift across Claude Code, Codex, OpenCode, and shared adapter surfaces.

Signals:

  • Harness config changes may ship without compatibility evidence
  • 8 harness-facing path(s) changed

Paths:

  • .opencode/index.ts
  • .opencode/package-lock.json
  • .opencode/package.json
  • .opencode/plugins/ecc-hooks.ts
  • .opencode/plugins/index.ts
  • .opencode/tools/changed-files.ts
  • .opencode/tools/index.ts
  • .opencode/tsconfig.json

Install Manifest Integrity

Install manifests, plugin metadata, and shipped skills should stay synchronized with user-facing setup guidance.

Signals:

  • 8 install or manifest path(s) changed

Paths:

  • .opencode/index.ts
  • .opencode/package-lock.json
  • .opencode/package.json
  • .opencode/plugins/ecc-hooks.ts
  • .opencode/plugins/index.ts
  • .opencode/tools/changed-files.ts
  • .opencode/tools/index.ts
  • .opencode/tsconfig.json

CI/CD Recommendation

CI, dependency, coverage, and contract signals should be routed into follow-up checks or verification work.

Signals:

  • 3 CI or workflow path(s) changed

Paths:

  • .opencode/package-lock.json
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js

Agent Config Review

Agent, command, skill, MCP, and local instruction changes should be reviewed as executable agent configuration.

Signals:

  • 8 agent-config path(s) changed

Paths:

  • .opencode/index.ts
  • .opencode/package-lock.json
  • .opencode/package.json
  • .opencode/plugins/ecc-hooks.ts
  • .opencode/plugins/index.ts
  • .opencode/tools/changed-files.ts
  • .opencode/tools/index.ts
  • .opencode/tsconfig.json

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Reference Set Readiness

Commit: ef475c7997137c304ba6c9975d28ab7bd72b45bf

Reference set readiness gaps detected (neutral)

Reference evidence present for 1/7 areas (14%) across 15 changed file(s).

This check is based on files changed in this PR. Repository-level readiness is still reported by /ecc-tools analyze comments and generated manifests.

Area Status Evidence / Next Step
Deep analyzer corpus Missing Add analyzer fixture, golden, benchmark, or reference-set files that can catch analyzer regressions.
RAG/evaluator comparison Missing Add retrieval or evaluator reference-set comparison fixtures with expected ranking behavior.
PR salvage/review corpus Missing Add stale-PR, review-thread, reopen-flow, or salvage reference cases for queue cleanup automation.
Discussion triage corpus Missing Add public discussion triage fixtures, golden cases, or reference sets for informational, answered, and no-response classifications.
Harness compatibility Present .opencode/index.ts, .opencode/package-lock.json, .opencode/package.json
Security evidence Missing Attach security evidence such as SBOMs, SARIF, audit reports, or AgentShield evidence packs.
CI failure-mode evidence Missing Add captured CI failure logs, dry-run fixtures, or troubleshooting docs for common workflow failure modes.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Hosted Promotion Readiness

Commit: ef475c7997137c304ba6c9975d28ab7bd72b45bf

Hosted promotion readiness passed (success)

No hosted promotion evidence gaps detected across 15 changed file(s); 0 corpus scenarios had matching evidence.

This check compares PR file changes against the evaluator/RAG promotion corpus in src/analyzers/fixtures/evaluator-rag-corpus.ts.
Hosted output scoring inspected 0 completed cached hosted job results.

No evaluator corpus scenarios matched this PR.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 4379cf4f-4efd-40a1-9f9c-138688399253

📥 Commits

Reviewing files that changed from the base of the PR and between 8321021 and ef475c7.

⛔ Files ignored due to path filters (1)
  • .opencode/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (14)
  • .opencode/index.ts
  • .opencode/package.json
  • .opencode/plugins/ecc-hooks.ts
  • .opencode/plugins/index.ts
  • .opencode/tools/changed-files.ts
  • .opencode/tools/index.ts
  • .opencode/tsconfig.json
  • scripts/lib/install-lifecycle.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install/apply.js
  • scripts/lib/install/content-transform.js
  • tests/fixtures/opencode-ts-loader.mjs
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (21)
Focus on command injection, unsafe subprocess usage, path traversal, SSRF, secret exposure, and missing tests for new CLI behavior.

⚙️ CodeRabbit configuration file

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
Lightweight agents with frequent invocation Pair programming and code generation Worker agents in multi-agent systems Main development work Orchestrating multi-agent workflows Complex coding tasks Complex architectural decisions Maximum rea...

📄 CodeRabbit inference engine (.cursor/rules/common-performance.md)

Files:

  • scripts/lib/install/content-transform.js
  • tests/fixtures/opencode-ts-loader.mjs
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
NEVER hardcode secrets in source code - ALWAYS use environment variables or a secret manager

📄 CodeRabbit inference engine (.cursor/rules/common-security.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
No hardcoded secrets (API keys, passwords, tokens) - validate before any commit

📄 CodeRabbit inference engine (.cursor/rules/common-security.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Package manager detection should support npm, pnpm, yarn, and bun, with configuration via CLAUDE_PACKAGE_MANAGER environment variable or project config.

📄 CodeRabbit inference engine (CLAUDE.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
Always create new objects, never mutate existing ones.

📄 CodeRabbit inference engine (.cursor/rules/common-coding-style.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Use parameterized queries to prevent SQL injection

📄 CodeRabbit inference engine (.cursor/rules/common-security.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Implement XSS prevention by sanitizing HTML output

📄 CodeRabbit inference engine (.cursor/rules/common-security.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
All user inputs must be validated Enable CSRF protection on all state-changing endpoints Verify authentication and authorization for all protected endpoints Implement rate limiting on all endpoints to prevent abuse Ensure error messages do...

📄 CodeRabbit inference engine (.cursor/rules/common-security.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Write tests before implementation (test-driven development); target 80%+ coverage Achieve minimum 80% test coverage across all three layers: Unit, Integration, and E2E Use AAA structure (Arrange / Act / Assert) in tests with descriptive tes...

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Files:

  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Do not hardcode secrets, API keys, passwords, or tokens

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Always create new objects and never mutate in place; return new copies instead Keep files between 200–400 lines typical, with a maximum of 800 lines Extract helpers when a file exceeds 200 lines Handle errors explicitly at every level; neve...

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
HTML output must be sanitized where applicable

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Auto-format JavaScript/TypeScript files using Prettier after edit Warn about `console.log` statements in edited files Check all modified files for `console.log` statements before session ends

📄 CodeRabbit inference engine (.cursor/rules/typescript-hooks.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Never hardcode secrets; always use environment variables for sensitive credentials like API keys Throw an error when required environment variables are not configured to fail fast and ensure security prerequisites are met

📄 CodeRabbit inference engine (.cursor/rules/typescript-security.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Use Playwright as the E2E testing framework for critical user flows in TypeScript/JavaScript

📄 CodeRabbit inference engine (.cursor/rules/typescript-testing.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Use spread operator for immutable updates in TypeScript/JavaScript instead of direct mutation Use async/await with try-catch for error handling in TypeScript/JavaScript Use Zod for schema-based input validation in TypeScript/JavaScript No c...

📄 CodeRabbit inference engine (.cursor/rules/typescript-coding-style.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Use the ApiResponse interface pattern with generic type parameter: `interface ApiResponse { success: boolean; data?: T; error?: string; meta?: { total: number; page: number; limit: number; } }` Implement custom React hooks following the...

📄 CodeRabbit inference engine (.cursor/rules/typescript-patterns.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Ensure cross-platform support for Windows, macOS, and Linux via Node.js scripts in the scripts/ directory.

📄 CodeRabbit inference engine (CLAUDE.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
Required environment variables must be validated at startup

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
Use parameterized queries for all database writes (no string interpolation) Auth/authz must be checked server-side for every sensitive path Rate limiting must be applied to all public endpoints

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Files:

  • scripts/lib/install/content-transform.js
  • scripts/lib/install/apply.js
  • scripts/lib/install-targets/opencode-home.js
  • scripts/lib/install-lifecycle.js
  • tests/lib/install-executor.test.js
  • tests/scripts/build-opencode.test.js
🧠 Learnings (1)
📚 Learning: 2026-07-16T15:23:29.177Z
Learnt from: nankingjing
Repo: affaan-m/ECC PR: 2495
File: tests/lib/shell-substitution.test.js:12-24
Timestamp: 2026-07-16T15:23:29.177Z
Learning: In this repository, standalone JavaScript test suites under tests/lib/ follow a local runner convention: they use mutable `passed`/`failed` counters and print per-test console output. During code reviews, treat this as the expected harness style and generally avoid recommending one-off refactors to immutable counters for new/modified suites. Only request such counter refactors if the repository-wide test harness/convention is being changed.

Applied to files:

  • tests/lib/install-executor.test.js
🪛 ast-grep (0.45.3)
tests/lib/install-executor.test.js

[warning] 718-718: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(modulesPath, 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)


[warning] 731-731: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(path.join(REPO_ROOT, '.opencode', 'opencode.json'), 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)


[warning] 744-744: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(configSourcePath, 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)


[warning] 755-755: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(configPath, 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)


[warning] 760-760: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(configSourcePath, 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)


[warning] 773-773: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(configPath, 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)


[warning] 774-774: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(plan.installStatePath, 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)


[warning] 777-777: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(configPath)
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)

tests/scripts/build-opencode.test.js

[warning] 189-189: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(path.join(plan.targetRoot, "opencode.json"), "utf8")
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)

🔇 Additional comments (14)
.opencode/package.json (1)

65-65: LGTM!

.opencode/tools/index.ts (1)

7-15: LGTM!

.opencode/plugins/index.ts (1)

9-9: LGTM!

Also applies to: 12-12

.opencode/plugins/ecc-hooks.ts (1)

19-20: LGTM!

Also applies to: 114-116

.opencode/tools/changed-files.ts (1)

2-2: LGTM!

Also applies to: 30-30, 35-35

.opencode/tsconfig.json (1)

6-6: LGTM!

.opencode/index.ts (1)

40-40: 🗄️ Data Integrity & Integration

The repository evidence does not include the actual OpenCode loader or a run with a supported OpenCode and Node version. The fixture loader cannot establish whether the installed OpenCode runtime loads .ts entrypoints, so the startup compatibility claim remains undecided.

scripts/lib/install-targets/opencode-home.js (1)

8-9: LGTM!

Also applies to: 93-114

scripts/lib/install/content-transform.js (1)

1-29: LGTM!

scripts/lib/install-lifecycle.js (1)

35-35: LGTM!

Also applies to: 227-227

scripts/lib/install/apply.js (1)

38-38: LGTM!

tests/fixtures/opencode-ts-loader.mjs (1)

1-18: LGTM!

tests/scripts/build-opencode.test.js (1)

9-59: LGTM!

Also applies to: 169-202

tests/lib/install-executor.test.js (1)

24-24: LGTM!

Also applies to: 713-788


📝 Summary

Summary by CodeRabbit

  • New Features

    • OpenCode home installations now create managed configuration entries and correctly resolve bundled skill paths.
    • Installation planning now filters out assets intended for other platforms.
  • Bug Fixes

    • OpenCode plugin and tool loading now works reliably when sources are loaded directly.
    • Installation content transformations are handled consistently across supported targets.
    • Repair and uninstall workflows now correctly handle OpenCode home installations.
  • Tests

    • Added coverage for OpenCode loading, installation, configuration, cleanup, and cross-platform asset handling.

Walkthrough

The change fixes OpenCode TypeScript module resolution, enables compiler extension rewriting, centralizes install content transforms, adds OpenCode home operation planning, and expands runtime and installation tests.

Changes

OpenCode runtime and installation

Layer / File(s) Summary
Source module resolution
.opencode/index.ts, .opencode/plugins/*, .opencode/tools/*, .opencode/package.json, .opencode/tsconfig.json
OpenCode source imports now use .ts specifiers. The compiler rewrites relative extensions for compiled output. The TypeScript development dependency range is updated.
OpenCode installation planning and transforms
scripts/lib/install-targets/opencode-home.js, scripts/lib/install/content-transform.js, scripts/lib/install-lifecycle.js, scripts/lib/install/apply.js
The OpenCode home target filters foreign paths and creates managed opencode.json operations. Shared transformation logic rewrites ../skills to ./skills and retains Antigravity transformation handling.
Runtime and installation validation
tests/fixtures/opencode-ts-loader.mjs, tests/scripts/build-opencode.test.js, tests/lib/install-executor.test.js
Tests validate TypeScript and compiled barrel loading, lazy changed-file store sharing, OpenCode home installation, skill-path rewriting, repair, cleanup, and platform filtering.

Priority: ⬆️ High

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: High

Merge Risk: ⚪ Minimal · up to ef475

No actionable issue remains in the reviewed source-loading or installation changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 12 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: fixing OpenCode source import resolution and installed skills paths.
Description check ✅ Passed The description directly explains the OpenCode import-resolution and skills-path fixes, implementation approach, testing, and known validation limits.
Linked Issues check ✅ Passed Issue #3112 requires in-place OpenCode TypeScript sources to resolve adjacent modules, working tool and plugin barrels, and a ./skills path inside the OpenCode configuration directory. The PR change…
Out of Scope Changes check ✅ Passed The changes remain connected to issue #3112. The TypeScript minimum-version update supports rewriteRelativeImportExtensions. The shared content transformation and opencode-home operation planning …
Full details: Docstring Coverage

Explanation

Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 12 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

Safe to merge: the OpenCode home-install, installed source loading, and compiled payload loading flows completed successfully.

What we checked:

  • Compared the OpenCode home-install flow before and after the update to identify that the skills path changed from the old relative location to a local ./skills path. T-Rex
  • Validated that the updated path resolves to the local installed-skill, confirmed the bundled skill exists in the installed config root, and that TypeScript barrels load and JavaScript barrels compile while sharing changed-file state. T-Rex
  • Noted that the executable validation source and both outputs are attached for review. T-Rex
  • Ran the end-to-end OpenCode check script to compare HEAD~1 vs HEAD, observed an exit code of 1 before and 0 after, and captured the before/after logs. T-Rex
  • Documented the authored script source and the before/after log artifacts for the end-to-end check. T-Rex

Summary

  • This update fixes OpenCode home installation so bundled skills resolve from the installed configuration directory and local TypeScript sources resolve correctly when OpenCode loads them in place. The compiled OpenCode payload continues to load through JavaScript output paths.

Reviews (1) · Last reviewed commit: "fix: resolve OpenCode source imports and..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Problem] Bug: OpenCode app stops responding after installing ECC (ERR_MODULE_NOT_FOUND on custom tools)

1 participant