Skip to content

fix: include judgeConfiguration in CompletionConfigDefault.ToLdValue()#285

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1780948596-fix-completion-default-tovalue
Open

fix: include judgeConfiguration in CompletionConfigDefault.ToLdValue()#285
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1780948596-fix-completion-default-tovalue

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

Builds on PR 3 branch (mmccarthy/AIC-2636/net-sdk-v-1-0-step-3). Fixes a gap in LdAiCompletionConfigDefault.ToLdValue().

Describe the solution you've provided

LdAiCompletionConfigDefault.ToLdValue() was not serializing judgeConfiguration, unlike LdAiAgentConfigDefault.ToLdValue() which conditionally includes it. This means when a user sets SetJudgeConfiguration(...) on a completion default and the flag falls back to the default LdValue via JsonVariation, the judge config is lost on the round-trip through BuildCompletionConfig.

Fix: changed ToLdValue() to use a mutable dictionary and conditionally add judgeConfiguration when non-null — matching the agent default pattern exactly.

Added test CompletionConfigDefaultToLdValueIncludesJudgeConfiguration that mocks JsonVariation to echo back the default LdValue and verifies JudgeConfiguration survives 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 serialize judgeConfiguration when set (same conditional pattern as LdAiAgentConfigDefault). Without this, a completion default with SetJudgeConfiguration(...) loses judges when the flag evaluation returns that default LdValue and BuildCompletionConfig parses it again.

Adds CompletionConfigDefaultToLdValueIncludesJudgeConfiguration, which mocks JsonVariation to echo the default LdValue and 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.

@devin-ai-integration devin-ai-integration Bot requested a review from a team as a code owner June 8, 2026 19:59
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot added the devin-pr PR was created by Devin AI label Jun 8, 2026
Base automatically changed from mmccarthy/AIC-2636/net-sdk-v-1-0-step-3 to main June 9, 2026 14:11
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>
@devin-ai-integration devin-ai-integration Bot force-pushed the devin/1780948596-fix-completion-default-tovalue branch from f240f25 to 39e9f53 Compare June 9, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devin-pr PR was created by Devin AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants