Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs-site/src/content/docs/es/guides/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Un **proveedor** es un punto final de LLM ascendente más cómo llegar a él: un

La vista general del proveedor del panel separa los detalles de conexión, el uso de la cuenta y las notas editables. Las notas aparecen una vez, debajo de las secciones de conexión y autenticación. Los ajustes preestablecidos de patrocinador compatibles también muestran una breve introducción, una etiqueta de patrocinador y enlaces al sitio o consola del proveedor. Estos enlaces conservan los parámetros de referencia del preset. La información del patrocinador se muestra solo cuando el nombre del proveedor configurado, el adaptador y el punto final coinciden con el ajuste preestablecido; nunca cambia el enrutamiento, la selección de la cuenta o los valores predeterminados.

<a id="reasoning-effort-rejection-diagnostics"></a>

## Diagnósticos de rechazo del esfuerzo de razonamiento

Los reintentos al mismo proveedor y modelo con un esfuerzo menor, y el aprendizaje de niveles no admitidos, usan un diagnóstico de error completo de hasta 1.024 unidades de código UTF-16, incluido cualquier texto envolvente. Un diagnóstico mayor no autoriza estos reintentos ni el aprendizaje a partir de su prefijo. El cuerpo original sigue disponible para el manejo habitual de errores, incluida la conmutación ordinaria de Combo; se mantienen los límites existentes de visualización de errores del cliente. Un error legítimo pero demasiado largo tampoco activa la reducción automática del esfuerzo ni actualiza los niveles aprendidos. Los diagnósticos breves como `cannot use parameter 'reasoning_effort'` siguen identificando el esfuerzo; un campo ajeno real sigue bloqueando el reintento y el aprendizaje.

<a id="openai-account-modes"></a>

## Modos de cuenta OpenAI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ description: "Entradas de proveedores, autenticación, puntos finales, catálogo

Un proveedor le dice a opencodex dónde vive un modelo, qué adaptador de cable habla y cómo se autentican las solicitudes.

<a id="reasoning-effort-rejection-diagnostics"></a>

## Diagnósticos de rechazo del esfuerzo de razonamiento

Consulte los [límites de los diagnósticos de esfuerzo de razonamiento](/es/guides/providers/#reasoning-effort-rejection-diagnostics) antes de depender de la reducción automática del esfuerzo o del aprendizaje de niveles admitidos.

<a id="deepseek-tokens-versus-image-bytes"></a>

## DeepSeek: tokens y bytes de imágenes
Expand Down
11 changes: 11 additions & 0 deletions docs-site/src/content/docs/guides/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ account selection or defaults.
While a provider login is in progress, its Accounts panel offers **Cancel** once sign-in
instructions appear.

## Reasoning-effort rejection diagnostics

Automatic retries of the same provider and model at a lower effort, and learned unsupported
efforts, use a complete upstream error diagnostic of at most 1,024 UTF-16 code units, including
any wrapper text. Larger diagnostics cannot authorize this retry or learning from their prefix.
The original error body remains available to normal handling, including ordinary Combo failover;
existing client error-display limits still apply. A long but legitimate effort error therefore
does not trigger automatic effort repair or update the learned effort ladder. Short diagnostics such as
`cannot use parameter 'reasoning_effort'` still identify effort; an actual unrelated field
continues to block this retry and learning.

## OpenAI account modes

| Provider id | Use | Credential/account rule |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ description: 공급자 항목, 인증, 엔드포인트, 모델 카탈로그, 할

공급자는 opencodex에 모델의 위치, 사용하는 와이어 어댑터, 요청 인증 방식을 알려줍니다.

<a id="reasoning-effort-rejection-diagnostics"></a>

## 추론 수준 거절 진단

같은 공급자·모델로 추론 수준을 낮춰 다시 보내는 복구와 미지원 수준 학습은 래퍼를 포함한 전체 오류 진단이 UTF-16 코드 단위 1,024개 이하일 때만 수행합니다. 이 한도를 넘으면 앞부분만 근거로 재시도·학습하지 않습니다. 일반 Combo 전환을 포함한 기존 오류 처리에 원문을 그대로 전달하며, 기존 클라이언트 오류 표시 길이 제한은 계속 적용됩니다. 정상적인 오류라도 길이가 한도를 넘으면 자동 하향·학습 대상이 되지 않습니다. `cannot use parameter 'reasoning_effort'` 같은 짧은 진단은 추론 수준 거절로 인식하며, 실제로 다른 필드를 지목한 오류는 계속 재시도·학습을 막습니다.

## Mistral 요청당 이미지 수

Mistral 요청의 이미지 수 제한과 `mistralMaxImages` 설정은 [영문 기준 문서](/reference/configuration/providers/#mistral-images-per-request)를 참조하세요. 제한기에 도달한 `image_url` 항목의 이미지 참조가 누락되거나 비어 있거나 문자열이 아니면 전송용 사본에서 텍스트로 대체되며 이미지 한도를 소비하지 않습니다. 번역되는 Responses 요청에서 사용 가능한 URL과 파일 ID가 모두 없는 `input_image`는 파서가 제외합니다. 메시지나 도구 출력 블록 안에서 비어 있지 않은 `file_id`만 있고 비어 있지 않은 `image_url`이 없으면 미디어 가드가 Mistral 전송 전에 요청을 거절합니다. 가드가 검사하지 않는 재생된 `agent_message` 내부에서는 파서가 대신 `[image: <file id>]` 텍스트 마커를 내보내며 일반 텍스트로 전송되고 이미지 한도를 소비하지 않습니다. 제한기는 `image_url` 또는 `image_url.url`의 비어 있지 않은 문자열만 계산하고 URL 문법이나 접근 가능성은 검증하지 않습니다. 다른 대상의 동작은 바뀌지 않습니다.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,10 @@ their previous behavior. See the
[ordering migration note](/guides/model-ordering/#migration-note-native-ids-in-existing-orders).
`modelDisplayNames` on a provider controls readable labels without changing wire ids.

## Reasoning-effort rejection diagnostics

See the [reasoning-effort diagnostic limits](/guides/providers/#reasoning-effort-rejection-diagnostics) before relying on automatic effort repair or learned effort support.

## Routed agent messages

With the [`openai-responses` adapter](/reference/adapters/#openai-responses), Codex
Expand Down
2 changes: 1 addition & 1 deletion src/combos/failover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ function isExactInvalidReasoningEffortRefusal(status: number, message: string, c
if (code !== undefined && code !== null && typeof code !== "string") return false;
const outerCode = normalizedFailureCode(code);
if (!EXACT_EFFORT_COMPATIBLE_CODES.has(outerCode)) return false;
if (isHardPolicyOrOriginRefusal(message) || hasConflictingReasoningEffortCode(message)) return false;
if (isHardPolicyOrOriginRefusal(message) || hasConflictingReasoningEffortCode(message, 16_384)) return false;
let text = message.trim();
for (let depth = 0; depth < 3; depth += 1) {
if (text.startsWith("Provider error 400: ")) text = text.slice("Provider error 400: ".length).trim();
Expand Down
26 changes: 22 additions & 4 deletions src/providers/reasoning-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,12 @@ const REJECTION_LANGUAGE = /unsupported|not supported|does not support|invalid|n
* every 400 that mentions effort as a refusal of it.
*/
const REJECTION_WINDOW = 48;
/**
* Optional effort repair only analyzes a complete, short diagnostic (UTF-16 code units).
* Longer input is conflicting evidence, never a prefix to retry or learn from. This bounds
* the remaining heuristic scans; it does not truncate the upstream response body.
*/
const MAX_REASONING_DIAGNOSTIC_CHARS = 1_024;

/**
* The `invalid_request_error` type tag rides along on essentially every 400 an OpenAI-shaped
Expand Down Expand Up @@ -951,7 +957,7 @@ function diagnosticTextNamesOtherParameter(text: string, authoritativeEffortSubj
const s = text.replace(GENERIC_ERROR_TYPE, " ");
if (authoritativeEffortSubject) return diagnosticTextNamesConcreteOtherField(s);

const paramPattern = /\b(?:parameter|param|argument|arg|field|property)\s*(?:[:=]\s*['"`]?|['"`]|\s+)['"`]?([a-zA-Z0-9_\-\.]+)['"`]?/gi;
const paramPattern = /\b(?:parameter|param|argument|arg|field|property)(?:\s*[:=]\s*['"`]?|\s*['"`]|\s+)['"`]?([a-zA-Z0-9_\-\.]+)['"`]?/gi;
for (let m = paramPattern.exec(s); m; m = paramPattern.exec(s)) {
const tokenIndex = tokenStartIndex(m, m[1], false);
if (isCompetingParameterToken(s, tokenIndex, m[1])) return true;
Expand All @@ -960,6 +966,11 @@ function diagnosticTextNamesOtherParameter(text: string, authoritativeEffortSubj
const prefixParamPattern = /\b['"`]?([a-zA-Z0-9_\-\.]+)['"`]?\s+(?:parameter|param|argument|arg|field|property)\b/gi;
for (let m = prefixParamPattern.exec(s); m; m = prefixParamPattern.exec(s)) {
const tokenIndex = tokenStartIndex(m, m[1], true);
const beforeToken = s.slice(0, tokenIndex);
// In "cannot use parameter 'x'", use introduces the label, not a field named use.
// Quoted field names and verbs outside that diagnostic phrase remain competing subjects.
if (!/['"`]$/.test(beforeToken) && (m[1].toLowerCase() === "missing"
|| (/^(?:specify|use|set|pass|provide)$/i.test(m[1]) && /\bcannot\s+$/i.test(beforeToken)))) continue;
if (isCompetingParameterToken(s, tokenIndex, m[1])) return true;
}

Expand All @@ -984,7 +995,7 @@ function diagnosticTextNamesOtherParameter(text: string, authoritativeEffortSubj
}

const rejectionExtra =
/\b(?:unexpected|missing|cannot\s+(?:specify|use|set|pass|provide))\s+(?:field|param|parameter|argument|property)?\s*['"`]?([a-zA-Z0-9_\-\.]+)['"`]?/gi;
/\b(?:unexpected|missing|cannot\s+(?:specify|use|set|pass|provide))\s+(?:(?:field|param|parameter|argument|property)\b\s*)?['"`]?([a-zA-Z0-9_\-\.]+)['"`]?/gi;
for (let m = rejectionExtra.exec(s); m; m = rejectionExtra.exec(s)) {
const tokenIndex = tokenStartIndex(m, m[1], false);
if (isCompetingParameterToken(s, tokenIndex, m[1])) return true;
Expand All @@ -1007,6 +1018,7 @@ function diagnosticTextNamesOtherParameter(text: string, authoritativeEffortSubj

function isConflictingDiagnosticProse(str: string | undefined, authoritativeEffortSubject = false): boolean {
if (!str) return false;
if (str.length > MAX_REASONING_DIAGNOSTIC_CHARS) return true;
const s = str.trim();
if (!s) return false;
if (
Expand Down Expand Up @@ -1054,8 +1066,14 @@ function isHttpStatusNumber(value: unknown): boolean {
* (e.g. reasoning_effort at root with an inner error identifying temperature) so they stay terminal
* or proceed to combo failover without false reasoning-effort learning or same-target ladder retries (#8173).
*/
export function hasConflictingReasoningEffortCode(text: string | undefined): boolean {
export function hasConflictingReasoningEffortCode(
text: string | undefined,
maxEnvelopeChars: 1_024 | 16_384 = MAX_REASONING_DIAGNOSTIC_CHARS,
): boolean {
if (!text) return false;
// Exact-refusal failover may inspect a larger complete envelope; prose heuristics
// retain the short limit even when unrelated metadata makes that envelope larger.
if (text.length > maxEnvelopeChars) return true;
if (isIncompleteStructuredWrapper(text)) return true;
let unescaped = text.trim();
for (let d = 0; d < 3; d += 1) {
Expand Down Expand Up @@ -1333,7 +1351,7 @@ function diagnosticRecordBlamesReasoningEffort(rec: Record<string, unknown>, dep
* (such as temperature or max_tokens errors) as effort refusals (#8173).
*/
export function isReasoningEffortRejection(text: string | undefined, depth = 0): boolean {
if (!text || depth > 4) return false;
if (!text || text.length > MAX_REASONING_DIAGNOSTIC_CHARS || depth > 4) return false;
if (isHardPolicyOrOriginRefusal(text)) return false;
if (hasConflictingReasoningEffortCode(text)) return false;

Expand Down
Loading
Loading