📦 chore: Bump @librechat/agents to v3.1.56#12258
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bumps the backend dependency @librechat/agents from v3.1.55 to v3.1.56 across the backend workspaces and updates the root lockfile to match, keeping the monorepo’s runtime dependencies in sync.
Changes:
- Update
@librechat/agentsversion to^3.1.56inapi/package.jsonandpackages/api/package.json. - Update
package-lock.jsonto resolve@librechat/agents@3.1.56(including its updated dependency set).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/api/package.json | Bumps @librechat/agents peer dependency to ^3.1.56 for the TS backend package. |
| api/package.json | Bumps @librechat/agents dependency to ^3.1.56 for the legacy backend workspace. |
| package-lock.json | Updates resolved @librechat/agents tarball/integrity and dependency graph to 3.1.56. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
jcbartle
pushed a commit
to jcbartle/LibreChat
that referenced
this pull request
May 11, 2026
* 📦 chore: Bump `@librechat/agents` to v3.1.56 * chore: resolve type error, URL property check in isMCPDomainAllowed function
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
@librechat/agentsv3.1.55 → v3.1.56 — Change Summary7 commits between the two tags (excluding the tag commits themselves), spanning March 8–16, 2026.
1.
d3af1da— feat: Add CI Workflow for PRsFiles:
.github/workflows/ci.yml(new, +179),publish.yml(+17/-19)What changed: A brand-new GitHub Actions CI pipeline was created from scratch. It installs deps with
node_modulescaching, runs lint (eslint), type-checks (tsc --noEmit), runs core tests, and then conditionally runs integration test suites for Google/Anthropic LLMs and PTC/Tool Search only when files in those directories actually changed. The publish workflow was also cleaned up.Why it matters: Before this, there was no automated CI on PRs. Code could land with type errors, lint violations, or broken tests without any automated gate. Now every PR runs the full quality pipeline, and expensive LLM integration tests only fire when relevant code changes.
Before: No CI on PRs. Publish workflow had no lint/type gate.
After: Full lint → type-check → test pipeline on every PR; conditional integration tests on directory-scoped changes.
2.
22831c0— chore: Add ESLint + TypeScript Type-Checking to CI/PublishFiles:
.github/workflows/ci.yml(+1/-1),publish.yml(+6)What changed: A follow-up to the CI commit. Ensured the ESLint step in
ci.ymlwas correctly scoped to TypeScript files insrc/. Addedtsc --noEmitto the publish workflow as a hard gate before building, so a type error cannot slip into a published npm package.Why it matters: Prevents shipping broken TypeScript types to consumers of the
@librechat/agentspackage.Before: Publish could proceed with type errors.
After: Publish fails hard if TypeScript compilation fails.
3.
15b645c— refactor: Replacejs-tiktokenwithai-tokenizerFiles:
src/utils/tokens.ts(+43/-54),src/run.ts(+6/-2),package.json,package-lock.json, 8 scripts, 2 test files (newtokens.test.tswith 64 tests)What changed: The legacy
js-tiktokendependency was dropped and replaced withai-tokenizer.createTokenCounterintokens.tswas refactored to use dynamic imports for encoding data (lazy loading), making initialization fully async. ATokenEncoderManagerclass was added with areset()mechanism to clear cached tokenizers and free memory.src/run.tswas updated to properlyawaitthe async token counter. 64 new tests were added covering encoding correctness and memoization.Why it matters:
js-tiktokenuses WASM and has a large bundle footprint with a synchronous, eager-loading API.ai-tokenizeris lighter, uses dynamic imports for lazy loading, and supports a wider range of model encodings. Thereset()mechanism onTokenEncoderManagerdirectly addresses memory leaks in long-running server processes where tokenizers were cached indefinitely.Before: Synchronous, WASM-based
js-tiktokenloaded eagerly; no way to evict cached encoders.After:
ai-tokenizerwith async, dynamic-import loading;TokenEncoderManager.reset()clears all cached tokenizers on demand.4.
ca4530f— fix: Preserve Image Blocks inensureThinkingBlockInMessages(174× Token Amplification)Files:
src/messages/format.ts(+137/-34),src/messages/ensureThinkingBlock.test.ts(+484/-12),AGENTS.md(new),CLAUDE.md(new),eslint.config.mjs(+1)What changed: A critical bug fix in
ensureThinkingBlockInMessages. When the function needed to convert an AI→Tool sequence into a HumanMessage, it was callinggetBufferString()on the message content, which serialized everything including base64-encoded image data into a plain text string. This was then fed back into the LLM as raw text.The fix introduces several new helpers:
buildToolSequenceContent— constructs a structured content array from a tool-call sequence, keeping image blocks as nativeimage_url/imageblocks rather than serializing them.appendMessageContent/flushTextChunks— handle the accumulation and flushing of text vs. binary content separately.IMAGE_BLOCK_TYPESconstant — an explicit allowlist of block types that contain binary image data, preventing them from being text-serialized.isToolMessage— DRY helper for tool-role message detection.tool_callswhentool_useblocks are already present in content.AGENTS.mdandCLAUDE.mdwere added as project documentation files.Why it matters: A single base64 image embedded in a tool sequence was being serialized to a multi-kilobyte string and re-sent as text on every subsequent turn. The commit message explicitly cites 174× token amplification — meaning one image could cause token usage to blow up nearly 200x, leading to context window exhaustion and enormous API costs.
Before:
getBufferString()serialized image binary data into raw text strings, causing exponential token growth in multi-turn conversations involving images and tool calls.After: Images are passed through as structured native blocks; text-only content is accumulated and flushed separately; no binary data touches the string serialization path.
5.
2e624be— fix: Only Process Trailing Sequence After Last HumanMessageFiles:
src/messages/format.ts(+18/-10),src/messages/ensureThinkingBlock.test.ts(+20/-17)What changed: A follow-up scoping fix to
ensureThinkingBlockInMessages. Previously the function iterated the entire message array from index 0, applying the AI→Tool→HumanMessage conversion to every sequence in history that lacked a thinking block — including sequences that had already been sent and accepted in prior turns.The fix: find the index of the last
HumanMessagein the array, leave everything before it completely untouched, and only validate/convert the trailing AI→Tool sequence that is actually about to be sent to the provider.Why it matters: The old behavior was re-processing and re-converting historical accepted context on every new turn. This had two concrete harms:
Before: Entire message history was re-scanned and mutated on every call; prompt caching was broken; token overhead grew with conversation length.
After: Only the trailing unvalidated sequence after the last
HumanMessageis touched; all prior history is passed through verbatim; prompt caching works correctly.6.
76260749— feat: ToolCall Structure withauthandexpires_atFieldsFiles:
src/stream.ts(+12),src/types/graph.ts(+2),src/types/stream.ts(+2)What changed: Two new optional fields were added to the ToolCall data structures:
auth— authentication metadata for a tool call (likely OAuth tokens, API keys, or similar credentials needed to invoke the tool on behalf of a user).expires_at— an expiration timestamp for the auth credential.These were added to
ToolCallDelta(the streaming type instream.ts),PartMetadata(the graph-level type ingraph.ts), and the stream types file.createContentAggregatorwas updated to propagate both fields through the streaming pipeline.Why it matters: This is infrastructure for tool-call authentication flows — specifically to support scenarios where a tool requires a per-user auth token that has a finite TTL (e.g., OAuth access tokens, session tokens for code interpreters, or auth-gated MCP tools). Without these fields, the runtime had no way to carry auth context alongside the tool call itself or signal to the consumer that a credential has expired.
Before:
ToolCallDeltaandPartMetadatahad no auth or expiration concept; auth had to be handled entirely out-of-band.After: Auth credentials and expiration timestamps are first-class fields on ToolCall structures, propagated through the streaming content aggregator.
7.
6d2e7f7— chore:npm audit fixFiles:
package-lock.json(+11/-11)What changed: Dependency lock file updated to resolve security vulnerabilities flagged by
npm audit. No production code changed.Why it matters: Keeps the published package's transitive dependency tree free of known CVEs.
Summary Table
js-tiktoken→ai-tokenizerauth+expires_aton ToolCall