diff --git a/packages/subagent/subagent-claude-code/tests/real-deepseek.e2e.ts b/packages/subagent/subagent-claude-code/tests/real-deepseek.e2e.ts index 8ddba2c05f..eab7445ea5 100644 --- a/packages/subagent/subagent-claude-code/tests/real-deepseek.e2e.ts +++ b/packages/subagent/subagent-claude-code/tests/real-deepseek.e2e.ts @@ -20,7 +20,7 @@ import LocalSubprocessRuntime from '@deepseek-ai/dsh-subprocess-local' import * as claudeCode from '../src/index.ts' const execFileAsync = promisify(execFile) -const OFFICIAL_DEEPSEEK_BASE_URL = 'https://api.deepseek.com' +const OFFICIAL_DEEPSEEK_MESSAGES_BASE_URL = 'https://api.deepseek.com/anthropic' const DEEPSEEK_MODEL = 'deepseek-v4-flash' const sdkRoot = dirname(fileURLToPath( import.meta.resolve('@anthropic-ai/claude-agent-sdk'), @@ -48,15 +48,6 @@ afterEach(async () => { for (const root of roots.splice(0)) rmSync(root, { recursive: true, force: true }) }) -function deepSeekBaseUrl(): string { - const configured = (process.env.DEEPSEEK_BASE_URL ?? OFFICIAL_DEEPSEEK_BASE_URL) - .replace(/\/+$/, '') - if (configured !== OFFICIAL_DEEPSEEK_BASE_URL) { - throw new Error('Claude Code DeepSeek e2e requires the official DeepSeek base URL') - } - return configured -} - async function expectQuiescent(handles: readonly SubprocessHandle[]): Promise { expect(handles.length).toBeGreaterThan(0) for (const handle of handles) { @@ -90,7 +81,7 @@ describe.skipIf(!process.env.DEEPSEEK_API_KEY)( const env = { ANTHROPIC_AUTH_TOKEN: apiKey, - ANTHROPIC_BASE_URL: `${deepSeekBaseUrl()}/anthropic`, + ANTHROPIC_BASE_URL: OFFICIAL_DEEPSEEK_MESSAGES_BASE_URL, ANTHROPIC_MODEL: DEEPSEEK_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL: DEEPSEEK_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL: DEEPSEEK_MODEL, diff --git a/packages/subagent/subagent-codex/tests/deepseek-responses-bridge.ts b/packages/subagent/subagent-codex/tests/deepseek-responses-bridge.ts index b59738031e..2ff5c17d03 100644 --- a/packages/subagent/subagent-codex/tests/deepseek-responses-bridge.ts +++ b/packages/subagent/subagent-codex/tests/deepseek-responses-bridge.ts @@ -53,20 +53,11 @@ function taskText(body: Record): string { return typeof body.instructions === 'string' ? body.instructions : '' } -function deepSeekBaseUrl(): string { - const configured = (process.env.DEEPSEEK_BASE_URL ?? OFFICIAL_DEEPSEEK_BASE_URL) - .replace(/\/+$/, '') - if (configured !== OFFICIAL_DEEPSEEK_BASE_URL) { - throw new Error('Codex DeepSeek e2e requires the official DeepSeek base URL') - } - return configured -} - async function completeWithDeepSeek( authorization: string, task: string, ): Promise { - const response = await fetch(`${deepSeekBaseUrl()}/chat/completions`, { + const response = await fetch(`${OFFICIAL_DEEPSEEK_BASE_URL}/chat/completions`, { method: 'POST', headers: { authorization, diff --git a/scripts/ci-workflow.spec.ts b/scripts/ci-workflow.spec.ts index 5bbe466380..54c2074e82 100644 --- a/scripts/ci-workflow.spec.ts +++ b/scripts/ci-workflow.spec.ts @@ -828,12 +828,14 @@ describe('Python release workflows', () => { expect(String(realApiPreflightPosix.if)).toContain('head.repo.fork') expect(String(realApiPreflightPosix.if)).toContain('dependabot[bot]') expect(realApiPreflightWindows).toMatchObject({ shell: 'pwsh' }) - expect(installedRealApiPosix).toMatchObject({ - env: { - DEEPSEEK_API_KEY: '${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}', - DEEPSEEK_BASE_URL: 'https://api.deepseek.com', - }, - }) + for (const step of [installedRealApiPosix, installedRealApiWindows]) { + expect(step).toMatchObject({ + env: { + DEEPSEEK_API_KEY: '${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}', + DEEPSEEK_BASE_URL: 'https://api.deepseek.com/anthropic', + }, + }) + } expect(JSON.stringify(installedRealApiPosix)).toContain('--scenario sdk-live') expect(JSON.stringify(installedRealApiPosix)).toContain('-u DSH_RUNTIME_MODE') expect(installedRealApiWindows).toMatchObject({ shell: 'pwsh' })