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
This commit is contained in:
darrenhinde 2025-11-26 22:16:41 +00:00
parent 81be19c768
commit 9949220e03
2 changed files with 5 additions and 29 deletions

View file

@ -28,16 +28,6 @@ jobs:
cache: 'npm' cache: 'npm'
cache-dependency-path: 'evals/framework/package-lock.json' 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 - name: Install dependencies
working-directory: evals/framework working-directory: evals/framework
run: npm install run: npm install
@ -47,9 +37,7 @@ jobs:
run: npm run build run: npm run build
- name: Run OpenAgent smoke test - name: Run OpenAgent smoke test
run: | run: npm run test:ci:openagent
export PATH="$HOME/.opencode/bin:$PATH"
npm run test:ci:openagent
env: env:
CI: true CI: true
@ -77,16 +65,6 @@ jobs:
cache: 'npm' cache: 'npm'
cache-dependency-path: 'evals/framework/package-lock.json' 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 - name: Install dependencies
working-directory: evals/framework working-directory: evals/framework
run: npm install run: npm install
@ -96,9 +74,7 @@ jobs:
run: npm run build run: npm run build
- name: Run OpenCoder smoke test - name: Run OpenCoder smoke test
run: | run: npm run test:ci:opencoder
export PATH="$HOME/.opencode/bin:$PATH"
npm run test:ci:opencoder
env: env:
CI: true CI: true
@ -248,4 +224,3 @@ jobs:
git push origin main --tags git push origin main --tags
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Test comment

View file

@ -23,8 +23,9 @@ export class ServerManager {
constructor(private config: ServerConfig = {}) { constructor(private config: ServerConfig = {}) {
this.port = config.port || 0; // 0 = random port this.port = config.port || 0; // 0 = random port
this.hostname = config.hostname || '127.0.0.1'; this.hostname = config.hostname || '127.0.0.1';
// Always use manual spawn for now (SDK integration needs more work) // Use SDK when agent is specified (better for CI/CD)
this.useSDK = false; // Falls back to manual spawn when no agent specified
this.useSDK = !!config.agent;
} }
/** /**