Skip to content

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Sep 15, 2025

Summary

This change ensures PopulateMiddlewareConfigs passes both tools filter and tool overrides to the ToolFilter and ToolCallFilter middlewares. Middlewares are now applied when either a tools filter or overrides are provided (supports overrides-only).

Motivation

The proxyrunner path relies on PopulateMiddlewareConfigs (backward-compat bridge). Previously it only applied the tools filter and ignored tool overrides, causing proxyrunner to miss overrides that thv run supports. This brings parity so proxyrunner behaves like thv run for tool filtering/overrides.

Change details

  • Update pkg/runner/middleware.go to:
    • Convert runner.ToolOverride to mcp.ToolOverride and include it in ToolFilter middleware params.
    • Apply ToolFilter and ToolCallFilter middleware when either a tools filter or overrides are present.

Verification

  • Executed tests in the dev container: go test ./pkg/... ./cmd/thv-proxyrunner/... — all passing.
  • No API or schema changes; only middleware population logic adjusted.

Impact

  • Overrides now function even when no tools filter is specified.
  • No behavioral change when neither tools filter nor overrides are provided.

… empty tools filter

Populate tool overrides into ToolFilter and ToolCallFilter middlewares via PopulateMiddlewareConfigs.
Apply middlewares when either tools filter or overrides are provided (supports overrides-only).

This aligns proxyrunner runconfig behavior with thv run, ensuring tool overrides and optional tools filter are honored.
@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.60%. Comparing base (736602f) to head (1b210e9).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
pkg/runner/middleware.go 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1889      +/-   ##
==========================================
- Coverage   45.61%   45.60%   -0.02%     
==========================================
  Files         203      203              
  Lines       25923    25931       +8     
==========================================
  Hits        11825    11825              
- Misses      13189    13197       +8     
  Partials      909      909              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 42.875% (-0.01%) from 42.885%
when pulling 1b210e9 on fix/proxyrunner-tools-override-middleware
into 736602f on main.

@blkt blkt merged commit bd3474a into main Sep 16, 2025
18 of 19 checks passed
@blkt blkt deleted the fix/proxyrunner-tools-override-middleware branch September 16, 2025 12:16
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.

5 participants