Просмотр исходного кода

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
darrenhinde 8 месяцев назад
Родитель
Сommit
9949220e03
2 измененных файлов с 5 добавлено и 29 удалено
  1. 2 27
      .github/workflows/test-agents.yml
  2. 3 2
      evals/framework/src/sdk/server-manager.ts

+ 2 - 27
.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

+ 3 - 2
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;
   }
 
   /**