feat(workflow-executor): server-side AI fallback #1530
Merged
Scra3 merged 1 commit intofeat/prd-214-setup-workflow-executor-packagefrom Apr 7, 2026
Merged
Conversation
4e447cf to
fb8c9f3
Compare
1 new issue
|
4970993 to
9c5ad21
Compare
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (4)
🛟 Help
|
9c5ad21 to
d6fa215
Compare
Introduce AiModelPort interface (same pattern as AgentPort, WorkflowPort) with two implementations: - AiClientAdapter: wraps AiClient for user-provided aiConfigurations - ServerAiAdapter: ChatOpenAI with baseURL pointing to FA server, JWT per step with userId/runId/stepIndex for monitoring aiConfigurations becomes optional in ExecutorOptions. Zero changes in ai-proxy — all fallback logic stays in workflow-executor. fixes PRD-271 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d6fa215 to
dfd2d3e
Compare
f815eca
into
feat/prd-214-setup-workflow-executor-package
30 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
When
aiConfigurationsis empty or not provided, the executor automatically falls back to the Forest Admin server AI proxy viaChatOpenAIwith a custombaseURL.What changes
aiConfigurationsbecomes optional inExecutorOptionsAiConfigurationwithbaseURLpointing to{forestServerUrl}/liana/v1envSecretused asapiKeyfor authai-proxy— the fallback is a standard configWhat doesn't change
model.invoke()/model.bindTools()transparentlyDependency
Requires PRD-270 (server route
POST /liana/v1/chat/completions)Test plan
yarn workspace @forestadmin/workflow-executor test— 427 tests passyarn workspace @forestadmin/workflow-executor tsc --noEmit— compilesfixes PRD-271
🤖 Generated with Claude Code
Note
Add server-side AI proxy fallback to workflow executor
AiModelPortinterface in ai-model-port.ts to abstract AI model acquisition, replacing directAiClientusage throughout the executor.ServerAiAdapterin server-ai-adapter.ts, which routes LLM calls through the Forest Admin server proxy (/liana/v1/ai-proxy) using per-step signed JWTs containingenvId,userId,runId, andstepIndex.AiClientAdapterin ai-client-adapter.ts wrapping the existingAiClientfor whenaiConfigurationsare explicitly provided.buildCommonDependenciesin build-workflow-executor.ts selectsAiClientAdapterwhenaiConfigurationsare provided, and falls back toServerAiAdapterotherwise;aiConfigurationsis now optional.PendingStepExecutionnow requires a newenvIdfield; callers constructing step executions must provide it.Macroscope summarized dfd2d3e.