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
(
9f47bcb
) with
master
(
5fd07f7
)
CodSpeed Performance Gauge
+2%
Untouched
13
Skipped
27

Benchmarks

40 total
test_import_time[tool]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+4%
473.5 ms*454.1 ms
test_import_time[CallbackManager]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+4%
266.4 ms*257.1 ms
test_import_time[BaseChatModel]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+3%
445.1 ms*431.9 ms
test_import_time[ChatPromptTemplate]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+2%
535.1 ms*522.4 ms
test_import_time[Document]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+2%
155.9 ms*152.8 ms
test_import_time[InMemoryRateLimiter]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+2%
142.7 ms*140.5 ms
test_import_time[Runnable]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+1%
405.2 ms*399.3 ms
test_import_time[PydanticOutputParser]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+1%
449.8 ms*443.4 ms
test_import_time[InMemoryVectorStore]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+1%
505.4 ms*499.8 ms
test_import_time[HumanMessage]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+1%
214.2 ms*212.5 ms
test_import_time[LangChainTracer]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
+1%
369.5 ms*367.1 ms
test_async_callbacks_in_sync
libs/core/tests/benchmarks/test_async_callbacks.py
CodSpeed Performance Gauge
+1%
20.5 ms*20.3 ms
test_import_time[RunnableLambda]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
0%
400.8 ms*400.6 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_init_time
libs/partners/deepseek/tests/unit_tests/test_chat_models.py::TestChatDeepSeekUnit
Skipped
385.2 ms*
test_init_time
libs/partners/openrouter/tests/unit_tests/test_standard.py::TestChatOpenRouterUnit
Skipped
362.1 ms*

Commits

Click on a commit to change the comparison range
Base
master
5fd07f7
+38.46%
fix(core): fix trim_messages per-message token_counter detection
be47f94
19 days ago
by gautamvarmadatla
-40.26%
Merge branch 'master' into fix/core-trim-messages-token-counter-annotation
533ae84
12 days ago
by gautamvarmadatla
-1.65%
Merge branch 'master' into fix/core-trim-messages-token-counter-annotation
0113c48
3 days ago
by gautamvarmadatla
+5.23%
Merge branch 'master' into fix/core-trim-messages-token-counter-annotation
9f47bcb
8 hours ago
by gautamvarmadatla
© 2026 CodSpeed Technology
Home Terms Privacy Docs