feat: add root-level tools map with customParameters to AI Config types#141
Merged
jsonbailey merged 8 commits intomainfrom Apr 27, 2026
Merged
feat: add root-level tools map with customParameters to AI Config types#141jsonbailey merged 8 commits intomainfrom
jsonbailey merged 8 commits intomainfrom
Conversation
3 tasks
Adds AITool dataclass and tools map (keyed by tool name) to completion and agent config types. The root-level tools map is distinct from model.parameters.tools[] which remains passable to LLM providers as-is. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
826f6bb to
6661d5f
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
keelerm84
approved these changes
Apr 27, 2026
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>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ites The variation call already incorporates the default via default_dict; applying a second-level default here is incorrect. 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.
There are 2 total unresolved issues (including 1 from previous review).
❌ 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 ccc744e. Configure here.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
AIToolfrozen dataclass withname,type?,parameters?, andcustom_parameters?fieldstools: Optional[Dict[str, AITool]]toAICompletionConfig,AICompletionConfigDefault,AIAgentConfig, andAIAgentConfigDefault_parse_tools()helper inclient.pythat parses the root-leveltoolsmap from flag variations_completion_configand__evaluate_agentto parse and propagatetools, falling back todefault.toolswhen absentAIToolfromldai.__init__tests/test_tools.pywith 6 tests covering tools in completion config, agent config, default fallback, and serializationBackground
The LaunchDarkly backend now includes a root-level
toolsmap (sibling tomodel) in AI Config flag variations. This is separate frommodel.parameters.tools[]which is the raw array passable to LLM providers as-is. LLM providers reject unknown properties, socustomParameterscannot live insidemodel.parameters.tools[]— hence the split.Wire format:
{ "tools": { "web-search-tool": { "name": "web-search-tool", "type": "function", "parameters": { ... }, "customParameters": { "some-custom-parameter": "some-custom-value" } } } }customParametersis camelCase in the wire format; the Python model usescustom_parameters(snake_case) and serializes back to camelCase into_dict().Note
Supersedes PR #106 (
devin/1773277027-add-tool-instructions-examples) which had the wrong structure (list instead of map, wrong fieldskey/version/instructions/examples).Test plan
poetry run pytest— all existing tests pass, 6 new tests for tools coverageAITool.to_dict()serializescustom_parametersascustomParameters🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it changes the public AI config data model and flag-variation parsing for
completion_config/agent_config, which could affect downstream consumers and serialization expectations.Overview
Adds first-class support for a root-level
toolsmap in AI Config flag variations by introducing theLDToolmodel (includingcustomParameterswire-format support) and wiring it intoAICompletionConfig*andAIAgentConfig*.Updates
LDAIClientevaluation to parsevariation['tools']via_parse_tools()and expose it on returned configs, and exportsLDToolfromldai. Adds a focused test suite covering parsing behavior (tools present vs absent) andLDTool.to_dict()camelCase serialization/omissions.Reviewed by Cursor Bugbot for commit 7c522ae. Bugbot is set up for automated code reviews on this repo. Configure here.