From dc5c4b21846c401e9640c4a4a0b5f5aa48098853 Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Fri, 4 Sep 2026 19:24:42 -0700 Subject: [PATCH] Fix: bound DeepSeek release-test requests Explicitly disable thinking for the bounded JSON edit harness and give steer the same timeout/retry limits as manual edits. Keep real provider calls and all browser assertions intact. Prepared with AI assistance under maintainer direction. --- tests/live-e2e-llm-agent.test.mjs | 12 ++++++++++++ tests/live-e2e/agents/llm-agent.mjs | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/tests/live-e2e-llm-agent.test.mjs b/tests/live-e2e-llm-agent.test.mjs index 193178d89..3d6f2d1f3 100644 --- a/tests/live-e2e-llm-agent.test.mjs +++ b/tests/live-e2e-llm-agent.test.mjs @@ -7,6 +7,7 @@ import { MANUAL_EDIT_SYSTEM_INSTRUCTIONS, VARIANT_SYSTEM_INSTRUCTIONS, createLlmAgent, + llmRequestSettings, parseManualEditResponse, parseVariantResponse, progressiveVariantGuidance, @@ -19,6 +20,17 @@ import { validateVariantVisibleCopy, } from './live-e2e/agents/llm-agent.mjs'; +describe('live-e2e LLM request settings', () => { + it('explicitly disables DeepSeek thinking for bounded JSON edit requests', () => { + assert.deepEqual(llmRequestSettings('deepseek'), { thinking: { type: 'disabled' } }); + }); + + it('leaves other providers unchanged', () => { + assert.deepEqual(llmRequestSettings('anthropic'), {}); + assert.deepEqual(llmRequestSettings('openai'), {}); + }); +}); + describe('live-e2e LLM agent provider config', () => { it('defaults to OpenAI gpt-5.6-terra at medium reasoning effort', () => { const config = resolveLlmAgentConfig({}, {}); diff --git a/tests/live-e2e/agents/llm-agent.mjs b/tests/live-e2e/agents/llm-agent.mjs index 4128ba924..d9fa82acf 100644 --- a/tests/live-e2e/agents/llm-agent.mjs +++ b/tests/live-e2e/agents/llm-agent.mjs @@ -248,6 +248,14 @@ function resolveProvider(opts, env) { return 'openai'; } +export function llmRequestSettings(provider) { + // DeepSeek defaults to high-effort thinking, which can consume the entire + // bounded response before emitting the JSON these edit tests exercise. + // Keep real model-generated edits, but make this harness mode explicit. + // https://api-docs.deepseek.com/guides/thinking_mode/ + return provider === 'deepseek' ? { thinking: { type: 'disabled' } } : {}; +} + /** * Anthropic-SDK-shaped shim over the `ai` SDK for OpenAI models, so the * three text-only call sites in this file stay provider-agnostic. system @@ -331,6 +339,7 @@ export async function createLlmAgent(opts = {}) { try { response = await client.messages.create( { + ...llmRequestSettings(provider), model, temperature: 0, max_tokens: 16000, @@ -476,6 +485,7 @@ export async function createLlmAgent(opts = {}) { try { response = await client.messages.create( { + ...llmRequestSettings(provider), model, temperature: 0, max_tokens: 16000, @@ -605,10 +615,14 @@ export async function createLlmAgent(opts = {}) { ].join('\n'); const response = await client.messages.create({ + ...llmRequestSettings(provider), model, max_tokens: 4096, system: systemBlocks(STEER_SYSTEM_INSTRUCTIONS), messages: [{ role: 'user', content: userMessage }], + }, { + maxRetries: LLM_REQUEST_MAX_RETRIES, + timeout: MANUAL_EDIT_REQUEST_TIMEOUT_MS, }); const cacheRead = response.usage?.cache_read_input_tokens ?? 0;