refactor: remove the main room concept

No room has room_settings.is_main = 1, so every main-only path was dead,
and admin work is done from the host shell. Each room's agent may now
only act on its own room:

- IPC: messages/inbound injection only to the source room; schedule,
  update, pause, resume and cancel only for the source room's tasks;
  drop the assign_room and refresh_groups IPC tasks and the deps they
  needed (assignRoom/syncGroups/getAvailableGroups/writeGroupsSnapshot)
- DB/host evidence is always scoped to the source group folder
- runner MCP server: drop the assign_room tool, the target_group_jid
  parameters and the isMain flag; list_tasks shows only the room's tasks
- drop EJCLAW_IS_MAIN, RunnerInput.isMain and AgentInput.isMain; the
  global CLAUDE.md memory is now included for every room
- drop the available_groups.json snapshot (available-groups.ts), the
  inferred restart announcement that only went to the main room, and
  the unused Channel.syncGroups hook
- setup register: drop --is-main; deregister-room: drop the main-room
  refusal and --force, and fix its unknown[] binding type error
- remove the groups/main/ template

The room_settings.is_main column and migrations are untouched; new rows
get the column default (0) and nothing reads it anymore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-10-01 19:37:29 +09:00
parent ce4547daa6
commit f127ac7a2b
62 changed files with 136 additions and 1412 deletions

View File

@@ -219,7 +219,6 @@ function storedRoomSettingsMatchesLegacySnapshot(
stored.name === snapshot.name &&
stored.folder === snapshot.folder &&
(stored.requiresTrigger ?? true) === snapshot.requiresTrigger &&
(stored.isMain ?? false) === snapshot.isMain &&
(stored.workDir ?? null) === (snapshot.workDir ?? null)
);
}
@@ -381,7 +380,6 @@ function collectLegacyRoomRegistrationSnapshot(
? preferredOwnerRow.trigger_pattern
: ownerRow.trigger_pattern,
requiresTrigger: (first.requires_trigger ?? 1) === 1,
isMain: (first.is_main ?? 0) === 1,
ownerAgentType,
workDir: first.work_dir ?? null,
};

View File

@@ -84,7 +84,6 @@ describe('register step', () => {
expect(assignRoomMock).toHaveBeenCalledWith('dc:test-room', {
name: 'Test Room',
folder: 'test-room',
isMain: false,
});
expect(mkdirSpy).toHaveBeenCalledWith('/tmp/ejclaw-groups/test-room/logs', {
recursive: true,
@@ -149,13 +148,11 @@ describe('register step', () => {
'Main Room',
'--folder',
'main-room',
'--is-main',
]);
expect(assignRoomMock).toHaveBeenCalledWith('dc:main-room', {
name: 'Main Room',
folder: 'main-room',
isMain: true,
});
expect(mkdirSpy).toHaveBeenCalledTimes(1);
expect(readSpy).not.toHaveBeenCalled();

View File

@@ -19,7 +19,6 @@ interface RegisterArgs {
name: string;
folder: string;
channel: string;
isMain: boolean;
assistantNameProvided: boolean;
}
@@ -29,7 +28,6 @@ function parseArgs(args: string[]): RegisterArgs {
name: '',
folder: '',
channel: 'discord',
isMain: false,
assistantNameProvided: false,
};
@@ -47,9 +45,6 @@ function parseArgs(args: string[]): RegisterArgs {
case '--channel':
result.channel = (args[++i] || '').toLowerCase();
break;
case '--is-main':
result.isMain = true;
break;
case '--assistant-name':
result.assistantNameProvided = true;
i += 1;
@@ -107,7 +102,6 @@ export async function run(args: string[]): Promise<void> {
assignRoom(parsed.jid, {
name: parsed.name,
folder: parsed.folder,
isMain: parsed.isMain,
});
logger.info('Assigned room through canonical room service');
@@ -121,7 +115,6 @@ export async function run(args: string[]): Promise<void> {
assignRoom(parsed.jid, {
name: parsed.name,
folder: parsed.folder,
isMain: parsed.isMain,
workDir: canonicalWorkDir,
});
logger.info(