mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-18 17:16:46 +03:00
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.
This commit is contained in:
@@ -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({}, {});
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user