Fix --no-extensions flag not preventing extension discovery

When --no-extensions was used, extensionsResult.extensions was an empty
array. The condition in buildSessionOptions() checked .length > 0,
so preloadedExtensions was not set. This caused createAgentSession()
to fall through to extension discovery.

Remove the .length > 0 condition so the empty result is passed through,
signaling that extension loading was already handled.

Fixes #776
This commit is contained in:
Mario Zechner 2026-01-16 22:01:23 +01:00
parent 81f5a12e81
commit 3326b8f521
2 changed files with 2 additions and 1 deletions

View file

@ -304,7 +304,7 @@ function buildSessionOptions(
}
// Pre-loaded extensions (from early CLI flag discovery)
if (extensionsResult && extensionsResult.extensions.length > 0) {
if (extensionsResult) {
options.preloadedExtensions = extensionsResult;
}