[pull] main from danny-avila:main#64
Merged
pull[bot] merged 5 commits intoinnFactory:mainfrom Apr 17, 2026
Merged
Conversation
* 🔍 fix: exclude deferred tools from instruction token accounting Deferred tool definitions (used for tool_search) were counted in `toolSchemaTokens` and `getTokenBudgetBreakdown().toolCount` even though they are never bound to the model until discovered. This mismatch with `getEventDrivenToolsForBinding` inflated the reported instruction token count (e.g. 292 tools for a LibreChat MCP registry) and produced spurious context-overflow errors. Both paths now go through a new `getActiveToolDefinitions()` helper that filters out `defer_loading === true` entries unless they are already in `discoveredToolNames`, matching the filter applied at bind time. Refs: danny-avila/LibreChat#12702 * chore: address review feedback on token accounting fix - Correct JSDoc on getActiveToolDefinitions: it filters for token accounting, not bind-time (code_execution-only tools still pass). - Note the staleness asymmetry on getTokenBudgetBreakdown: toolCount is live after markToolsAsDiscovered but toolSchemaTokens is a snapshot. - Add regression test pinning the snapshot semantic so future changes must intentionally re-evaluate whether discovery should recompute.
…ve display (#106) Extends `ThinkingConfig` with a `ThinkingConfigAdaptive` variant carrying an optional `display: 'summarized' | 'omitted'` field, and overrides the `thinking` property on `AnthropicClientOptions` via `Omit<AnthropicInput, 'thinking'>` so callers can pass `{ type: 'adaptive', display: 'summarized' }` without casting. Claude Opus 4.7 omits reasoning content by default unless the caller opts in via `thinking.display = 'summarized'`, so downstream consumers (LibreChat `packages/api/src/endpoints/anthropic/helpers.ts`) previously had to cast through `AnthropicClientOptions['thinking']`. Ref: https://platform.claude.com/docs/en/about-claude/models/whats-new-claude-4-7#thinking-content-omitted-by-default
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )