Add Prime feature flag evaluation client#574
Open
d42me wants to merge 1 commit into
Open
Conversation
9f24c73 to
b27f8f3
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b27f8f3. Configure here.
|
|
||
| def __init__(self, client: APIClient | None = None, config: Config | None = None) -> None: | ||
| self.client = client or APIClient() | ||
| self.config = config or self.client.config |
There was a problem hiding this comment.
Config without client desyncs
Medium Severity
When FeatureFlagsClient or evaluate_feature_flags get a config but no client, a new APIClient uses its own Config for auth and base URL while team_id in the evaluate payload comes from the passed config, so evaluation context can disagree with the request identity.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b27f8f3. Configure here.
willccbb
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds a Prime CLI feature flag client that evaluates defaults via the platform feature-flags endpoint with CLI version and team context, falling back to defaults when evaluation is unavailable.
Note
Low Risk
Low risk: additive client/utilities plus unit tests, with failures explicitly falling back to provided defaults and no changes to auth or existing request flows.
Overview
Introduces feature-flag evaluation support in the Prime CLI via a new
FeatureFlagsClientplus convenience helpersevaluate_feature_flagsandis_feature_enabled, which POST defaults along withcli_versionand optionalteam_idto/feature-flags/evaluateand merge missing keys back to defaults.Exports these utilities from
prime_cli.__init__and adds unit tests covering payload context, empty-flag short-circuiting, API-error fallback behavior, and strict boolean handling foris_feature_enabled.Reviewed by Cursor Bugbot for commit b27f8f3. Bugbot is set up for automated code reviews on this repo. Configure here.