Skip to content

Add clear_route_cache option in McpJsonRestBridge filter#45906

Open
mkbehr wants to merge 1 commit into
envoyproxy:mainfrom
mkbehr:mcp-transcoder-clear-route-cache
Open

Add clear_route_cache option in McpJsonRestBridge filter#45906
mkbehr wants to merge 1 commit into
envoyproxy:mainfrom
mkbehr:mcp-transcoder-clear-route-cache

Conversation

@mkbehr

@mkbehr mkbehr commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Commit Message: mcp_transcoder: Add clear_route_cache option in McpJsonRestBridge filter
Additional Description:
Add a clear_route_cache field to McpJsonRestBridge's config. If set, the filter will clear the route cache when serving MCP traffic. The field defaults to false, to match the corresponding config for McpFilter. This is a behavioral change; the old behavior was to always clear the route cache (as though the field were true).
Risk Level: Low
Testing: Unit and integration tests
Docs Changes: N/A
Release Notes: yes
Platform Specific Features: N/A
API Considerations: The default behavior is a behavioral change, in order to bring the default in line with McpFilter. We don't think this filter is widely used yet. The old behavior can be restored with xDS-gated config.

Signed-off-by: Michael Behr <mkbehr@google.com>
@mkbehr

mkbehr commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

/assign tyxia

@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #45906 was opened by mkbehr.

see: more, trace.

@tyxia tyxia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly LGTM module the API comment.

Thanks!

// When set to true, the filter will clear the route cache after transcoding.
// This allows the route to be re-selected based on the updated request path or method.
// Defaults to false.
bool clear_route_cache = 7;

@tyxia tyxia Jul 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO, we should keep the default behavior same as before, since if path/host has been transcoded it makes sense to clear route cache to enable route re-selection as default behavior. To do so, we can either (1) have BoolValue (a special wrapper message) and set it True by default. or (2) tweak the logic a bit: change to disable_clear_route_cache and it is default to false.

I probably prefer option 2 as it is simpler and easy

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants