From fe5696d1193636a08a4049b07f2afc7ae055d5cf Mon Sep 17 00:00:00 2001 From: Hampton Lintorn-Catlin Date: Tue, 2 Jun 2026 16:26:27 -0500 Subject: [PATCH] Require ruby-openai in engine entry point MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The engine's gemspec declares ruby-openai as a runtime dependency, but engine/lib/coplan.rb never required it — so the OpenAI constant isn't defined for gem consumers that don't separately list it in their own Gemfile. The local worktree test suite happened to pass because the host Gemfile here also lists `gem "ruby-openai"`, masking the missing require. Downstream hosts (coplan-square) consuming only coplan-engine hit: NameError: uninitialized constant CoPlan::AiProviders::OpenAi::OpenAI ...in app/services/coplan/ai_providers/open_ai.rb:15 `client = OpenAI::Client.new(...)` Add `require "openai"` alongside the existing `require "commonmarker"` / `require "diffy"` so the engine self-loads its declared deps. Amp-Thread-ID: https://ampcode.com/threads/T-019e84ca-1d09-777c-baf1-b1f380ec013c Co-authored-by: Amp --- engine/lib/coplan.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/lib/coplan.rb b/engine/lib/coplan.rb index a8a7f62..c61b165 100644 --- a/engine/lib/coplan.rb +++ b/engine/lib/coplan.rb @@ -1,5 +1,6 @@ require "commonmarker" require "diffy" +require "openai" require "coplan/configuration" require "coplan/analytics" require "coplan/engine"