fix(sdk): extensions: [] now disables discovery as documented (#465)

This commit is contained in:
Aliou Diallo 2026-01-05 16:55:51 +01:00 committed by GitHub
parent 6a8609ac56
commit 042d3fa310
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 6 deletions

View file

@ -444,6 +444,14 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
errors: [],
setUIContext: () => {},
};
} else if (options.extensions !== undefined) {
// User explicitly provided extensions array (even if empty) - skip discovery
// Inline factories from options.extensions are loaded below
extensionsResult = {
extensions: [],
errors: [],
setUIContext: () => {},
};
} else {
// Discover extensions, merging with additional paths
const configuredPaths = [...settingsManager.getExtensionPaths(), ...(options.additionalExtensionPaths ?? [])];