Skip to content

chore: circumvents judge_config calls to make judge evaluations in optimization#197

Merged
andrewklatzke merged 1 commit into
aklatzke/AIC-2599/sdk-field-additionsfrom
aklatzke/AIC-2627/circumvent-judge-methods
Jun 2, 2026
Merged

chore: circumvents judge_config calls to make judge evaluations in optimization#197
andrewklatzke merged 1 commit into
aklatzke/AIC-2599/sdk-field-additionsfrom
aklatzke/AIC-2627/circumvent-judge-methods

Conversation

@andrewklatzke
Copy link
Copy Markdown
Contributor

@andrewklatzke andrewklatzke commented Jun 1, 2026

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

Describe the solution you've provided

Updates the judges to fetch from .variation directly so we can avoid the warning stemming from the judge_config call when we're using our own history. Additionally, if we receive a message that is just a system message (new format) we'll just auto-append our user message with that data.

Describe alternatives you've considered

This is a fix/chore stemming from some updates to the base SDK.


Note

Medium Risk
Changes how judge prompts are resolved for optimization runs (private SDK client access and custom interpolation); behavior should match intent but diverges from the public judge_config contract if flag shape or SDK rules differ.

Overview
Config judges in optimization no longer go through LDAIClient.judge_config. _judge_config now reads the judge flag via _client.variation, applies local {{key}} interpolation (including message_history and response_to_evaluate), and builds AIJudgeConfig itself so the SDK does not strip or warn on those reserved variables.

New-style judge templates that only define a system message get an automatic user turn built from optimization history and the response under test, so downstream _evaluate_config_judge still sees a full system/user conversation.

Tests mock raw flag variations instead of judge_config, and add coverage for system-only templates and template interpolation.

Reviewed by Cursor Bugbot for commit 806b564. Bugbot is set up for automated code reviews on this repo. Configure here.

@andrewklatzke andrewklatzke requested a review from a team as a code owner June 1, 2026 23:36
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 806b564. Configure here.

Comment thread packages/optimization/src/ldai_optimizer/client.py
Comment thread packages/optimization/src/ldai_optimizer/client.py
@andrewklatzke andrewklatzke merged commit 806b564 into aklatzke/AIC-2599/sdk-field-additions Jun 2, 2026
7 checks passed
@andrewklatzke andrewklatzke deleted the aklatzke/AIC-2627/circumvent-judge-methods branch June 2, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant