Skip to content

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

Draft
jsonbailey wants to merge 1 commit intomainfrom
jb/aic-1935/tools-model-params-fallback
Draft

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

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

Summary

  • Adds _resolve_tools() to client.py — 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 a list or non-dict is silently ignored (may be user-defined custom param)
  • Entries that are not dicts 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 list → None
  • Non-dict entries skipped; valid entries in same map returned

Jira: AIC-1935

🤖 Generated with Claude Code

When a flag variation has no root-level `tools` key, resolve tools from
`variation['model']['parameters']['tools']` instead. Root-level presence
always takes priority; the model-params fallback is entirely silent.

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