Avatar for the langchain-ai user
langchain-ai
langchain
BlogDocsChangelog

fix(core): fix `trim_messages` misclassification of per-message token_counter

#35630
Comparing
gautamvarmadatla:fix/core-trim-messages-token-counter-annotation
(
f8a8823
) with
master
(
0f4f3f7
)
CodSpeed Performance Gauge
-4%
Untouched
13
Skipped
27

Benchmarks

40 total
test_async_callbacks_in_sync
libs/core/tests/benchmarks/test_async_callbacks.py
CodSpeed Performance Gauge
+2%
19.9 ms19.6 ms
test_import_time[Runnable]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-1%
406.8 ms412.6 ms
test_import_time[tool]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-3%
453.7 ms465.7 ms
test_import_time[InMemoryVectorStore]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-3%
509.7 ms524.9 ms
test_import_time[InMemoryRateLimiter]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-3%
140.8 ms145.6 ms
test_import_time[Document]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-4%
152.7 ms158.6 ms
test_import_time[CallbackManager]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-4%
256.6 ms267.2 ms
test_import_time[LangChainTracer]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-4%
369 ms385.1 ms
test_import_time[HumanMessage]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-5%
211 ms221.2 ms
test_import_time[RunnableLambda]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-5%
400.7 ms420.9 ms
test_import_time[PydanticOutputParser]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-5%
441 ms465.2 ms
test_import_time[BaseChatModel]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-6%
435.4 ms461.1 ms
test_import_time[ChatPromptTemplate]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-6%
508.7 ms540.9 ms
test_create_chat_prompt_init_time
libs/partners/prompty/tests/unit_tests/test_standard.py
Skipped
311.9 µs*
test_init_time
libs/partners/anthropic/tests/unit_tests/test_standard.py::TestAnthropicBedrockStandard
Skipped
1.1 ms*
test_init_time
libs/partners/fireworks/tests/unit_tests/test_standard.py::TestFireworksStandard
Skipped
6.6 s*
test_init_time
libs/partners/openai/tests/unit_tests/chat_models/test_base_standard.py::TestOpenAIStandard
Skipped
12.1 ms*
test_stream_time
libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py::TestOpenAIStandard
Skipped
1.1 s*
test_stream_time
libs/partners/openai/tests/integration_tests/chat_models/test_responses_standard.py::TestOpenAIStandard
Skipped
1.1 s*
test_init_time
libs/partners/openai/tests/unit_tests/chat_models/test_azure_standard.py::TestOpenAIStandard
Skipped
1.7 s*
test_stream_time
libs/partners/openai/tests/integration_tests/chat_models/test_responses_standard.py::TestOpenAIResponses
Skipped
823.6 ms*
test_init_time
libs/partners/openai/tests/unit_tests/chat_models/test_responses_standard.py::TestOpenAIResponses
Skipped
12.2 ms*
test_stream_time
libs/partners/anthropic/tests/integration_tests/test_standard.py::TestAnthropicStandard
Skipped
27.2 ms*
test_nomic_embeddings_init_time
libs/partners/nomic/tests/unit_tests/test_standard.py
Skipped
1.1 ms*
test_chroma_init_time
libs/partners/chroma/tests/unit_tests/test_standard.py
Skipped
101.3 ms*

Commits

Click on a commit to change the comparison range
Base
master
0f4f3f7
+38.46%
fix(core): fix trim_messages per-message token_counter detection
be47f94
26 days ago
by gautamvarmadatla
-40.26%
Merge branch 'master' into fix/core-trim-messages-token-counter-annotation
533ae84
18 days ago
by gautamvarmadatla
-1.65%
Merge branch 'master' into fix/core-trim-messages-token-counter-annotation
0113c48
10 days ago
by gautamvarmadatla
+5.23%
Merge branch 'master' into fix/core-trim-messages-token-counter-annotation
9f47bcb
7 days ago
by gautamvarmadatla
-5.39%
Merge branch 'master' into fix/core-trim-messages-token-counter-annotation
f8a8823
2 days ago
by gautamvarmadatla
© 2026 CodSpeed Technology
Home Terms Privacy Docs