Skip to content

[pull] main from danny-avila:main - #64

Merged
pull[bot] merged 5 commits into
innFactory:mainfrom
LibreChat-AI:main
Apr 17, 2026
Merged

pull[bot] merged 5 commits into
innFactory:mainfrom
LibreChat-AI:main

Conversation

@pull

@pull pull Bot commented Apr 17, 2026 •

Copy link
Copy Markdown

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 : )

* 🔍 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: LibreChat-AI/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
@pull pull Bot locked and limited conversation to collaborators Apr 17, 2026
@pull pull Bot added the ⤵️ pull label Apr 17, 2026
@pull
pull Bot merged commit 1c7fccd into innFactory:main Apr 17, 2026

This branch had an error being deployed

1 failed deployment
publish — 1c7fccd2 Deployed Apr 17, 2026 by pull[bot] via publish #15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant