feat: fall back to model.parameters.tools when root tools absent#1330
feat: fall back to model.parameters.tools when root tools absent#1330jsonbailey wants to merge 7 commits intomainfrom
Conversation
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>
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/browser size report |
…s bad entries Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…root tools path, fall back to key name when name field absent Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 76068a6. Configure here.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Summary
_resolveTools()toLDAIConfigUtils— checks root-leveltoolsfirst, falls back tomodel.parameters.toolsfor older AI configstoolsalways takes priority when presentmodel.parameters.toolsas an array or non-object is silently ignored (may be user-defined custom param)namestring are silently skipped; valid entries in the same map are still returnedBackground
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 inmodel.parameters.tools. Previously the SDK only read root-level, leaving older configs with no tools.Test plan
model.parameters.toolswhen root key is absenttoolswins when both locations are presentmodel.parameters.toolsas array →undefinednameskipped; valid entries in same map returnedJira: AIC-1935
🤖 Generated with Claude Code
Note
Medium Risk
Changes how
toolsare derived for agent/completion configs by parsing and normalizing tool maps from multiple locations, which may affect downstream tool execution when flags contain unexpected shapes. Adds warnings for invalid tool payloads, but scope is limited to config parsing.Overview
Adds backwards-compatible tool resolution for AI configs:
toolsis now taken from the roottoolsmap when present, otherwise parsed frommodel.parameters.tools.Introduces map parsing/normalization (including defaulting missing tool
nameto the map key) and emits logger warnings whentoolsis present but not an object. UpdatesLDAIClientImplto pass the SDK logger intoLDAIConfigUtils, and expands tests to cover fallback/precedence and invalidmodel.parameters.toolsshapes.Reviewed by Cursor Bugbot for commit 12815aa. Bugbot is set up for automated code reviews on this repo. Configure here.