From a4d365c8f2bd416cb5bc9f765dd567c59a94f7ee Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 8 May 2026 16:14:28 +0700 Subject: [PATCH] fix server-ci: install only claude-code, set SDK path in contract test Two regressions from the previous CI install: - Installing opencode-ai globally in server-ci/server-tests caused opencode-agent.test.ts (gated on \`hasOpenCode\`) to start running for the first time and surface real but unrelated test breakage. Trim the install to claude-code, which is all that's needed for the Claude e2e tests that motivated the change. - claude-agent.integration.test.ts's supportedModels test calls the SDK's \`query()\` directly (bypassing ClaudeAgentClient) and didn't pass \`pathToClaudeCodeExecutable\`. The 0.2.71 SDK had a bundled cli.js fallback; 0.2.133 doesn't, so on Ubuntu CI it tries the per-platform binary path (\`...claude-agent-sdk-linux-x64-musl/claude\`) which isn't installed via the \`claude-code\` global. Resolve the binary explicitly in the test and pass it as the SDK option. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/server-ci.yml | 4 ++-- .../server/agent/providers/claude-agent.integration.test.ts | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82fe404b9..dc23fb704 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,8 +88,8 @@ jobs: - name: Install dependencies run: npm install - - name: Install agent CLIs for provider tests - run: npm install -g @anthropic-ai/claude-code @openai/codex@0.105.0 opencode-ai + - name: Install Claude Code CLI for provider tests + run: npm install -g @anthropic-ai/claude-code - name: Build highlight dependency run: npm run build --workspace=@getpaseo/highlight diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index f70523712..8bd999c9f 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -36,8 +36,8 @@ jobs: - name: Install server dependencies run: npm install --workspace=@getpaseo/server --include-workspace-root - - name: Install agent CLIs for provider tests - run: npm install -g @anthropic-ai/claude-code @openai/codex@0.105.0 opencode-ai + - name: Install Claude Code CLI for provider tests + run: npm install -g @anthropic-ai/claude-code - name: Build highlight dependency run: npm run build --workspace=@getpaseo/highlight diff --git a/packages/server/src/server/agent/providers/claude-agent.integration.test.ts b/packages/server/src/server/agent/providers/claude-agent.integration.test.ts index a83db5367..262ed37f3 100644 --- a/packages/server/src/server/agent/providers/claude-agent.integration.test.ts +++ b/packages/server/src/server/agent/providers/claude-agent.integration.test.ts @@ -6,7 +6,7 @@ import pino from "pino"; import { query, type SDKUserMessage } from "@anthropic-ai/claude-agent-sdk"; import type { AgentSession, AgentStreamEvent, ToolCallTimelineItem } from "../agent-sdk-types.js"; -import { isCommandAvailable } from "../../../utils/executable.js"; +import { findExecutable, isCommandAvailable } from "../../../utils/executable.js"; import { withTimeout } from "../../../utils/promise-timeout.js"; import { ClaudeAgentClient } from "./claude-agent.js"; import { streamSession } from "./test-utils/session-stream-adapter.js"; @@ -223,6 +223,8 @@ describe("ClaudeAgentSession integration", () => { }, 60_000); test("supportedModels returns the current abstract Claude SDK model shape", async () => { + const claudeBinary = await findExecutable("claude"); + if (!claudeBinary) throw new Error("claude binary required for this integration test"); const claudeQuery = query({ prompt: createEmptyPrompt(), options: { @@ -230,6 +232,7 @@ describe("ClaudeAgentSession integration", () => { permissionMode: "plan", includePartialMessages: false, settingSources: ["user", "project"], + pathToClaudeCodeExecutable: claudeBinary, }, });