Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/roast/workflow/configuration_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ def load_roast_initializers
def configure_api_client
return unless configuration.api_token

existing_client = !!(Raix.configuration.openrouter_client || Raix.configuration.openai_client)
return if existing_client

begin
case configuration.api_provider
when :openrouter
Expand Down
7 changes: 7 additions & 0 deletions test/roast/workflow/configuration_parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ def test_initialize_with_example_workflow
assert_equal("run_coverage", @parser.configuration.steps.first)
end

def test_with_existing_api_client_does_not_configure_new_api_client
openai_client = OpenAI::Client.new(access_token: "test")
Raix.configuration.openai_client = openai_client
Roast::Workflow::ConfigurationParser.new(@workflow_path)
assert_equal(openai_client, Raix.configuration.openai_client)
end

def test_begin_without_files_or_target_runs_targetless_workflow
executor = mock("WorkflowExecutor")
executor.stubs(:execute_steps)
Expand Down