Skip to content

feat(epp): add error return to PreRequest plugin interface - #2215

Open
dmitripikus wants to merge 1 commit into
llm-d:mainfrom
dmitripikus:pre-request-error-return
Open

feat(epp): add error return to PreRequest plugin interface#2215
dmitripikus wants to merge 1 commit into
llm-d:mainfrom
dmitripikus:pre-request-error-return

Conversation

@dmitripikus

@dmitripikus dmitripikus commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds an error return to the PreRequest plugin interface so plugins can signal failure to the director. The director's runner now invokes every registered PreRequest plugin regardless of individual failures and returns their aggregated errors via errors.Join, so a caller sees all failures at once rather than only the first.

This is groundwork for #1686 (conditional-decode routing), where a new plugin at the PreRequest extension point needs to be able to fail a request. Per @elevran's comment on the issue, this preliminary PR lands the interface change on its own so the conditional-decode work can build on it.

Every existing implementation of PreRequest returns nil today; behavior is unchanged. Individual plugins that currently log-and-swallow errors (e.g. preciseprefixcache calling index.Add) are left as-is here — surfacing those errors is a follow-up.

Note on aggregation strategy: this diverges from the first-error-wins pattern used by runAdmissionPlugins and runRequestHeaderProcessors. Every PreRequest plugin runs its side effects even if a peer plugin has already failed, and the joined error covers all of them.

Which issue(s) this PR fixes:

Issue #2216

Release note:
The PreRequest plugin interface now returns an error. Existing built-in plugins return nil and are unaffected; out-of-tree plugin authors implementing PreRequest must update their method signatures.

Groundwork for issue llm-d#1686 (conditional-decode routing). PreRequest
plugins need a way to signal failure to the director. The runner now
invokes every registered plugin regardless of individual failures and
returns their aggregated errors via errors.Join, so a caller sees all
failures at once rather than only the first.

Every existing implementation returns nil today; behavior is unchanged.

Signed-off-by: Dmitri Pikus <DPIKUS@il.ibm.com>
@github-actions github-actions Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. labels Jul 28, 2026
@github-actions github-actions Bot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant