Skip to content

[FEATURE] client evaluation context support #500

Closed

Description

@aepfli

Within other SDKs, we're able to set a context on a client level. Although there is a field within the client, there is no setter for the evaluation context.

We should be able to set a client wide evaluation context, and it should behave as described.

see https://github.com/open-feature/spec/blob/main/specification/assets/gherkin/contextMerging.feature

Activity

  1. vikasrao23 commented on Feb 21, 2026

    @vikasrao23

    Hi! 👋

    I've implemented this feature in PR #565.

    What was added

    • set_evaluation_context(context) method to the OpenFeatureClient class
    • Comprehensive tests verifying the setter works and context merging is correct

    Implementation details

    The client context is now settable and is properly merged during flag evaluation with the correct precedence:

    API context → Transaction context → Client context → Invocation context

    This matches the behavior described in the OpenFeature spec's context merging feature.

    Example usage:

    client = api.get_client()
    client.set_evaluation_context(EvaluationContext(
        targeting_key="user-123",
        attributes={"email": "user@example.com"}
    ))

    Let me know if any adjustments are needed!

  2. added 2 commits that reference this issue on Apr 11, 2026
    f094b3a
    202e548
  3. balgaly commented on Apr 14, 2026

    @balgaly
    Contributor

    I'd like to tackle this — plan to add set_evaluation_context() on the client and merge it with the provider-level context per the spec. PR coming shortly.

  4. added a commit that references this issue on Apr 14, 2026
    d63215d
  5. danjuv commented on Apr 15, 2026

    @danjuv
    Contributor

    Perhaps this issue needs rescoping. @gruebel mentioned the solution is the missing E2E tests but that's not immediately clear from the description.

  6. added a commit that references this issue on Apr 17, 2026
    a4abc37
  7. added a commit that references this issue on Jun 6, 2026
    ca26b11
  8. added a commit that references this issue on Jun 7, 2026
    79bb01b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions