fix: use main template for isMain groups in runtime registration

Main groups (e.g. telegram_main) should get the full main template
with Admin Context section, not the minimal global template.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
NanoClaw User
2026-03-25 14:43:08 +00:00
parent 80f6fb2b9a
commit 0240f48751

View File

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