fix(cli): decouple package commands from docker build

config add/remove-package should only update the DB and restart.
Image rebuild is handled by the self-mod approval flow or manually.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-05-09 12:09:11 +03:00
parent 9ce82588d9
commit 08698da0d2

View File

@@ -1,5 +1,4 @@
import type { McpServerConfig } from '../../container-config.js'; import type { McpServerConfig } from '../../container-config.js';
import { buildAgentGroupImage } from '../../container-runner.js';
import { restartAgentGroupContainers } from '../../container-restart.js'; import { restartAgentGroupContainers } from '../../container-restart.js';
import { import {
getContainerConfig, getContainerConfig,
@@ -180,10 +179,9 @@ registerResource({
} }
} }
await buildAgentGroupImage(id);
restartAgentGroupContainers(id, 'package added via ncl'); restartAgentGroupContainers(id, 'package added via ncl');
return { added: { apt: apt || null, npm: npm || null } }; return { added: { apt: apt || null, npm: npm || null }, note: 'Image rebuild required for packages to take effect. Use install_packages from the agent or rebuild manually.' };
}, },
}, },
'config remove-package': { 'config remove-package': {
@@ -211,10 +209,9 @@ registerResource({
updateContainerConfigJson(id, 'packages_npm', filtered); updateContainerConfigJson(id, 'packages_npm', filtered);
} }
await buildAgentGroupImage(id);
restartAgentGroupContainers(id, 'package removed via ncl'); restartAgentGroupContainers(id, 'package removed via ncl');
return { removed: { apt: apt || null, npm: npm || null } }; return { removed: { apt: apt || null, npm: npm || null }, note: 'Image rebuild required for package changes to take effect.' };
}, },
}, },
}, },