Skip to content

Prevent long context - #183

Merged
jmsevin merged 2 commits into
mainfrom
agent-guardrails
Aug 27, 2026
Merged

Prevent long context#183
jmsevin merged 2 commits into
mainfrom
agent-guardrails

Conversation

@jmsevin

@jmsevin jmsevin commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces middleware enhancements to the agent creation process, improves test coverage for middleware integration, and makes several minor code cleanups and import fixes.

Agent Middleware Integration:

  • Added SummarizationMiddleware to the agent creation in _create_agent, ensuring that long conversations are summarized automatically when token counts exceed 64,000. [1] [2]

Testing Enhancements:

  • Added a new test test_create_agent_adds_summarization_middleware to verify that SummarizationMiddleware is correctly added to the agent's middleware stack.

Code Quality and Maintenance:

  • Cleaned up and reordered imports in src/app/bibliography/api/bibliography.py and src/app/bibliography/helpers/helpers.py for consistency and clarity. [1] [2]
  • Refactored imports in src/app/tests/services/test_helpers.py to group related functionality and remove redundant code. [1] [2]

Configuration:

  • Disabled LangSmith tracing for the test environment by adding LANGSMITH_TRACING_ENABLED=false to pytest.ini.

@jmsevin
jmsevin requested a review from sandragjacinto August 27, 2026 09:27
@jmsevin
jmsevin merged commit f337ec7 into main Aug 27, 2026
3 checks passed
@jmsevin
jmsevin deleted the agent-guardrails branch August 27, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants