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
b27f8f3 to
56f6755
Compare
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
New optional client module with fail-open defaults on API errors; no changes to existing auth or sandbox flows.
Overview
Adds a Prime CLI feature flag client so callers can resolve flag values from the platform instead of hard-coding defaults.
FeatureFlagsClientPOSTs to/feature-flags/evaluatewith the requested flag defaults,cli_version, and optionalteam_id, then merges serverflagswith per-key fallback when a key is missing.evaluate_feature_flagswraps that and returns a copy of defaults onAPIError;is_feature_enabledtreats only booleanTrueas enabled. The new symbols are re-exported fromprime_cli.Unit tests cover request payload/context, API failure fallback, empty input (no network call), and strict boolean handling for
is_feature_enabled.Reviewed by Cursor Bugbot for commit 56f6755. Bugbot is set up for automated code reviews on this repo. Configure here.