Skip to content

Commit 76068a6

Browse files
jsonbaileyclaude
andcommitted
fix: guard against null root tools value in _resolveTools
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9ffc9b6 commit 76068a6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/sdk/server-ai/src/api/config/LDAIConfigUtils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ export class LDAIConfigUtils {
174174
logger?: LDLogger,
175175
): { [toolName: string]: LDTool } | undefined {
176176
if (flagValue.tools !== undefined) {
177-
if (typeof flagValue.tools !== 'object' || Array.isArray(flagValue.tools)) {
177+
if (
178+
flagValue.tools === null ||
179+
typeof flagValue.tools !== 'object' ||
180+
Array.isArray(flagValue.tools)
181+
) {
178182
logger?.warn(
179183
`LaunchDarkly AI: Skipping tools: expected an object, got ${Array.isArray(flagValue.tools) ? 'array' : typeof flagValue.tools}`,
180184
);

0 commit comments

Comments
 (0)