From 9949220e03f04476ec5e281d570203df1b6addef Mon Sep 17 00:00:00 2001 From: darrenhinde <107584450+darrenhinde@users.noreply.github.com> Date: Wed, 26 Nov 2025 22:16:41 +0000 Subject: [PATCH] fix(evals): enable SDK mode for server when agent is specified - Changes ServerManager to use SDK when agent config is provided - SDK mode uses @opencode-ai/sdk's createOpencode() instead of spawning CLI - Fixes CI/CD tests that were failing due to missing opencode CLI - SDK is already installed as dependency, no external tools needed - Simplifies workflow by removing CLI installation steps --- .github/workflows/test-agents.yml | 29 ++--------------------- evals/framework/src/sdk/server-manager.ts | 5 ++-- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/.github/workflows/test-agents.yml b/.github/workflows/test-agents.yml index 55e5148..1a0b7a3 100644 --- a/.github/workflows/test-agents.yml +++ b/.github/workflows/test-agents.yml @@ -28,16 +28,6 @@ jobs: cache: 'npm' cache-dependency-path: 'evals/framework/package-lock.json' - - name: Install OpenCode CLI - run: | - curl -fsSL https://raw.githubusercontent.com/OpenAgentsInc/opencode/main/install.sh | bash - echo "$HOME/.opencode/bin" >> $GITHUB_PATH - - - name: Verify OpenCode installation - run: | - export PATH="$HOME/.opencode/bin:$PATH" - opencode --version - - name: Install dependencies working-directory: evals/framework run: npm install @@ -47,9 +37,7 @@ jobs: run: npm run build - name: Run OpenAgent smoke test - run: | - export PATH="$HOME/.opencode/bin:$PATH" - npm run test:ci:openagent + run: npm run test:ci:openagent env: CI: true @@ -77,16 +65,6 @@ jobs: cache: 'npm' cache-dependency-path: 'evals/framework/package-lock.json' - - name: Install OpenCode CLI - run: | - curl -fsSL https://raw.githubusercontent.com/OpenAgentsInc/opencode/main/install.sh | bash - echo "$HOME/.opencode/bin" >> $GITHUB_PATH - - - name: Verify OpenCode installation - run: | - export PATH="$HOME/.opencode/bin:$PATH" - opencode --version - - name: Install dependencies working-directory: evals/framework run: npm install @@ -96,9 +74,7 @@ jobs: run: npm run build - name: Run OpenCoder smoke test - run: | - export PATH="$HOME/.opencode/bin:$PATH" - npm run test:ci:opencoder + run: npm run test:ci:opencoder env: CI: true @@ -248,4 +224,3 @@ jobs: git push origin main --tags env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# Test comment diff --git a/evals/framework/src/sdk/server-manager.ts b/evals/framework/src/sdk/server-manager.ts index 8d307b5..04f5bfb 100644 --- a/evals/framework/src/sdk/server-manager.ts +++ b/evals/framework/src/sdk/server-manager.ts @@ -23,8 +23,9 @@ export class ServerManager { constructor(private config: ServerConfig = {}) { this.port = config.port || 0; // 0 = random port this.hostname = config.hostname || '127.0.0.1'; - // Always use manual spawn for now (SDK integration needs more work) - this.useSDK = false; + // Use SDK when agent is specified (better for CI/CD) + // Falls back to manual spawn when no agent specified + this.useSDK = !!config.agent; } /**