Skip to content

Conversation

@Davda-James
Copy link
Contributor

@Davda-James Davda-James commented Jan 2, 2026

PR title: feat(langchain): AND capable trigger conditions in Python SummarizationMiddleware

PR description:

Add support for dict-style AND triggers to SummarizationMiddleware, so clauses like {"tokens": 4000, "messages": 10} require all thresholds to be met, while lists of such dicts remain OR across clauses. Maintains backward compatibility with tuple triggers, adds tests.
Once if change is confirmed to be merged, will add docs accordingly.

Files Changed

langchain_v1/langchain/agents/middleware/summarization.py
langchain_v1/tests/unit_tests/agents/middleware/implementations/test_summarization.py

Checklist

  • Ran make format, make lint and make test from the langchain_v1/
  • Tests added for change

Closes Issue: #34442

@github-actions github-actions bot added langchain `langchain` package issues & PRs feature For PRs that implement a new feature; NOT A FEATURE REQUEST labels Jan 2, 2026
@Davda-James Davda-James changed the title feat(langchain_v1): added AND-capable trigger conditions to Python SummarizationMiddleware feat(langchain): added AND-capable trigger conditions to Python SummarizationMiddleware Jan 2, 2026
@github-actions github-actions bot added feature For PRs that implement a new feature; NOT A FEATURE REQUEST and removed feature For PRs that implement a new feature; NOT A FEATURE REQUEST labels Jan 2, 2026
@mdrxy mdrxy changed the title feat(langchain): added AND-capable trigger conditions to Python SummarizationMiddleware feat(langchain): port AND-capable trigger conditions to SummarizationMiddleware Jan 8, 2026
@github-actions github-actions bot removed the feature For PRs that implement a new feature; NOT A FEATURE REQUEST label Jan 8, 2026
@mdrxy
Copy link
Member

mdrxy commented Jan 8, 2026

@Davda-James would you mind resolving conflicts?

@github-actions github-actions bot added the feature For PRs that implement a new feature; NOT A FEATURE REQUEST label Jan 8, 2026
@mdrxy
Copy link
Member

mdrxy commented Jan 8, 2026

please also resolve CI failures

@Davda-James
Copy link
Contributor Author

yeah @mdrxy doing that, will add commit with fix.

Refactor token threshold checks to improve clarity and logic.
@Davda-James
Copy link
Contributor Author

please also resolve CI failures

done

@Davda-James
Copy link
Contributor Author

Hi @mdrxy, please let me know if any changes or improvements are needed from my side. Happy to update it accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature For PRs that implement a new feature; NOT A FEATURE REQUEST langchain `langchain` package issues & PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants