Skip to content

Add context provider middleware - #103

Merged
gdams merged 2 commits into
mainfrom
feat/context-provider-middleware
Apr 14, 2026
Merged

Add context provider middleware#103
gdams merged 2 commits into
mainfrom
feat/context-provider-middleware

Conversation

@qmuntal

@qmuntal qmuntal commented Apr 14, 2026

Copy link
Copy Markdown
Member

@qmuntal
qmuntal requested review from Copilot and gdams April 14, 2026 11:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR introduces a reusable context-provider middleware and wires agent context providers through the middleware chain, while keeping local in-memory history as a fallback when no explicit context providers are configured.

Changes:

  • Added middleware/contextprovider package to run ContextProvider hooks before/after agent runs.
  • Updated agent.New middleware wiring to use the new context-provider middleware and conditionally apply local history defaults.
  • Added unit tests covering message/tool enrichment and AfterRun behavior.
Show a summary per file
File Description
middleware/contextprovider/contextprovider.go New middleware that runs providers before run and persists after run
middleware/contextprovider/contextprovider_test.go New tests for message/tool enrichment and AfterRun semantics
agent/agent.go Switches agent wiring to the new middleware and adds default local-history fallback

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 4

Comment thread middleware/contextprovider/contextprovider.go
Comment thread middleware/contextprovider/contextprovider.go Outdated
Comment thread agent/agent.go
Comment thread middleware/contextprovider/contextprovider_test.go
@gdams
gdams merged commit 1fbe2c8 into main Apr 14, 2026
4 checks passed
@gdams
gdams deleted the feat/context-provider-middleware branch April 14, 2026 14:28
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.

3 participants