feat: add Lua filter to afterExtProcFilterPrefixes - #2054
Merged
nacx merged 3 commits intoApr 16, 2026
Conversation
Allow Lua filters configured via EnvoyExtensionPolicy to run after the AI Gateway ext_proc filter, consistent with how Wasm filters are already handled. This enables users to leverage AIGW metadata (e.g. x-ai-eg-model header) in Lua scripts without resorting to EnvoyPatchPolicy workarounds. Fixes envoyproxy#1469 Signed-off-by: Varun Nuthalapati <nuthalapativarun@gmail.com>
nacx
approved these changes
Apr 16, 2026
nacx
enabled auto-merge (squash)
April 16, 2026 07:55
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2054 +/- ##
=======================================
Coverage 84.38% 84.38%
=======================================
Files 130 130
Lines 18116 18116
=======================================
Hits 15287 15287
Misses 1883 1883
Partials 946 946 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Allow Lua filters configured via
EnvoyExtensionPolicyto run after the AI Gateway ext_proc filter, consistent with how Wasm filters are already handled.The
afterExtProcFilterPrefixesslice controls which filters AIGW's ext_proc is inserted before. Wasm was already in this list, but Lua was missing, so Lua filters would end up running before AIGW's ext_proc rather than after it. This prevented users from using Lua scripts to act on AIGW metadata (e.g. thex-ai-eg-modelheader set by ext_proc).This PR adds
EnvoyFilterLuatoafterExtProcFilterPrefixesin the same position asEnvoyFilterWasm, and adds a corresponding test case.Note: This code was written with AI assistance (Claude Code).
Related Issues/PRs (if applicable)
Fixes #1469
Special notes for reviewers (if applicable)
The fix follows the exact same pattern used for
EnvoyFilterWasm(line 799).EnvoyFilterLuais defined in theegv1a1package (envoy.filters.http.lua) so no new dependencies are introduced.