Skip to content

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

Merged
pull[bot] merged 5 commits intoinnFactory:mainfrom
danny-avila:main
Apr 17, 2026
Merged

[pull] main from danny-avila:main#64
pull[bot] merged 5 commits intoinnFactory:mainfrom
danny-avila:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 17, 2026

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