Updates some places in code to watch feature flags instead of evaluating them once. This makes our application immediately reactive to changes in feature flag values, which means users can get the desired functionality without needing to restart their editor.
Renames the evaluateFeatureFlag method to evaluateFeatureFlagEphemerally, deprecates it, documents when it may be safely used, and makes it cache the result.
This also reduces the latency of autocomplete after #5221 was merged because it makes evaluateFeatureFlag calls not hit the network each time (and each autocomplete calls that 1-2 times).
evaluateFeatureFlag
method toevaluateFeatureFlagEphemerally
, deprecates it, documents when it may be safely used, and makes it cache the result.This also reduces the latency of autocomplete after #5221 was merged because it makes
evaluateFeatureFlag
calls not hit the network each time (and each autocomplete calls that 1-2 times).Fixes https://linear.app/sourcegraph/issue/CODY-3846/remove-most-uses-of-evaluatefeatureflag-method.
Test plan
CI. Check that the unified prompts feature flag works correctly.