Merge pull request #1444 from qwibitai/fix/ismain-template-selection

fix: use main template for isMain groups in runtime registration
This commit is contained in:
gavrielc
2026-03-25 17:37:39 +02:00
committed by GitHub

View File

@@ -138,7 +138,11 @@ function registerGroup(jid: string, group: RegisteredGroup): void {
// identity and instructions from the first run. (Fixes #1391) // identity and instructions from the first run. (Fixes #1391)
const groupMdFile = path.join(groupDir, 'CLAUDE.md'); const groupMdFile = path.join(groupDir, 'CLAUDE.md');
if (!fs.existsSync(groupMdFile)) { if (!fs.existsSync(groupMdFile)) {
const templateFile = path.join(GROUPS_DIR, 'global', 'CLAUDE.md'); const templateFile = path.join(
GROUPS_DIR,
group.isMain ? 'main' : 'global',
'CLAUDE.md',
);
if (fs.existsSync(templateFile)) { if (fs.existsSync(templateFile)) {
let content = fs.readFileSync(templateFile, 'utf-8'); let content = fs.readFileSync(templateFile, 'utf-8');
if (ASSISTANT_NAME !== 'Andy') { if (ASSISTANT_NAME !== 'Andy') {