Skip to content

feat(framework): adopt request attributes and remove CycleState #288

Description

@szedan-rh

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

  • InferenceRequest has an AttributeMap for plugin data sharing
  • All cross-plugin data flows through request attributes
  • CycleState removed from all plugin interfaces and implementations
  • make test passes
  • make lint passes

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions