fix: get_environment_flags includes segments in evaluation context#179
Merged
fix: get_environment_flags includes segments in evaluation context#179
get_environment_flags includes segments in evaluation context#179Conversation
Co-authored-by: khvn26 <979078+khvn26@users.noreply.github.com>
Co-authored-by: khvn26 <979078+khvn26@users.noreply.github.com>
Co-authored-by: khvn26 <979078+khvn26@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix get_environment_flags to omit segments in evaluation context
fix: omit segments from evaluation context in get_environment_flags
Oct 31, 2025
khvn26
requested changes
Oct 31, 2025
Member
|
@copilot Please address the review comments above. |
- Use local_eval_flagsmith fixture in tests - Mock specific function with autospec - Use assert_called_once_with for cleaner assertions - Simplify context filtering with copy() and pop() Co-authored-by: khvn26 <979078+khvn26@users.noreply.github.com>
Contributor
Author
All review comments addressed in 10242fb. Changes include:
All tests pass (73/73) and linters are clean. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
get_environment_flags includes segments in evaluation context
emyller
approved these changes
Nov 12, 2025
Contributor
emyller
left a comment
There was a problem hiding this comment.
This was easier to comprehend by reading the code, than from the overly verbose and situation-contextualized PR description. 😞
Changes LGTM
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.
Fix for issue #6051: Omit segments from evaluation context when
get_environment_flagsis calledThis change addresses the issue where segments were unnecessarily included in the evaluation context when retrieving environment flags. Segments are only relevant for identity-specific evaluations, not for environment-wide flag evaluations.
Changes made:
_get_environment_flags_from_document()to filter out segments from the evaluation context before passing it to the enginecopy()andpop()instead of dictionary comprehensioncontext=...) for allengine.get_evaluation_resultcallsTesting & Quality:
Impact:
Ready for review!
Original prompt
get_environment_flagsincludes segments in evaluation context #172💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.