fix: Fix default configs always being disabled#965
Conversation
|
@launchdarkly/browser size report |
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
| context, | ||
| defaultValue, | ||
| ); | ||
| const { |
There was a problem hiding this comment.
this is just a consistency formatting change to align with how we format in the config method.
| provider: defaultValue.provider, | ||
| instructions: 'instructions' in defaultValue ? defaultValue.instructions : undefined, | ||
| }; | ||
| } |
There was a problem hiding this comment.
This could be static. Does it need to be defined on LDAIClientImpl?
There was a problem hiding this comment.
Ideally this would be defined in api/config as a utility method but this could create a circular dependency. I wanted to avoid any breaking changes to the SDK for this.
Current flow:
- api/agents → imports from api/config (line 1 in LDAIAgent.ts)
- api/config → would need to import from api/agents (for LDAIAgentDefaults)
This creates a cycle:
- api/agents → api/config → api/agents ❌
🤖 I have created a release *beep* *boop* --- <details><summary>server-sdk-ai: 0.12.3</summary> ## [0.12.3](server-sdk-ai-v0.12.2...server-sdk-ai-v0.12.3) (2025-10-24) ### Bug Fixes * Fix default configs always being disabled ([#965](#965)) ([30e2305](30e2305)) </details> <details><summary>server-sdk-ai-langchain: 0.1.3</summary> ## [0.1.3](server-sdk-ai-langchain-v0.1.2...server-sdk-ai-langchain-v0.1.3) (2025-10-24) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/server-sdk-ai bumped from ^0.12.2 to ^0.12.3 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^0.12.2 to ^0.12.3 </details> <details><summary>server-sdk-ai-openai: 0.1.2</summary> ## [0.1.2](server-sdk-ai-openai-v0.1.1...server-sdk-ai-openai-v0.1.2) (2025-10-24) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/server-sdk-ai bumped from ^0.12.2 to ^0.12.3 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^0.12.2 to ^0.12.3 </details> <details><summary>server-sdk-ai-vercel: 0.1.2</summary> ## [0.1.2](server-sdk-ai-vercel-v0.1.1...server-sdk-ai-vercel-v0.1.2) (2025-10-24) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/server-sdk-ai bumped from ^0.12.2 to ^0.12.3 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^0.12.2 to ^0.12.3 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Release server-ai 0.12.3 with a bug fix and bump provider packages and example apps to use it. > > - **AI SDK (`packages/sdk/server-ai`)**: > - Release `0.12.3` with bug fix: default configs no longer always disabled (`CHANGELOG.md`). > - **AI Providers**: > - Bump versions and align dev deps to `@launchdarkly/server-sdk-ai@^0.12.3`: > - `server-ai-langchain` → `0.1.3` > - `server-ai-openai` → `0.1.2` > - `server-ai-vercel` → `0.1.2` > - Update corresponding `CHANGELOG.md` entries. > - **Examples**: > - Update `@launchdarkly/server-sdk-ai` dependency to `0.12.3` in `examples/bedrock`, `examples/openai`, `examples/tracked-chat`, `examples/vercel-ai`. > - **Release Manifest**: > - Update versions in `.release-please-manifest.json`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0f97709. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jason Bailey <jbailey@launchdarkly.com>
Note
Convert defaults to LD flag values (with _ldMeta.enabled) before calling variation, so configs/agents respect default enabled; update tests accordingly.
_toLDFlagValueto convertdefaultValueinto LD flag shape with_ldMeta.enabled, and use it in_evaluatesoenabledmirrors the provided default when no flag metadata is present.providertoconfigProviderin agent/config assembly to avoid shadowing.enabledequals the provided default and thatvariationis called with the LD-shaped default (including_ldMeta.enabled).Written by Cursor Bugbot for commit 4be19fa. This will update automatically on new commits. Configure here.