Skip to content

fix(installer): install .opencode runtime dependencies on fresh/migrate#102

Merged
Steffen025 merged 1 commit intomainfrom
fix/installer-runtime-deps-after-merge
Apr 1, 2026
Merged

fix(installer): install .opencode runtime dependencies on fresh/migrate#102
Steffen025 merged 1 commit intomainfrom
fix/installer-runtime-deps-after-merge

Conversation

@Steffen025
Copy link
Copy Markdown
Owner

@Steffen025 Steffen025 commented Apr 1, 2026

This is the follow-up fix after PR #101 merge for the runtime dependency gap seen on fresh machines.

Problem:

  • pai startup path can execute .opencode/tools/switch-provider.ts
  • That script imports yaml
  • On fresh installs, .opencode/node_modules was not guaranteed to exist, causing: Cannot find package yaml

Changes:

  • PAI-Install/engine/steps-fresh.ts
    • Run bun install in repo root
    • Run bun install in .opencode/
    • Fail install with explicit error if dependency install fails
  • PAI-Install/engine/steps-migrate.ts
    • Run bun install in .opencode/ during migration finalization (best effort with warning)

Validation:

  • bun run PAI-Install/cli/quick-install.ts --help

This ensures .opencode/tools scripts have required runtime packages on clean machines.

Summary by CodeRabbit

Release Notes

  • New Features
    • Automatic runtime dependency installation now integrated into the fresh installation process with proper error handling
    • Dependency installation added to the migration workflow to ensure all required packages are available

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 94ffe63b-3d7c-4fdc-a42b-1476ba2ac526

📥 Commits

Reviewing files that changed from the base of the PR and between 39cc3f3 and a0b389e.

📒 Files selected for processing (2)
  • PAI-Install/engine/steps-fresh.ts
  • PAI-Install/engine/steps-migrate.ts

📝 Walkthrough

Walkthrough

The PR adds runtime dependency installation during the PAI installation process. It executes bun install commands in both the repository root and .opencode directory during fresh installation (with blocking error handling), and in the .opencode directory during migration (with non-blocking error handling). Progress tracking is updated accordingly.

Changes

Cohort / File(s) Summary
Runtime Dependency Installation
PAI-Install/engine/steps-fresh.ts, PAI-Install/engine/steps-migrate.ts
Both files now invoke bun install at specific points in the installation pipeline. The fresh install spawns bun install in both installDir and localOpencodeDir with blocking error handling (throws on non-zero exit), advancing progress to 97. The migration step adds a non-blocking bun install in paiDir/.opencode at progress 99, logging warnings on failure without interrupting completion.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #93: Introduces path/resolution changes to the installer flow that would directly interact with the new bun install invocations in both steps-fresh.ts and steps-migrate.ts.
  • PR #92: Modifies symlink and backup handling in the same stepInstallPAI flow, operating in close proximity to the newly added dependency installation sequence.
  • PR #94: Updates the fresh-install flow and .opencode directory handling, directly intersecting with the dependency installation logic added to steps-fresh.ts.

Poem

🐰 Dependencies installed with care,
Bun runs swift through the digital air,
Fresh installs and migrations unite,
As PAI prepares for flight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main change: adding runtime dependency installation for .opencode during fresh install and migration flows.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/installer-runtime-deps-after-merge

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 and usage tips.

@Steffen025 Steffen025 merged commit 372a751 into main Apr 1, 2026
3 checks passed
@Steffen025 Steffen025 deleted the fix/installer-runtime-deps-after-merge branch April 1, 2026 22:11
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.

1 participant