Skip to content

feat: fall back to model.parameters.tools when root tools absent#1330

Draft
jsonbailey wants to merge 3 commits intomainfrom
jb/aic-1935/tools-model-params-fallback
Draft

feat: fall back to model.parameters.tools when root tools absent#1330
jsonbailey wants to merge 3 commits intomainfrom
jb/aic-1935/tools-model-params-fallback

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

Summary

  • Adds _resolveTools() to LDAIConfigUtils — checks root-level tools first, falls back to model.parameters.tools for older AI configs
  • Root-level tools always takes priority when present
  • model.parameters.tools as an array or non-object is silently ignored (may be user-defined custom param)
  • Entries missing a name string are silently skipped; valid entries in the same map are still returned

Background

The LaunchDarkly AI Config API now sends tools in two places: updated configs send them at both root and model.parameters.tools; older configs only send them in model.parameters.tools. Previously the SDK only read root-level, leaving older configs with no tools.

Test plan

  • Existing tools tests pass
  • Tools parsed from model.parameters.tools when root key is absent
  • Root tools wins when both locations are present
  • model.parameters.tools as array → undefined
  • Entries missing name skipped; valid entries in same map returned

Jira: AIC-1935

🤖 Generated with Claude Code

When root-level tools is absent, fall back to model.parameters.tools and
parse it as our LDTool map format. Arrays or entries missing a name field
are silently ignored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25623 bytes
Compressed size limit: 29000
Uncompressed size: 125843 bytes

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 38473 bytes
Compressed size limit: 39000
Uncompressed size: 211104 bytes

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31840 bytes
Compressed size limit: 34000
Uncompressed size: 113634 bytes

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179547 bytes
Compressed size limit: 200000
Uncompressed size: 830815 bytes

@jsonbailey jsonbailey changed the title feat(server-ai): fall back to model.parameters.tools when root tools absent feat: fall back to model.parameters.tools when root tools absent Apr 28, 2026
jsonbailey and others added 2 commits April 29, 2026 10:08
…s bad entries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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