mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-09-12 17:43:39 +00:00
A summarizer that reuses the main agent's client options silently inherits the agent's reasoning effort: `summarization.parameters.reasoning_effort` is a scalar, and every OpenAI-compatible LangChain client reads only `reasoning` from constructor fields — `reasoning_effort` is a call-time option, so it is dropped outright. A hidden summary configured for `low` runs at whatever the agent resolved, and the yaml schema (scalars only) gives users no way to express the nested shape themselves. Translate the scalar the way the main flow's `getOpenAIConfig` does, into the top-level `reasoning` object the client honors. Top-level rather than nested, because the SDK spreads `parameters` onto the agent's client options: a `modelKwargs` fragment would replace the agent's `modelKwargs` wholesale, while `reasoning` merges over an inherited `modelKwargs.reasoning` in `ChatOpenRouter` and is re-emitted as `reasoning_effort` by Chat Completions. OpenRouter's adaptive Anthropic models keep the main flow's mapping, where effort is expressed as `verbosity` rather than `reasoning.effort`. Also prefer the provider `getOpenAIConfig` detects over the one `getProviderConfig` reports, so a cross-endpoint summarizer pointed at an OpenRouter endpoint whose config name isn't `openrouter` builds the same client the main agent flow builds for it. Supersedes #15088; thanks to @flamerged for the diagnosis and the OpenRouter repro. |
||
|---|---|---|
| .. | ||
| src | ||
| types | ||
| .gitignore | ||
| babel.config.cjs | ||
| jest.config.mjs | ||
| jest.setup.cjs | ||
| package.json | ||
| tsconfig-paths-bootstrap.mjs | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| tsconfig.spec.json | ||
| tsdown.config.mjs | ||