190proof 1.0.117 → 1.0.118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -290,7 +290,7 @@ Optional per-request knobs live on `payload` (`GenericPayload`):
290
290
  - `payload.streamTimeoutMs`: `number` - OpenRouter-only: total wall-clock budget per streaming attempt (default: 600000).
291
291
  - `payload.streamDeadlineAt`: `number` - OpenRouter-only: absolute deadline (epoch ms) for the whole call **including retries** — the caller's turn budget. Each attempt gets `min(streamTimeoutMs, deadline - now)`, and once under 10s remain the call fails fast instead of starting a generation that cannot be delivered. Use it whenever the caller has its own timeout: a per-attempt budget alone is re-granted on every retry and can outlive that timeout.
292
292
  - `payload.thinkingConfig`: `Record<string, unknown>` - Google-only: forwarded verbatim as `generationConfig.thinkingConfig` on the Gemini request — e.g. `{ thinkingBudget: 0 }` to disable thinking, `{ thinkingLevel: "HIGH" }` on models that take a level. Ignored by all other adapters; shapes are model-specific and validated by Google, not the SDK.
293
- - `payload.reasoningEffort`: `string` - OpenAI and OpenRouter: forwarded as `reasoning_effort` on the request. Valid values are model-dependent (`none`/`minimal`/`low`/`medium`/`high`/`xhigh`/`max`). Direct OpenAI: reasoning-by-default models (the gpt-5.6 family) reject function tools on `/chat/completions` with a 400 unless this is explicitly `"none"` — their implicit default is `medium`. Via OpenRouter the same models accept tools at any effort (OpenRouter fronts `/v1/responses`), so omitting this runs them at their native default. Ignored by all other adapters.
293
+ - `payload.reasoningEffort`: `string` - OpenAI and OpenRouter reasoning effort. Valid values are model-dependent (`none`/`minimal`/`low`/`medium`/`high`/`xhigh`/`max`). OpenRouter: sent as the nested `reasoning: { effort }` object — the canonical form, and the only one that accepts `max` (the flat `reasoning_effort` field caps at `xhigh`). Direct OpenAI: sent flat as `reasoning_effort`; `max` is rejected there, and reasoning-by-default models (the gpt-5.6 family) reject function tools on `/chat/completions` with a 400 unless this is explicitly `"none"` — their implicit default is `medium`. Via OpenRouter the same models accept tools at any effort (OpenRouter fronts `/v1/responses`), so omitting this runs them at their native default. Ignored by all other adapters.
294
294
 
295
295
  When a streaming attempt is cut at its **total deadline** and prose has already arrived, the partial answer is returned with `truncated: true` on the response rather than discarded — those tokens were generated and billed, so throwing them away costs money and gives the user nothing. Surface such a reply as incomplete. Salvage never applies to tool-call turns (half-streamed arguments are unparseable JSON), to stalls (the provider died mid-thought), or to caller aborts. When nothing is salvageable, the discard is logged with an approximate token count — aborted attempts never receive OpenRouter's `usage` chunk, so that log line is the only record of the wasted spend.
296
296
 
package/dist/index.d.mts CHANGED
@@ -296,14 +296,17 @@ interface GenericPayload {
296
296
  */
297
297
  provider?: OpenRouterProviderPreferences;
298
298
  /**
299
- * OpenAI and OpenRouter: forwarded as `reasoning_effort` on the request.
300
- * Valid values are model-dependent
299
+ * OpenAI and OpenRouter reasoning effort. Valid values are model-dependent
301
300
  * (`none`/`minimal`/`low`/`medium`/`high`/`xhigh`/`max`).
302
- * Direct OpenAI: reasoning-by-default models (gpt-5.6 family) 400 on
303
- * /chat/completions when function tools are present unless this is
304
- * explicitly `"none"` their implicit default is `medium`. Via OpenRouter
305
- * the same models accept tools at any effort (OpenRouter fronts
306
- * /v1/responses), so omitting this runs them at their native default.
301
+ * OpenRouter: sent as the nested `reasoning: { effort }` object (the
302
+ * canonical form, and the only one where `max` is accepted — flat
303
+ * `reasoning_effort` caps at `xhigh`, and on gpt-5.6-luna nested `max`
304
+ * measurably out-reasons `xhigh` despite docs calling them aliases).
305
+ * Direct OpenAI: sent flat as `reasoning_effort`; `max` is rejected there,
306
+ * and reasoning-by-default models (gpt-5.6 family) 400 on /chat/completions
307
+ * when function tools are present unless this is explicitly `"none"` —
308
+ * their implicit default is `medium`. Via OpenRouter the same models accept
309
+ * tools at any effort (OpenRouter fronts /v1/responses).
307
310
  * Ignored by all other adapters.
308
311
  */
309
312
  reasoningEffort?: string;
package/dist/index.d.ts CHANGED
@@ -296,14 +296,17 @@ interface GenericPayload {
296
296
  */
297
297
  provider?: OpenRouterProviderPreferences;
298
298
  /**
299
- * OpenAI and OpenRouter: forwarded as `reasoning_effort` on the request.
300
- * Valid values are model-dependent
299
+ * OpenAI and OpenRouter reasoning effort. Valid values are model-dependent
301
300
  * (`none`/`minimal`/`low`/`medium`/`high`/`xhigh`/`max`).
302
- * Direct OpenAI: reasoning-by-default models (gpt-5.6 family) 400 on
303
- * /chat/completions when function tools are present unless this is
304
- * explicitly `"none"` their implicit default is `medium`. Via OpenRouter
305
- * the same models accept tools at any effort (OpenRouter fronts
306
- * /v1/responses), so omitting this runs them at their native default.
301
+ * OpenRouter: sent as the nested `reasoning: { effort }` object (the
302
+ * canonical form, and the only one where `max` is accepted — flat
303
+ * `reasoning_effort` caps at `xhigh`, and on gpt-5.6-luna nested `max`
304
+ * measurably out-reasons `xhigh` despite docs calling them aliases).
305
+ * Direct OpenAI: sent flat as `reasoning_effort`; `max` is rejected there,
306
+ * and reasoning-by-default models (gpt-5.6 family) 400 on /chat/completions
307
+ * when function tools are present unless this is explicitly `"none"` —
308
+ * their implicit default is `medium`. Via OpenRouter the same models accept
309
+ * tools at any effort (OpenRouter fronts /v1/responses).
307
310
  * Ignored by all other adapters.
308
311
  */
309
312
  reasoningEffort?: string;
package/dist/index.js CHANGED
@@ -1414,7 +1414,11 @@ function prepareOpenRouterPayload(payload) {
1414
1414
  tool_choice: payload.function_call ? typeof payload.function_call === "string" ? payload.function_call : { type: "function", function: payload.function_call } : void 0,
1415
1415
  temperature: payload.temperature,
1416
1416
  provider: payload.provider,
1417
- reasoning_effort: payload.reasoningEffort
1417
+ // Nested form is OpenRouter's canonical param and the only one that
1418
+ // accepts "max" (flat reasoning_effort rejects it — OpenAI enum tops out
1419
+ // at xhigh, and measured on gpt-5.6-luna nested max buys more reasoning
1420
+ // tokens than xhigh despite the docs calling them equivalent).
1421
+ reasoning: payload.reasoningEffort ? { effort: payload.reasoningEffort } : void 0
1418
1422
  };
1419
1423
  }
1420
1424
  var DSML_ENVELOPE_RE = /<|+DSML|+tool_calls>/;