fix: include judgeConfiguration in CompletionConfigDefault.ToLdValue()#285
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
fix: include judgeConfiguration in CompletionConfigDefault.ToLdValue()#285devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
LdAiCompletionConfigDefault.ToLdValue() was not serializing the judgeConfiguration property, unlike LdAiAgentConfigDefault which did. This meant the judge config was lost when the default round-tripped through JsonVariation as an LdValue fallback. Adds conditional serialization matching the agent default pattern and a test that verifies the round-trip. Co-Authored-By: mmccarthy@launchdarkly.com <mmccarthy@launchdarkly.com>
f240f25 to
39e9f53
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.
Requirements
Related issues
Builds on PR 3 branch (
mmccarthy/AIC-2636/net-sdk-v-1-0-step-3). Fixes a gap inLdAiCompletionConfigDefault.ToLdValue().Describe the solution you've provided
LdAiCompletionConfigDefault.ToLdValue()was not serializingjudgeConfiguration, unlikeLdAiAgentConfigDefault.ToLdValue()which conditionally includes it. This means when a user setsSetJudgeConfiguration(...)on a completion default and the flag falls back to the defaultLdValueviaJsonVariation, the judge config is lost on the round-trip throughBuildCompletionConfig.Fix: changed
ToLdValue()to use a mutable dictionary and conditionally addjudgeConfigurationwhen non-null — matching the agent default pattern exactly.Added test
CompletionConfigDefaultToLdValueIncludesJudgeConfigurationthat mocksJsonVariationto echo back the defaultLdValueand verifiesJudgeConfigurationsurvives the round-trip.Describe alternatives you've considered
N/A — this is a direct consistency fix to match the agent default serialization pattern.
Additional context
All 119 tests pass locally on net8.0.
Link to Devin session: https://app.devin.ai/sessions/223e995121584359a2ba14c106f186da
Note
Low Risk
Targeted default-value serialization aligned with existing agent behavior; behavior change only affects completion defaults that set judge configuration on flag fallback.
Overview
Fixes
LdAiCompletionConfigDefault.ToLdValue()so completion defaults serializejudgeConfigurationwhen set (same conditional pattern asLdAiAgentConfigDefault). Without this, a completion default withSetJudgeConfiguration(...)loses judges when the flag evaluation returns that defaultLdValueandBuildCompletionConfigparses it again.Adds
CompletionConfigDefaultToLdValueIncludesJudgeConfiguration, which mocksJsonVariationto echo the defaultLdValueand asserts judge key and sampling rate survive the round-trip.Reviewed by Cursor Bugbot for commit 39e9f53. Bugbot is set up for automated code reviews on this repo. Configure here.