Parent
Sub-issue of #221
Depends on #287 (Phase 1 imports — merged)
Summary
Adopt EPP's principle of using request attributes as the single source of truth for plugin data sharing, replacing the current CycleState pattern.
Context
Per discussion with @nirrozenbaum: follow EPP's principles where PluginState is explicitly not a cross-plugin handoff channel — data shared between plugins flows through request attributes. For IPP's use case, PluginState (requestID-scoped, janitor cleanup) is likely unnecessary since CycleState is already created fresh per-request and discarded after. Request attributes can serve as the single source of truth.
Changes
1. Add attributes on InferenceRequest
- Give
InferenceRequest an AttributeMap so plugins can write/read structured data there
- Follow EPP's pattern: per-request attribute store
2. Migrate current CycleState usages to request attributes
- Move cross-plugin keys (e.g.
session-affinity/session-id, selected model) to request attributes
- Each plugin writes its data to request attributes instead of CycleState
3. Remove CycleState
- Once all data flows through request attributes, remove CycleState from plugin interfaces
- Remove
CycleState parameter from all plugin method signatures (Filter, Score, Pick, ProcessRequest, ProcessResponse, etc.)
- Delete
cycle_state.go
Acceptance criteria
Parent
Sub-issue of #221
Depends on #287 (Phase 1 imports — merged)
Summary
Adopt EPP's principle of using request attributes as the single source of truth for plugin data sharing, replacing the current CycleState pattern.
Context
Per discussion with @nirrozenbaum: follow EPP's principles where PluginState is explicitly not a cross-plugin handoff channel — data shared between plugins flows through request attributes. For IPP's use case, PluginState (requestID-scoped, janitor cleanup) is likely unnecessary since CycleState is already created fresh per-request and discarded after. Request attributes can serve as the single source of truth.
Changes
1. Add attributes on InferenceRequest
InferenceRequestanAttributeMapso plugins can write/read structured data there2. Migrate current CycleState usages to request attributes
session-affinity/session-id, selected model) to request attributes3. Remove CycleState
CycleStateparameter from all plugin method signatures (Filter, Score, Pick, ProcessRequest, ProcessResponse, etc.)cycle_state.goAcceptance criteria
InferenceRequesthas anAttributeMapfor plugin data sharingCycleStateremoved from all plugin interfaces and implementationsmake testpassesmake lintpasses